standup.clouds
Class PanelCloudButtonMenu

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by standup.clouds.PanelCloudButtonMenu
All Implemented Interfaces:
ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

public class PanelCloudButtonMenu
extends JPanel
implements ActionListener

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
(package private)  int actualStepsNeeded
           
(package private)  AnimatorLock animatorLock
           
private  boolean animInProgress
           
private  String animType
           
(package private) static int concount
           
private  int currentpage
           
(package private) static int defaultSteps
           
(package private)  Dimension dimension
           
private  List<EntityAnimatedInteractive> entities
           
private  int frame
           
private  CloudFrontend frontend
           
(package private) static int height
           
private  int intervalOffset
           
static Color KEYWORD_COLOR
           
private  Timer myTimer
           
private  boolean scannerRepoll
           
static int SELECT
           
private static long serialVersionUID
           
static Color TOPIC_COLOR
           
static int TRANSITION
           
static Color TYPE_COLOR
           
(package private) static int width
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
PanelCloudButtonMenu(int _w, int _h, CloudFrontend _m)
           
 
Method Summary
 void actionPerformed(ActionEvent e)
          This is the method that should actually perform the animation!
private  void addEntity(EntityAnimatedInteractive ent)
          Adds the given EntityAnimatedInteractive to the list of "active" entities in this PanelCloudButtonMenu.
(package private)  void addPrevNextButtons(int page, CloudButton thing, int n)
           
(package private)  boolean animationInProgress()
           
(package private)  void clearEntities()
          Adds the given EntityAnimatedInteractive to the list of "active" entities in this PanelCloudButtonMenu.
(package private)  float getAngle(int ii, int n, boolean defaultExists)
           
(package private)  Point getCenter()
           
 int getCurrentPage()
           
static AttributedString getDefaultLabel(String label)
           
(package private)  Dimension getDimension()
           
private  Dimension getEllipseDimension(CloudButton centre, List<? extends CloudButton> kids)
           
private  float getMyNewOffsetAngle(float starting, float ii, float step)
           
private  int getOffsetAngle(int n)
           
 int getPageNum(CloudButton thing)
          Given a Lubble, this method determines the page number of its parent that it should appear on.
(package private)  Point getRingCoord(Dimension ellipseDimension, int ii, int n, boolean defaultExists)
           
 EntityAnimatedInteractive[] getScannableItems()
           
static AttributedString getTwoToneLabel(String s1, String s2, Color color)
           
 void lubbleDoScroller(CloudButton thing, int page, int direction, AnimatorLock _animatorLock)
           
 void lubbleGrowInCentre(CloudButton from, AnimatorLock _animatorLock)
           
 void lubbleGrowKids(CloudButton thing, AnimatorLock _animatorLock)
           
 void lubbleGrowKids(CloudButton thing, int page, AnimatorLock _animatorLock)
           
 void lubbleGrowOthers(CloudButton thing, AnimatorLock _animatorLock)
          Given Lubble thing, this method performs the following animation: -thing is drawn static in its designated position.
 void lubbleMoveToCentre(CloudButton thing, AnimatorLock _animatorLock)
           
 void lubbleMoveToPeriphery(CloudButton thing, AnimatorLock _animatorLock)
           
 void lubbleShrinkInCentre(CloudButton from, AnimatorLock _animatorLock)
           
 void lubbleShrinkKids(CloudButton thing, AnimatorLock _animatorLock)
          Given Lubble thing, this method performs the following animation: -all thing's children (including the centre lubble) are animated to 'shrink' to size 0.
 void lubbleShrinkOthers(CloudButton thing, AnimatorLock _animatorLock)
          Given Lubble thing, this method performs the following animation: -thing is drawn static in its designated position.
protected  void paintComponent(Graphics arg0)
           
(package private)  boolean scannerRepollNeeded()
           
(package private)  void setScannerRepoll(boolean val)
           
(package private)  void startAnimation(int actStepNd, String _animationType)
           
private  void updateEntities()
          Updates the list of "active" entities in this PanelCloudButtonMenu according to the various animation routines.
private  void waitOnLock(AnimatorLock lock)
           
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

TOPIC_COLOR

public static final Color TOPIC_COLOR

KEYWORD_COLOR

public static final Color KEYWORD_COLOR

TYPE_COLOR

public static final Color TYPE_COLOR

animatorLock

AnimatorLock animatorLock

frontend

private CloudFrontend frontend

entities

private List<EntityAnimatedInteractive> entities

width

static int width

height

static int height

dimension

final Dimension dimension

frame

private int frame

intervalOffset

private int intervalOffset

animInProgress

private boolean animInProgress

defaultSteps

static final int defaultSteps
See Also:
Constant Field Values

actualStepsNeeded

int actualStepsNeeded

TRANSITION

public static final int TRANSITION
See Also:
Constant Field Values

SELECT

public static final int SELECT
See Also:
Constant Field Values

currentpage

private int currentpage

scannerRepoll

