net.sourceforge.webcompmath.awt.beans
Class WCMAnimatorBean

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 net.sourceforge.webcompmath.awt.Animator
                      extended by net.sourceforge.webcompmath.awt.beans.WCMAnimatorBean
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.ItemListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.lang.Runnable, java.util.EventListener, javax.accessibility.Accessible, InputObject, Tieable, ParserMathObject, MathObject, Value

public class WCMAnimatorBean
extends Animator
implements ParserMathObject

Author:
Tom Downey
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class net.sourceforge.webcompmath.awt.Animator
BACK_AND_FORTH, HORIZONTAL, LOOP, LOOP_CHOICE, NEXT_BUTTON, ONCE, PAUSE_BUTTON, PREV_BUTTON, SPEED_CHOICE, START_BUTTON, START_STOP_BUTTON, STOP_BUTTON, VERTICAL
 
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
WCMAnimatorBean()
          Default constructor, going from 0 to 1 in 10 steps.
 
Method Summary
 Value getIntervals()
          Get the number of intervals.
 int getLoopStyle()
          Get the loop style.
 MathObject getMathObject()
          return the embedded variable.
 Value getMax()
          Get the maximum value.
 int getMillisPerFrame()
          Get the number of milliseconds per frame.
 Value getMin()
          Get the minimum value.
 java.lang.String getName()
          Get the animator's name, which is the same as it's variable, which defaults to "k".
 int getOrientation()
          Get the orientation.
 java.lang.String getStartButtonName()
          Get the start button name.
 java.lang.String getStopButtonName()
          Get the text of the stop button.
 boolean getUndefinedWhenNotRunning()
          Get whether value is Double.NaN when not running.
 double getVal()
          Get the value.
 boolean isLoopChoice()
          Get whether the choice has been added.
 boolean isNextButton()
          Get whether the button has been added.
 boolean isPauseButton()
          Get whether the button has been added.
 boolean isPrevButton()
          Get whether the button has been added.
 boolean isSpeedChoice()
          Get whether the choice has been added.
 boolean isStartButton()
          Get whether the button has been added.
 boolean isStartStopButton()
          Get whether the button has been added.
 boolean isStopButton()
          Get whether the button has been added.
 void setIntervals(Value intervals)
          Set the number of intervals.
 void setLoopChoice(boolean b)
          Set whether to use the choice.
 void setLoopStyle(int style)
          Set the loop style to ONCE, LOOP, or BACK_AND_FORTH.
 void setMax(Value max)
          Set the maximum value.
 void setMillisPerFrame(int millis)
          Set the number of milliseconds per animation step.
 void setMin(Value min)
          Set the minimum value.
 void setName(java.lang.String name)
          Set the animator's name, which is the same as it's variable, which defaults to "k" if it isn't set explicitly.
 void setNextButton(boolean b)
          Set whether to use the button.
 void setOrientation(int orientation)
          Set the orientation to Animator.HORIZONTAL or Animator.VERTICAL
 void setPauseButton(boolean b)
          Set whether to use the button.
 void setPrevButton(boolean b)
          Set whether to use the button.
 void setSpeedChoice(boolean b)
          Set whether to use the choice.
 void setStartButton(boolean b)
          Set whether to use the button.
 void setStartButtonName(java.lang.String s)
          Set the start button name.
 void setStartStopButton(boolean b)
          Set whether to use the button.
 void setStopButton(boolean b)
          Set whether to use the button.
 void setStopButtonName(java.lang.String name)
          Set the text for the stop button.
 void setUndefinedWhenNotRunning(boolean undefinedWhenNotRunning)
          Set whether value is Double.NaN when not running.
 void setVal(double val)
          Set the value (typically used to set the initial value).
 
Methods inherited from class net.sourceforge.webcompmath.awt.Animator
actionPerformed, addControl, checkInput, getControl, getOnChange, getSerialNumber, getValueAsVariable, getValueAsVariable, hasControl, itemStateChanged, next, notifyControllerOnChange, pause, prev, removeControl, run, setForeground, setIntervals, setMax, setMin, setOnChange, start, stop, sync
 
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, getBaseline, getBaselineResizeBehavior, 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, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, 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, 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, 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, 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
 
Methods inherited from interface net.sourceforge.webcompmath.data.beans.ParserMathObject
addPropertyChangeListener, removePropertyChangeListener
 

Constructor Detail

WCMAnimatorBean

public WCMAnimatorBean()
Default constructor, going from 0 to 1 in 10 steps.

Method Detail

getMathObject

public MathObject getMathObject()
return the embedded variable.

Specified by:
getMathObject in interface ParserMathObject
Returns:
the MathObject that will be added to a parser
See Also:
ParserMathObject.getMathObject()

getName

public java.lang.String getName()
Get the animator's name, which is the same as it's variable, which defaults to "k".

Specified by:
getName in interface MathObject
Overrides:
getName in class java.awt.Component
Returns:
object's name
See Also:
Component.getName()

setName

public void setName(java.lang.String name)
Set the animator's name, which is the same as it's variable, which defaults to "k" if it isn't set explicitly.

Specified by:
setName in interface MathObject
Overrides:
setName in class java.awt.Component
Parameters:
name - object's name
See Also:
Component.setName(java.lang.String)

setStartStopButton

public void setStartStopButton(boolean b)
Set whether to use the button.

Parameters:
b - true or false

isStartStopButton

public boolean isStartStopButton()
Get whether the button has been added.

Returns:
true or false

setStartButton

public void setStartButton(boolean b)
Set whether to use the button.

Parameters:
b - true or false

isStartButton

public boolean isStartButton()
Get whether the button has been added.

Returns:
true or false

setStopButton

