public class Animation extends Displayable
Displayable
that needs a map to
Display.AnimationModifier and Type | Field and Description |
---|---|
static java.lang.String |
ANI_REAL_TYPE
The name of the animation real-type property.
|
static java.lang.String |
ANI_SET
The name of the set-of-times property.
|
static java.lang.String |
ANI_VALUE
The name of the current time property.
|
static int |
FORWARD
The "forward" animation value.
|
static int |
REVERSE
The "reverse" animation value.
|
DISPLAY, parent, SCALAR_MAP_SET
Modifier | Constructor and Description |
---|---|
|
Animation()
Constructs from nothing.
|
protected |
Animation(Animation that)
Construct a new Animation from another one
|
|
Animation(visad.RealType aniRealType)
Constructs from the type of the VisAD parameter to animate over,
typically
RealType.Time . |
Modifier and Type | Method and Description |
---|---|
Displayable |
cloneForDisplay()
Returns a clone of this instance suitable for another VisAD display.
|
boolean |
equals(java.lang.Object obj)
Checks the equality of this Animation with the object in
question.
|
AnimationInfo |
getAnimationInfo()
Get the
AnimationInfo associated with this Animation. |
visad.RealType |
getAnimationRealType()
Returns the RealType of the Animation parameter.
|
visad.Real |
getAniValue()
Returns the value of the "aniValue" property.
|
long[] |
getBackSteps()
Returns an array of the backward dwell times for all the steps in integer
milliseconds.
|
int |
getCurrent()
Returns the origin-0 index of the current time being shown.
|
visad.Real |
getCurrentAnimationValue()
Get the current animation value as a Real
|
static visad.DateTime[] |
getDateTimeArray(visad.Set timeSet)
Utility to create an array of DateTime from the given time set
|
boolean |
getEnabled()
Get the Enabled property.
|
long[] |
getFwdSteps()
Returns an array of the dwell times for all the steps in integer
milliseconds.
|
int |
getNumSteps()
Returns the number of time steps
|
visad.Set |
getSet()
Returns the set of animation time-values.
|
long[] |
getSteps()
Deprecated.
Use getFwdSteps
|
visad.DateTime[] |
getTimes()
Get the times as an array
|
boolean |
isAnimating()
Indicates if looping is on.
|
void |
myAddDataReferences()
Adds the
DataReference s associated with this instance
to the display. |
void |
myRemoveDataReferences()
Removes the
DataReference s associated with this
instance from the display. |
void |
reCalculateAnimationSet()
Force recalculation of animation time steps based on all
data with domains mapped to this Animation's
RealType . |
void |
setAnimating(boolean on)
Begin animating or looping.
|
void |
setAnimationInfo(AnimationInfo ai)
Explicitly sets the animation parameters of this instance.
|
void |
setAnimationRealType(visad.RealType realType)
Sets the
RealType of the VisAD Animation parameter,
such as RealType.Time . |
void |
setAniValue(visad.Real newTime)
Sets the current time being shown to the value of the
Real.
|
void |
setBackSteps(long[] newTimes)
Sets an integer array in milliseconds of time delay AFTER
display each loop step when animating backward.
|
void |
setCurrent(int newIndex)
Sets the current time being shown.
|
void |
setCurrent(int newIndex,
boolean checkUserFrames)
Sets the current time being shown.
|
void |
setDirection(int direction)
Set looping direction.
|
void |
setEnabled(boolean value)
Set the Enabled property.
|
void |
setFwdSteps(long[] newTimes)
Sets an integer array in milliseconds of time delay AFTER
display each loop step.
|
void |
setSet(visad.Set newSet)
Sets the animation times for this instance to use.
|
void |
setSet(visad.Set newSet,
boolean transform)
Sets the animation times for this instance to use.
|
void |
setSteps(long[] newTimes)
Deprecated.
Use setFwdSteps
|
void |
setStepsOk(boolean[] stepsOk)
Set the steps ok.
|
boolean |
shouldBeAnimating()
Indicates if looping is on.
|
boolean |
shouldShow(visad.Real timeValue)
Check if the animationSet.valueToIndex of the given time value
is equals to the current time step.
|
void |
takeStep()
Step one time in the current direction (foward or reverse).
|
void |
takeStep(int direction)
Step one time in whatever direction is specified.
|
void |
takeStepBackward()
Step one time backward.
|
void |
takeStepForward()
Step one time forward.
|
addConstantMap, addConstantMaps, addDataReferences, addPropertyChangeListener, addPropertyChangeListener, addRefsInvoked, addScalarMap, addScalarMaps, applyColorUnit, applyDisplayUnit, checkUnit, combineConstantMaps, destroy, destroyDisplayable, firePropertyChange, firePropertyChange, fireScalarMapSetChange, getAnimationSet, getColorUnit, getConstantMaps, getData, getDestroyed, getDisplay, getDisplayMaster, getDisplayUnit, getPointMode, getScalarMap, getScalarMap, getScalarMap, getScalarMapSet, getUseFastRendering, getUseTimesInAnimation, getVisible, hasDataObject, isActive, isUnitCompatible, isVisible, logException, myAddConstantMaps, removeConstantMap, removeDataReferences, removePropertyChangeListener, removePropertyChangeListener, removeScalarMap, replaceScalarMap, setAdjustFlow, setColor, setColorPalette, setColorPalette, setColorUnit, setConstantPosition, setContourInfo, setDisplay, setDisplayActive, setDisplayInactive, setDisplayMaster, setDisplayUnit, setLineWidth, setManipulable, setOverrideAnimationSet, setOverrideAnimationSet, setParent, setPointMode, setPointSize, setRangeForColor, setRangeForColor, setScalarMapSet, setSelectedRange, setSelectedRange, setUseFastRendering, setUseTimesInAnimation, setVisible, toFront
public static final java.lang.String ANI_REAL_TYPE
public static final java.lang.String ANI_VALUE
public static final java.lang.String ANI_SET
public static final int FORWARD
public static final int REVERSE
public Animation() throws visad.VisADException, java.rmi.RemoteException
RealType.Time
for the
animation RealType
.visad.VisADException
- VisAD failure.java.rmi.RemoteException
- Java RMI failure.public Animation(visad.RealType aniRealType) throws visad.VisADException, java.rmi.RemoteException
RealType.Time
.aniRealType
- The type of the animation parameter or
null
.visad.VisADException
- VisAD failure.java.rmi.RemoteException
- Java RMI failure.protected Animation(Animation that) throws visad.VisADException, java.rmi.RemoteException
that
- the other Animation objectjava.rmi.RemoteException
- Java RMI failurevisad.VisADException
- VisAD failurepublic void setAnimationRealType(visad.RealType realType) throws java.rmi.RemoteException, visad.VisADException
RealType
of the VisAD Animation parameter,
such as RealType.Time
.realType
- The RealType
of the animation
parameter.visad.VisADException
- VisAD failure.java.rmi.RemoteException
- Java RMI failure.public visad.RealType getAnimationRealType()
null
.public final visad.Real getAniValue()
null
if no such value exists.null
.public Displayable cloneForDisplay() throws java.rmi.RemoteException, visad.VisADException
cloneForDisplay
in class Displayable
visad.VisADException
- VisAD failure.java.rmi.RemoteException
- Java RMI failure.public final void myAddDataReferences()
Adds the DataReference
s associated with this instance
to the display.
This implementation does nothing.
myAddDataReferences
in class Displayable
public final void myRemoveDataReferences()
Removes the DataReference
s associated with this
instance from the display.
This implementation does nothing.
myRemoveDataReferences
in class Displayable
public void setAnimationInfo(AnimationInfo ai) throws java.rmi.RemoteException, visad.VisADException
ai
- The animation parameters.java.rmi.RemoteException
- Java RMI errorvisad.VisADException
- VisADErrorpublic AnimationInfo getAnimationInfo()
AnimationInfo
associated with this Animation.public void setAnimating(boolean on)
on
- Whether or not looping should be on.public boolean shouldShow(visad.Real timeValue) throws visad.VisADException, java.rmi.RemoteException
timeValue
- The time value to checkjava.rmi.RemoteException
- Java RMI Exceptionvisad.VisADException
- VisAD Exceptionpublic boolean isAnimating()
public boolean shouldBeAnimating()
public visad.Set getSet()
public void setSet(visad.Set newSet) throws visad.VisADException, java.rmi.RemoteException
newSet
- New animation times.visad.VisADException
- if the set isn't 1-D or doesn't have the same
RealType
as the animation ScalarMap
.java.rmi.RemoteException
- if a Java RMI failure occurs.public visad.Real getCurrentAnimationValue()
public visad.DateTime[] getTimes()
public void setSet(visad.Set newSet, boolean transform) throws visad.VisADException, java.rmi.RemoteException
newSet
- New animation times.transform
- true to transformvisad.VisADException
- if the set isn't 1-D or doesn't have the same
RealType
as the animation ScalarMap
.java.rmi.RemoteException
- if a Java RMI failure occurs.public long[] getSteps()
null
if no such times exist;
otherwise, each time value is the delay AFTER each loop step: the first
time in list is time delay AFTER the display of the first data.null
.public void setSteps(long[] newTimes)
newTimes
- Dwell delays in milliseconds.public long[] getFwdSteps()
null
if no such times exist;
otherwise, each time value is the delay AFTER each loop step: the first
time in list is time delay AFTER the display of the first data.null
.public void setFwdSteps(long[] newTimes)
newTimes
- Dwell delays in milliseconds.public long[] getBackSteps()
null
if no such times exist;
otherwise, each time value is the delay AFTER each loop step: the first
time in list is time delay AFTER the display of the first data.null
.public void setBackSteps(long[] newTimes)
newTimes
- Dwell delays in milliseconds.public int getNumSteps()
public int getCurrent()
public void setAniValue(visad.Real newTime)
newTime
- Real of the newTime.public void setCurrent(int newIndex)
newIndex
- The origin-0 index of the desired time.public void setCurrent(int newIndex, boolean checkUserFrames)
newIndex
- The origin-0 index of the desired time.checkUserFrames
- If true then go to the next "on" frame.public void takeStep()
public void takeStep(int direction)
direction
- an int (0=FORWARD, 1=REVERSE)public void setStepsOk(boolean[] stepsOk) throws java.rmi.RemoteException, visad.VisADException
stepsOk
- What steps are okjava.rmi.RemoteException
- On badnessvisad.VisADException
- On badnesspublic void setDirection(int direction)
direction
- an int, 0 = FORWARD, 1 = REVERSEpublic void takeStepForward()
public void takeStepBackward()
public void reCalculateAnimationSet()
RealType
.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- The object to check. Animations are equal if
their AnimationControls and RealTypes are equal.public static visad.DateTime[] getDateTimeArray(visad.Set timeSet)
timeSet
- The time setpublic void setEnabled(boolean value)
value
- The new value for Enabledpublic boolean getEnabled()