visad.java3d
Class AnimationControlJ3D

java.lang.Object
  extended by visad.Control
      extended by visad.java3d.AVControlJ3D
          extended by visad.java3d.AnimationControlJ3D
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Runnable, AnimationControl, AVControl
Direct Known Subclasses:
DownRoundingAnimationControlJ3D

public class AnimationControlJ3D
extends AVControlJ3D
implements java.lang.Runnable, AnimationControl

AnimationControlJ3D is the VisAD class for controlling Animation display scalars under Java3D.

WLH - manipulate a list of Switch nodes in scene graph.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class visad.java3d.AVControlJ3D
AVControlJ3D.SwitchSet
 
Field Summary
protected  int current
           
 
Constructor Summary
AnimationControlJ3D(DisplayImplJ3D d, RealType r)
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 int getCurrent()
          get the current ordinal step number
 boolean getDirection()
          Get the animation direction.
 boolean getOn()
          return true if automatic stepping is on
 RealType getRealType()
           
 java.lang.String getSaveString()
          get a String that can be used to reconstruct this AnimationControl later
 Set getSet()
          get Set of RealType values for animation steps
 long getStep()
          Return the dwell time for the current step
 long[] getSteps()
          return an array of the dwell times for all the steps.
 void init()
           
 void nullControl()
          end this control
 void run()
           
 void setCurrent(double value)
          set the current step by the value of the RealType mapped to Display.Animation
 void setCurrent(int c)
          set the current ordinal step number = c
 void setDirection(boolean dir)
          Set the animation direction.
 void setOn(boolean o)
          Set automatic stepping on or off.
 void setSaveString(java.lang.String save)
          reconstruct this AnimationControl using the specified save string
 void setSet(Set s)
           
 void setSet(Set s, boolean noChange)
          changeControl(!noChange) to not trigger re-transform, used by ScalarMap.setRange
 void setStep(int st)
          set the dwell time for all steps
 void setSteps(int[] steps)
          set the dwell time for individual steps.
 void stop()
           
 boolean subCheckTicks(DataRenderer r, DataDisplayLink link)
          run checkTicks on any sub-Controls; this default for no sub-Controls
 boolean subPeekTicks(DataRenderer r, DataDisplayLink link)
          run peekTicks on any sub-Controls; this default for no sub-Controls
 void subResetTicks()
          run resetTicks on any sub-Controls; this default for no sub-Controls
 void subSetTicks()
          run setTicks on any sub-Controls; this default for no sub-Controls
 void syncControl(Control rmt)
          copy the state of a remote control to this control
 void takeStep()
          advance one step (forward or backward)
 void toggle()
          toggle automatic stepping between off and on
 
Methods inherited from class visad.java3d.AVControlJ3D
addPair, clearSwitches, getSwitches, selectSwitches
 
Methods inherited from class visad.Control
addControlListener, animation_string, changeControl, checkTicks, clone, getDisplay, getDisplayRenderer, getInstanceNumber, incTick, peekTicks, removeControlListener, resetTicks, setTicks, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface visad.AVControl
addControlListener, clearSwitches, removeControlListener
 

Field Detail

current

protected int current
Constructor Detail

AnimationControlJ3D

public AnimationControlJ3D(DisplayImplJ3D d,
                           RealType r)
Method Detail

nullControl

public void nullControl()
Description copied from class: Control
end this control

Overrides:
nullControl in class Control

stop

public void stop()
Specified by:
stop in interface AnimationControl

run

public void run()
Specified by:
run in interface java.lang.Runnable
Specified by:
run in interface AnimationControl

getCurrent

public int getCurrent()
Description copied from interface: AnimationControl
get the current ordinal step number

Specified by:
getCurrent in interface AnimationControl

setCurrent

public void setCurrent(int c)
                throws VisADException,
                       java.rmi.RemoteException
set the current ordinal step number = c

Specified by:
setCurrent in interface AnimationControl
Throws:
VisADException
java.rmi.RemoteException

setCurrent

public void setCurrent(double value)
                throws VisADException,
                       java.rmi.RemoteException
