visad
Interface AnimationControl

All Superinterfaces:
AVControl
All Known Implementing Classes:
AnimationControlJ2D, AnimationControlJ3D, DownRoundingAnimationControlJ3D

public interface AnimationControl
extends AVControl

AnimationControl is the VisAD interface for controlling Animation display scalars. Current implementations also implement Runnable


Method Summary
 boolean getComputeSet()
          Get the flag to automatically compute the animation set if it is null
 int getCurrent()
           
 boolean getDirection()
          Get the animation direction.
 boolean getOn()
           
 Set getSet()
           
 long getStep()
           
 long[] getSteps()
           
 void init()
          actually set Switches (Java3D) or VisADSwitches (Java2D) to child nodes corresponding to current ordinal step number
 void run()
          a single invocation implements anmation behavior until stop() is called
 void setComputeSet(boolean compute)
          Set the flag to automatically compute the animation set if it is null
 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
 void setDirection(boolean dir)
          Set the animation direction.
 void setOn(boolean o)
          Set automatic stepping on or off.
 void setSet(Set s)
          Sets the set of times in this animation control, in RealType mapped to Animation.
 void setSet(Set s, boolean noChange)
          Sets the set of times in this animation control, in RealType mapped to Animation.
 void setStep(int st)
          Set the dwell rate between animation steps to a constant value
 void setSteps(int[] steps)
          set the dwell time for individual steps.
 void stop()
          stop activity in this AnimationControl
 void takeStep()
          advance one step (forward or backward)
 void toggle()
          toggle automatic stepping between off and on
 
Methods inherited from interface visad.AVControl
addControlListener, clearSwitches, getSaveString, removeControlListener, setSaveString
 

Method Detail

stop

void stop()
stop activity in this AnimationControl


run

void run()
a single invocation implements anmation behavior until stop() is called


setCurrent

void setCurrent(int c)
                throws VisADException,
                       RemoteException
set the current ordinal step number

Parameters:
c - - value for current ordinal step number
Throws:
VisADException - - a VisAD error occurred
RemoteException - - an RMI error occurred

setCurrent

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

Parameters:
value - - RealType value that is converted to an ordinal step number
Throws:
VisADException - - a VisAD error occurred
RemoteException - - an RMI error occurred

getCurrent

int getCurrent()
Returns:
the current ordinal step number

setDirection

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

Parameters:
dir - true for forward, false for backward
Throws:
VisADException - Couldn't create necessary VisAD object. The direction remains unchanged.
RemoteException - Java RMI exception

getDirection

boolean getDirection()
Get the animation direction.

Returns:
true for forward, false for backward

getStep

long getStep()
Returns:
the dwell time for the current step (in ms)

getSteps

long[] getSteps()
Returns:
an array of the dwell times for all the steps (in ms)

setStep

void setStep(int st)
             throws VisADException,
                    RemoteException
Set the dwell rate between animation steps to a constant value

Parameters:
st - dwell time in milliseconds
Throws:
VisADException - Couldn't create necessary VisAD object. The dwell time remains unchanged.
RemoteException - Java RMI exception

setSteps

void setSteps(int[] steps)
              throws VisADException,
                     RemoteException
set the dwell time for individual steps.

Parameters:
steps - an array of dwell times in milliseconds 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.
RemoteException - Java RMI exception

takeStep

void takeStep()
              throws VisADException,
                     RemoteException
advance one step (forward or backward)

Throws:
VisADException - Couldn't create necessary VisAD object. No step is taken.
RemoteException - Java RMI exception

init

void init()
          throws VisADException
actually set Switches (Java3D) or VisADSwitches (Java2D) to child nodes corresponding to current ordinal step number

Throws:
VisADException - - a VisAD error occurred.

getSet

Set getSet()
Returns:
Set of RealType values for animation steps, in RealType mapped to Animation

setSet

void setSet(Set s)
            throws VisADException,
                   RemoteException

Sets the set of times in this animation control, in RealType mapped to Animation. If the argument set is equal to the current set, then nothing is done.

Parameters:
s - The set of times.
Throws:
VisADException - if a VisAD failure occurs.
RemoteException - if a Java RMI failure occurs.

setSet

void setSet(Set s,
            boolean noChange)
            throws VisADException,
                   RemoteException

Sets the set of times in this animation control, in RealType mapped to Animation. If the argument set is equal to the current set, then nothing is done.

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.
RemoteException - if a Java RMI failure occurs.

getOn

boolean getOn()
Returns:
true if automatic stepping is on, false otherwise

setOn

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

Parameters:
o - true = turn stepping on, false = turn stepping off
Throws:
VisADException - Couldn't create necessary VisAD object. No change in automatic stepping occurs.
RemoteException - Java RMI exception

toggle

void toggle()
            throws VisADException,
                   RemoteException
toggle automatic stepping between off and on

Throws:
VisADException - Couldn't create necessary VisAD object. No change in automatic stepping occurs.
RemoteException - Java RMI exception

setComputeSet

void setComputeSet(boolean compute)
Set the flag to automatically compute the animation set if it is null

Parameters:
compute - false to allow application to control set computation if set is null.

getComputeSet

boolean getComputeSet()
Get the flag to automatically compute the animation set if it is null

Returns:
true if should compute