public void setStopButton(boolean b)
Set whether to use the button.

Parameters:
b - true or false

isStopButton

public boolean isStopButton()
Get whether the button has been added.

Returns:
true or false

setPauseButton

public void setPauseButton(boolean b)
Set whether to use the button.

Parameters:
b - true or false

isPauseButton

public boolean isPauseButton()
Get whether the button has been added.

Returns:
true or false

setNextButton

public void setNextButton(boolean b)
Set whether to use the button.

Parameters:
b - true or false

isNextButton

public boolean isNextButton()
Get whether the button has been added.

Returns:
true or false

setPrevButton

public void setPrevButton(boolean b)
Set whether to use the button.

Parameters:
b - true or false

isPrevButton

public boolean isPrevButton()
Get whether the button has been added.

Returns:
true or false

setSpeedChoice

public void setSpeedChoice(boolean b)
Set whether to use the choice.

Parameters:
b - true or false

isSpeedChoice

public boolean isSpeedChoice()
Get whether the choice has been added.

Returns:
true or false

setLoopChoice

public void setLoopChoice(boolean b)
Set whether to use the choice.

Parameters:
b - true or false

isLoopChoice

public boolean isLoopChoice()
Get whether the choice has been added.

Returns:
true or false

setStartButtonName

public void setStartButtonName(java.lang.String s)
Set the start button name.

Overrides:
setStartButtonName in class Animator
Parameters:
s - the name of the button
See Also:
Animator.setStartButtonName(java.lang.String)

getStartButtonName

public java.lang.String getStartButtonName()
Get the start button name.

Overrides:
getStartButtonName in class Animator
Returns:
the name
See Also:
Animator.getStartButtonName()

setLoopStyle

public void setLoopStyle(int style)
Set the loop style to ONCE, LOOP, or BACK_AND_FORTH.

Overrides:
setLoopStyle in class Animator
Parameters:
style - the desired looping style
See Also:
Animator.setLoopStyle(int)

getLoopStyle

public int getLoopStyle()
Get the loop style.

Overrides:
getLoopStyle in class Animator
Returns:
the looping style
See Also:
Animator.getLoopStyle()

setMillisPerFrame

public void setMillisPerFrame(int millis)
Set the number of milliseconds per animation step.

Overrides:
setMillisPerFrame in class Animator
Parameters:
millis - the desired milliseconds per frame
See Also:
Animator.setMillisPerFrame(int)

getMillisPerFrame

public int getMillisPerFrame()
Get the number of milliseconds per frame.

Overrides:
getMillisPerFrame in class Animator
Returns:
milliseconds per frame
See Also:
Animator.getMillisPerFrame()

setOrientation

public void setOrientation(int orientation)
Set the orientation to Animator.HORIZONTAL or Animator.VERTICAL

Overrides:
setOrientation in class Animator
Parameters:
orientation - vertical or horizontal
See Also:
Animator.setOrientation(int)

getOrientation

public int getOrientation()
Get the orientation.

Overrides:
getOrientation in class Animator
Returns:
vertical or horizontal
See Also:
Animator.getOrientation()

setStopButtonName

public void setStopButtonName(java.lang.String name)
Set the text for the stop button.

Overrides:
setStopButtonName in class Animator
Parameters:
name - the name of the button
See Also:
Animator.setStopButtonName(java.lang.String)

getStopButtonName

public java.lang.String getStopButtonName()
Get the text of the stop button.

Overrides:
getStopButtonName in class Animator
Returns:
the name
See Also:
Animator.getStopButtonName()

setUndefinedWhenNotRunning

public void setUndefinedWhenNotRunning(boolean undefinedWhenNotRunning)
Set whether value is Double.NaN when not running.

Overrides:
setUndefinedWhenNotRunning in class Animator
Parameters:
undefinedWhenNotRunning - true or false
See Also:
Animator.setUndefinedWhenNotRunning(boolean)

getUndefinedWhenNotRunning

public boolean getUndefinedWhenNotRunning()
Get whether value is Double.NaN when not running.

Overrides:
getUndefinedWhenNotRunning in class Animator
Returns:
true or false
See Also:
Animator.getUndefinedWhenNotRunning()

setVal

public void setVal(double val)
Set the value (typically used to set the initial value).

Overrides:
setVal in class Animator
Parameters:
val - the desired value
See Also:
Animator.setVal(double)

getVal

public double getVal()
Get the value.

Specified by:
getVal in interface Value
Overrides:
getVal in class Animator
Returns:
the current value
See Also:
Animator.getVal()

setIntervals

public void setIntervals(Value intervals)
Set the number of intervals.

Overrides:
setIntervals in class Animator
Parameters:
intervals - the desired number of frames
See Also:
Animator.setIntervals(net.sourceforge.webcompmath.data.Value)

getIntervals

public Value getIntervals()
Get the number of intervals.

Overrides:
getIntervals in class Animator
Returns:
the number of frames
See Also:
Animator.getIntervals()

setMax

public void setMax(Value max)
Set the maximum value.

Overrides:
setMax in class Animator
Parameters:
max - value object specifying the max value
See Also:
Animator.setMax(net.sourceforge.webcompmath.data.Value)

getMax

public Value getMax()
Get the maximum value.

Overrides:
getMax in class Animator
Returns:
value object
See Also:
Animator.getMax()

setMin

public void setMin(Value min)
Set the minimum value.

Overrides:
setMin in class Animator
Parameters:
min - the desired min value
See Also:
Animator.setMin(net.sourceforge.webcompmath.data.Value)

getMin

public Value getMin()
Get the minimum value.

Overrides:
getMin in class Animator
Returns:
the min value
See Also:
Animator.getMin()