set the current step by the value of the RealType mapped to Display.Animation

Specified by:
setCurrent in interface AnimationControl
Throws:
VisADException
java.rmi.RemoteException

setDirection

public void setDirection(boolean dir)
                  throws VisADException,
                         java.rmi.RemoteException
Set the animation direction.

Specified by:
setDirection in interface AnimationControl
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:
getDirection in interface AnimationControl
Returns:
true for forward, false for backward

getStep

public long getStep()
Return the dwell time for the current step

Specified by:
getStep in interface AnimationControl

getSteps

public long[] getSteps()
return an array of the dwell times for all the steps.

Specified by:
getSteps in interface AnimationControl

setStep

public void setStep(int st)
             throws VisADException,
                    java.rmi.RemoteException
set the dwell time for all steps

Specified by:
setStep in interface AnimationControl
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.RemoteException
set the dwell time for individual steps.

Specified by:
setSteps in interface AnimationControl
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.RemoteException
advance one step (forward or backward)

Specified by:
takeStep in interface AnimationControl
Throws:
VisADException - Couldn't create necessary VisAD object. No step is taken.
java.rmi.RemoteException - Java RMI exception

init

public void init()
          throws VisADException
Specified by:
init in interface AnimationControl
Specified by:
init in class AVControlJ3D
Throws:
VisADException

getSet

public Set getSet()
Description copied from interface: AnimationControl
get Set of RealType values for animation steps

Specified by:
getSet in interface AnimationControl

setSet

public void setSet(Set s)
            throws VisADException,
                   java.rmi.RemoteException
Specified by:
setSet in interface AnimationControl
Throws:
VisADException
java.rmi.RemoteException

setSet

public void setSet(Set s,
                   boolean noChange)
            throws VisADException,
                   java.rmi.RemoteException
changeControl(!noChange) to not trigger re-transform, used by ScalarMap.setRange

Specified by:
setSet in interface AnimationControl
Throws:
VisADException
java.rmi.RemoteException

getOn

public boolean getOn()
return true if automatic stepping is on

Specified by:
getOn in interface AnimationControl

setOn

public void setOn(boolean o)
           throws VisADException,
                  java.rmi.RemoteException
Set automatic stepping on or off.

Specified by:
setOn in interface AnimationControl
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.RemoteException
toggle automatic stepping between off and on

Specified by:
toggle in interface AnimationControl
Throws:
VisADException - Couldn't create necessary VisAD object. No change in automatic stepping occurs.
java.rmi.RemoteException - Java RMI exception

getRealType

public RealType getRealType()

subSetTicks

public void subSetTicks()
Description copied from class: Control
run setTicks on any sub-Controls; this default for no sub-Controls

Overrides:
subSetTicks in class Control

subCheckTicks

public boolean subCheckTicks(DataRenderer r,
                             DataDisplayLink link)
Description copied from class: Control
run checkTicks on any sub-Controls; this default for no sub-Controls

Overrides:
subCheckTicks in class Control

subPeekTicks

public boolean subPeekTicks(DataRenderer r,
                            DataDisplayLink link)
Description copied from class: Control
run peekTicks on any sub-Controls; this default for no sub-Controls

Overrides:
subPeekTicks in class Control

subResetTicks

public void subResetTicks()
Description copied from class: Control
run resetTicks on any sub-Controls; this default for no sub-Controls

Overrides:
subResetTicks in class Control

getSaveString

public java.lang.String getSaveString()
get a String that can be used to reconstruct this AnimationControl later

Specified by:
getSaveString in interface AVControl
Specified by:
getSaveString in class Control

setSaveString

public void setSaveString(java.lang.String save)
                   throws VisADException,
                          java.rmi.RemoteException
reconstruct this AnimationControl using the specified save string

Specified by:
setSaveString in interface AVControl
Specified by:
setSaveString in class Control
Throws:
VisADException
java.rmi.RemoteException

syncControl

public void syncControl(Control rmt)
                 throws VisADException
copy the state of a remote control to this control

Specified by:
syncControl in class Control
Throws:
VisADException

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class AVControlJ3D