private boolean scannerRepoll

concount

static int concount

myTimer

private Timer myTimer

animType

private String animType
Constructor Detail

PanelCloudButtonMenu

public PanelCloudButtonMenu(int _w,
                            int _h,
                            CloudFrontend _m)
Method Detail

waitOnLock

private void waitOnLock(AnimatorLock lock)

animationInProgress

boolean animationInProgress()

scannerRepollNeeded

boolean scannerRepollNeeded()

setScannerRepoll

void setScannerRepoll(boolean val)

addEntity

private void addEntity(EntityAnimatedInteractive ent)
Adds the given EntityAnimatedInteractive to the list of "active" entities in this PanelCloudButtonMenu. This should only ever be called on the EventDispatchThread! Use SwingUtilities.invokeLater(Runnable) or SwingUtilities.invokeAndWait(Runnable).

Parameters:
ent -

clearEntities

void clearEntities()
Adds the given EntityAnimatedInteractive to the list of "active" entities in this PanelCloudButtonMenu. This should only ever be called on the EventDispatchThread! Use SwingUtilities.invokeLater(Runnable) or SwingUtilities.invokeAndWait(Runnable).


getScannableItems

public EntityAnimatedInteractive[] getScannableItems()

getCenter

Point getCenter()

getDimension

Dimension getDimension()

paintComponent

protected void paintComponent(Graphics arg0)
Overrides:
paintComponent in class JComponent

getOffsetAngle

private int getOffsetAngle(int n)

getMyNewOffsetAngle

private float getMyNewOffsetAngle(float starting,
                                  float ii,
                                  float step)

getAngle

float getAngle(int ii,
               int n,
               boolean defaultExists)

getRingCoord

Point getRingCoord(Dimension ellipseDimension,
                   int ii,
                   int n,
                   boolean defaultExists)

addPrevNextButtons

void addPrevNextButtons(int page,
                        CloudButton thing,
                        int n)

getCurrentPage

public int getCurrentPage()

getPageNum

public int getPageNum(CloudButton thing)
Given a Lubble, this method determines the page number of its parent that it should appear on. For example, if thing is the 10th child and its parent has a MaxN of 4, it will return 2, i.e. the 3rd page.


lubbleDoScroller

public void lubbleDoScroller(CloudButton thing,
                             int page,
                             int direction,
                             AnimatorLock _animatorLock)

lubbleShrinkInCentre

public void lubbleShrinkInCentre(CloudButton from,
                                 AnimatorLock _animatorLock)

lubbleGrowInCentre

public void lubbleGrowInCentre(CloudButton from,
                               AnimatorLock _animatorLock)

getEllipseDimension

private Dimension getEllipseDimension(CloudButton centre,
                                      List<? extends CloudButton> kids)

lubbleMoveToPeriphery

public void lubbleMoveToPeriphery(CloudButton thing,
                                  AnimatorLock _animatorLock)

lubbleMoveToCentre

public void lubbleMoveToCentre(CloudButton thing,
                               AnimatorLock _animatorLock)

lubbleGrowOthers

public void lubbleGrowOthers(CloudButton thing,
                             AnimatorLock _animatorLock)
Given Lubble thing, this method performs the following animation: -thing is drawn static in its designated position. -thing's siblings which appear on the same page are animated to 'grow' in from size 0.

Parameters:
thing -
_animatorLock -

lubbleShrinkOthers

public void lubbleShrinkOthers(CloudButton thing,
                               AnimatorLock _animatorLock)
Given Lubble thing, this method performs the following animation: -thing is drawn static in its designated position. -thing's siblings which appear on the same page are animated to 'shrink' to size 0.

Parameters:
thing -
_animatorLock -

lubbleShrinkKids

public void lubbleShrinkKids(CloudButton thing,
                             AnimatorLock _animatorLock)
Given Lubble thing, this method performs the following animation: -all thing's children (including the centre lubble) are animated to 'shrink' to size 0.

Parameters:
thing -
_animatorLock -

lubbleGrowKids

public void lubbleGrowKids(CloudButton thing,
                           AnimatorLock _animatorLock)

lubbleGrowKids

public void lubbleGrowKids(CloudButton thing,
                           int page,
                           AnimatorLock _animatorLock)

getTwoToneLabel

public static AttributedString getTwoToneLabel(String s1,
                                               String s2,
                                               Color color)

getDefaultLabel

public static AttributedString getDefaultLabel(String label)

updateEntities

private void updateEntities()
Updates the list of "active" entities in this PanelCloudButtonMenu according to the various animation routines. This should only ever be called on the EventDispatchThread! Use SwingUtilities.invokeLater(Runnable) or SwingUtilities.invokeAndWait(Runnable).


actionPerformed

public void actionPerformed(ActionEvent e)
This is the method that should actually perform the animation!

Specified by:
actionPerformed in interface ActionListener
Parameters:
e -

startAnimation

void startAnimation(int actStepNd,
                    String _animationType)