visad.java2d
Class AnimationControlJ2D
- java.lang.Object
-
- visad.Control
-
- visad.java2d.AVControlJ2D
-
- visad.java2d.AnimationControlJ2D
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, java.lang.Runnable, AnimationControl, AVControl
public class AnimationControlJ2D extends AVControlJ2D implements java.lang.Runnable, AnimationControl
AnimationControlJ2D is the VisAD class for controlling Animation display scalars under Java2D.WLH - manipulate a list of VisADSwitch nodes in scene graph.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description AnimationControlJ2D(DisplayImplJ2D d, RealType r)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanequals(java.lang.Object o)Indicates whether or not this instance equals an ObjectbooleangetComputeSet()Get the flag to automatically compute the animation set if it is nullintgetCurrent()get the current ordinal step numberbooleangetDirection()Get the animation direction.booleangetOn()return true if automatic stepping is onjava.lang.StringgetSaveString()get a String that can be used to reconstruct this AnimationControl laterSetgetSet()longgetStep()Return the dwell time for the current steplong[]getSteps()return an array of the dwell times for all the steps.voidinit()actually set Switches (Java3D) or VisADSwitches (Java2D) to child nodes corresponding to current ordinal step numbervoidnullControl()end this control (called by ScalarMap.nullDisplay())voidrun()a single invocation implements anmation behavior until stop() is calledvoidsetComputeSet(boolean compute)Set the flag to automatically compute the animation set if it is nullvoidsetCurrent(double value)set the current step by the value of the RealType mapped to Display.AnimationvoidsetCurrent(int c)set the current ordinal step number = cvoidsetDirection(boolean dir)Set the animation direction.voidsetOn(boolean o)Set automatic stepping on or off.voidsetSaveString(java.lang.String save)reconstruct this AnimationControl using the specified save stringvoidsetSet(Set s)Sets the set of times in this animation control.voidsetSet(Set s, boolean noChange)Sets the set of times in this animation control.voidsetStep(int st)Set the dwell rate between animation steps to a constant valuevoidsetSteps(int[] steps)set the dwell time for individual steps.voidstop()stop activity in this AnimationControlbooleansubCheckTicks(DataRenderer r, DataDisplayLink link)run checkTicks on any sub-Controls this default for no sub-ControlsbooleansubPeekTicks(DataRenderer r, DataDisplayLink link)run peekTicks on any sub-Controls this default for no sub-ControlsvoidsubResetTicks()run resetTicks on any sub-Controls this default for no sub-ControlsvoidsubSetTicks()run setTicks on any sub-Controls; this default for no sub-ControlsvoidsyncControl(Control rmt)copy the state of a remote control to this controlvoidtakeStep()advance one step (forward or backward)voidtoggle()toggle automatic stepping between off and onjava.lang.StringtoString()-
Methods inherited from class visad.java2d.AVControlJ2D
clearSwitches, selectSwitches
-
Methods inherited from class visad.Control
addControlListener, animation_string, changeControl, checkTicks, clone, getDisplay, getDisplayRenderer, getInstanceNumber, incTick, peekTicks, removeControlListener, resetTicks, setTicks
-
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface visad.AVControl
addControlListener, clearSwitches, removeControlListener
-
-
-
-
Constructor Detail
-
AnimationControlJ2D
public AnimationControlJ2D(DisplayImplJ2D d, RealType r)
-
-
Method Detail
-
nullControl
public void nullControl()
Description copied from class:Controlend this control (called by ScalarMap.nullDisplay())- Overrides:
nullControlin classControl
-
stop
public void stop()
Description copied from interface:AnimationControlstop activity in this AnimationControl- Specified by:
stopin interfaceAnimationControl
-
run
public void run()
Description copied from interface:AnimationControla single invocation implements anmation behavior until stop() is called- Specified by:
runin interfacejava.lang.Runnable- Specified by:
runin interfaceAnimationControl
-
getCurrent
public int getCurrent()
get the current ordinal step number- Specified by:
getCurrentin interfaceAnimationControl- Returns:
- the current ordinal step number
-
setCurrent
public void setCurrent(int c) throws VisADException, java.rmi.RemoteExceptionset the current ordinal step number = c- Specified by:
setCurrentin interfaceAnimationControl- Parameters:
c- - value for current ordinal step number- Throws:
VisADException- - a VisAD error occurredjava.rmi.RemoteException- - an RMI error occurred
-
setCurrent
public void setCurrent(double value) throws VisADException, java.rmi.RemoteExceptionset the current step by the value of the RealType mapped to Display.Animation- Specified by:
setCurrentin interfaceAnimationControl- Parameters:
value- - RealType value that is converted to an ordinal step number- Throws:
VisADException- - a VisAD error occurredjava.rmi.RemoteException- - an RMI error occurred
-
setDirection
public void setDirection(boolean dir) throws VisADException, java.rmi.RemoteExceptionSet the animation direction.- Specified by:
setDirectionin interfaceAnimationControl- Parameters:
dir- true for forward, false for backward- Throws:
VisADException- Couldn't create necessary VisAD object. The direction remains unchanged.java.rmi.RemoteException- Java RMI exception
-
getDirection
public boolean getDirection()
Get the animation direction.- Specified by:
getDirectionin interfaceAnimationControl- Returns:
- true for forward, false for backward
-
getStep
public long getStep()
Return the dwell time for the current step- Specified by:
getStepin interfaceAnimationControl- Returns:
- the dwell time for the current step (in ms)
-
getSteps
public long[] getSteps()
return an array of the dwell times for all the steps.- Specified by:
getStepsin interfaceAnimationControl- Returns:
- an array of the dwell times for all the steps (in ms)
-
setStep
public void setStep(int st) throws VisADException, java.rmi.RemoteExceptionSet the dwell rate between animation steps to a constant value- Specified by:
setStepin interfaceAnimationControl- Parameters:
st- dwell time in milliseconds- Throws:
VisADException- Couldn't create necessary VisAD object. The dwell time remains unchanged.java.rmi.RemoteException- Java RMI exception
-
setSteps
public void setSteps(int[] steps) throws VisADException, java.rmi.RemoteExceptionset the dwell time for individual steps.- Specified by:
setStepsin interfaceAnimationControl- Parameters:
steps- an array of dwell rates for each step in the animation If the length of the array is less than the number of frames in the animation, the subsequent step values will be set to the value of the last step.- Throws:
VisADException- Couldn't create necessary VisAD object. The dwell times remain unchanged.java.rmi.RemoteException- Java RMI exception
-
takeStep
public void takeStep() throws VisADException, java.rmi.RemoteExceptionadvance one step (forward or backward)- Specified by:
takeStepin interfaceAnimationControl- Throws:
VisADException- Couldn't create necessary VisAD object. No step is taken.java.rmi.RemoteException- Java RMI exception
-
init
public void init() throws VisADExceptionDescription copied from interface:AnimationControlactually set Switches (Java3D) or VisADSwitches (Java2D) to child nodes corresponding to current ordinal step number- Specified by:
initin interfaceAnimationControl- Throws:
VisADException- - a VisAD error occurred.
-
getSet
public Set getSet()
- Specified by:
getSetin interfaceAnimationControl- Returns:
- Set of RealType values for animation steps, in RealType mapped to Animation
-
setSet
public void setSet(Set s) throws VisADException, java.rmi.RemoteException
Sets the set of times in this animation control. If the argument set is equal to the current set, then nothing is done.
- Specified by:
setSetin interfaceAnimationControl- Parameters:
s- The set of times.- Throws:
VisADException- if a VisAD failure occurs.java.rmi.RemoteException- if a Java RMI failure occurs.
-
setSet
public void setSet(Set s, boolean noChange) throws VisADException, java.rmi.RemoteException
Sets the set of times in this animation control. If the argument set is equal to the current set, then nothing is done.
- Specified by:
setSetin interfaceAnimationControl- Parameters:
s- The set of times.noChange- changeControl(!noChange) to not trigger re-transform, used by ScalarMap.setRange- Throws:
VisADException- if a VisAD failure occurs.java.rmi.RemoteException- if a Java RMI failure occurs.
-
getOn
public boolean getOn()
return true if automatic stepping is on- Specified by:
getOnin interfaceAnimationControl- Returns:
- true if automatic stepping is on, false otherwise
-
setOn
public void setOn(boolean o) throws VisADException, java.rmi.RemoteExceptionSet automatic stepping on or off.- Specified by:
setOnin interfaceAnimationControl- Parameters:
o- true = turn stepping on, false = turn stepping off- Throws:
VisADException- Couldn't create necessary VisAD object. No change in automatic stepping occurs.java.rmi.RemoteException- Java RMI exception
-
toggle
public void toggle() throws VisADException, java.rmi.RemoteExceptiontoggle automatic stepping between off and on- Specified by:
togglein interfaceAnimationControl- Throws:
VisADException- Couldn't create necessary VisAD object. No change in automatic stepping occurs.java.rmi.RemoteException- Java RMI exception
-
subSetTicks
public void subSetTicks()
Description copied from class:Controlrun setTicks on any sub-Controls; this default for no sub-Controls- Overrides:
subSetTicksin classControl
-
subCheckTicks
public boolean subCheckTicks(DataRenderer r, DataDisplayLink link)
Description copied from class:Controlrun checkTicks on any sub-Controls this default for no sub-Controls- Overrides:
subCheckTicksin classControl- Parameters:
r- DataRenderer to check if changes to this Control require re-transformlink- DataDisplayLink involved in decision whether changes to this Control require re-transform- Returns:
- 'logical or' of values from checkTicks on sub-Controls
-
subPeekTicks
public boolean subPeekTicks(DataRenderer r, DataDisplayLink link)
Description copied from class:Controlrun peekTicks on any sub-Controls this default for no sub-Controls- Overrides:
subPeekTicksin classControl- Parameters:
r- DataRenderer to check if changes to this Control require re-transformlink- DataDisplayLink involved in decision whether changes to this Control require re-transform- Returns:
- 'logical or' of values from peekTicks on sub-Controls
-
subResetTicks
public void subResetTicks()
Description copied from class:Controlrun resetTicks on any sub-Controls this default for no sub-Controls- Overrides:
subResetTicksin classControl
-
getSaveString
public java.lang.String getSaveString()
get a String that can be used to reconstruct this AnimationControl later- Specified by:
getSaveStringin interfaceAVControl- Specified by:
getSaveStringin classControl- Returns:
- String representation of this Control
-
setSaveString
public void setSaveString(java.lang.String save) throws VisADException, java.rmi.RemoteExceptionreconstruct this AnimationControl using the specified save string- Specified by:
setSaveStringin interfaceAVControl- Specified by:
setSaveStringin classControl- Parameters:
save- - String representation for reconstruction- Throws:
VisADException- if a VisAD error occursjava.rmi.RemoteException- if an RMI error occurs
-
syncControl
public void syncControl(Control rmt) throws VisADException
copy the state of a remote control to this control- Specified by:
syncControlin classControl- Parameters:
rmt- remote Control whose state is copied- Throws:
VisADException- if a VisAD error occurs
-
equals
public boolean equals(java.lang.Object o)
Description copied from class:ControlIndicates whether or not this instance equals an Object- Overrides:
equalsin classAVControlJ2D- Parameters:
o- an Object- Returns:
- true if and only if this instance is equal to o
-
toString
public java.lang.String toString()
-
setComputeSet
public void setComputeSet(boolean compute)
Set the flag to automatically compute the animation set if it is null- Specified by:
setComputeSetin interfaceAnimationControl- Parameters:
compute- false to allow application to control set computation if set is null.
-
getComputeSet
public boolean getComputeSet()
Get the flag to automatically compute the animation set if it is null- Specified by:
getComputeSetin interfaceAnimationControl- Returns:
- true if should compute
-
-
DMelt 3.0 © DataMelt by jWork.ORG