Package ucar.visad.display
Class Animation
java.lang.Object
ucar.visad.display.Displayable
ucar.visad.display.Animation
Provides support for a
Displayable
that needs a map to
Display.Animation- Version:
- $Revision: 1.75 $
- Author:
- IDV development Team
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The name of the animation real-type property.static final String
The name of the set-of-times property.static final String
The name of the current time property.static final int
The "forward" animation value.static final int
The "reverse" animation value.Fields inherited from class ucar.visad.display.Displayable
DISPLAY, parent, SCALAR_MAP_SET
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a clone of this instance suitable for another VisAD display.boolean
Checks the equality of this Animation with the object in question.Get theAnimationInfo
associated with this Animation.Returns the RealType of the Animation parameter.final Real
Returns the value of the "aniValue" property.long[]
Returns an array of the backward dwell times for all the steps in integer milliseconds.int
Returns the origin-0 index of the current time being shown.Get the current animation value as a Realstatic DateTime[]
getDateTimeArray
(Set timeSet) Utility to create an array of DateTime from the given time setboolean
Get the Enabled property.long[]
Returns an array of the dwell times for all the steps in integer milliseconds.int
Returns the number of time stepsgetSet()
Returns the set of animation time-values.long[]
getSteps()
Returns an array of the dwell times for all the steps in integer milliseconds.DateTime[]
getTimes()
Get the times as an arrayboolean
Indicates if looping is on.final void
Adds theDataReference
s associated with this instance to the display.final void
Removes theDataReference
s associated with this instance from the display.void
Force recalculation of animation time steps based on all data with domains mapped to this Animation'sRealType
.void
setAnimating
(boolean on) Begin animating or looping.void
Explicitly sets the animation parameters of this instance.void
setAnimationRealType
(RealType realType) Sets theRealType
of the VisAD Animation parameter, such asRealType.Time
.void
setAniValue
(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
Sets the animation times for this instance to use.void
Sets the animation times for this instance to use.void
setSteps
(long[] newTimes) Sets an integer array in milliseconds of time delay AFTER display each loop step.void
setStepsOk
(boolean[] stepsOk) Set the steps ok.boolean
Indicates if looping is on.boolean
shouldShow
(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
Step one time backward.void
Step one time forward.Methods inherited from class ucar.visad.display.Displayable
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
-
Field Details
-
ANI_REAL_TYPE
The name of the animation real-type property.- See Also:
-
ANI_VALUE
The name of the current time property.- See Also:
-
ANI_SET
The name of the set-of-times property.- See Also:
-
FORWARD
public static final int FORWARDThe "forward" animation value.- See Also:
-
REVERSE
public static final int REVERSEThe "reverse" animation value.- See Also:
-
-
Constructor Details
-
Animation
Constructs from nothing. UsesRealType.Time
for the animationRealType
.- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
Animation
Constructs from the type of the VisAD parameter to animate over, typicallyRealType.Time
.- Parameters:
aniRealType
- The type of the animation parameter ornull
.- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
Animation
Construct a new Animation from another one- Parameters:
that
- the other Animation object- Throws:
RemoteException
- Java RMI failureVisADException
- VisAD failure
-
-
Method Details
-
setAnimationRealType
Sets theRealType
of the VisAD Animation parameter, such asRealType.Time
.- Parameters:
realType
- TheRealType
of the animation parameter.- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
getAnimationRealType
Returns the RealType of the Animation parameter.- Returns:
- The RealType of the Animation parameter. May
be
null
.
-
getAniValue
Returns the value of the "aniValue" property. Returnsnull
if no such value exists.- Returns:
- The value of the property or
null
.
-
cloneForDisplay
Returns a clone of this instance suitable for another VisAD display. Underlying data objects are not cloned.- Specified by:
cloneForDisplay
in classDisplayable
- Returns:
- A semi-deep clone of this instance.
- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
myAddDataReferences
public final void myAddDataReferences()Adds the
DataReference
s associated with this instance to the display.This implementation does nothing.
- Specified by:
myAddDataReferences
in classDisplayable
-
myRemoveDataReferences
public final void myRemoveDataReferences()Removes the
DataReference
s associated with this instance from the display.This implementation does nothing.
- Specified by:
myRemoveDataReferences
in classDisplayable
-
setAnimationInfo
Explicitly sets the animation parameters of this instance. The parameters are copied.- Parameters:
ai
- The animation parameters.- Throws:
RemoteException
- Java RMI errorVisADException
- VisADError
-
getAnimationInfo
Get theAnimationInfo
associated with this Animation.- Returns:
- the AnimationInfo
-
setAnimating
public void setAnimating(boolean on) Begin animating or looping.- Parameters:
on
- Whether or not looping should be on.
-
shouldShow
Check if the animationSet.valueToIndex of the given time value is equals to the current time step.- Parameters:
timeValue
- The time value to check- Returns:
- Is the time value the current one being displayed
- Throws:
RemoteException
- Java RMI ExceptionVisADException
- VisAD Exception
-
isAnimating
public boolean isAnimating()Indicates if looping is on.- Returns:
- true if looping; false if not looping.
-
shouldBeAnimating
public boolean shouldBeAnimating()Indicates if looping is on.- Returns:
- true if looping; false if not looping.
-
getSet
Returns the set of animation time-values.- Returns:
- The set if animation times.
-
setSet
Sets the animation times for this instance to use.- Parameters:
newSet
- New animation times.- Throws:
VisADException
- if the set isn't 1-D or doesn't have the sameRealType
as the animationScalarMap
.RemoteException
- if a Java RMI failure occurs.
-
getCurrentAnimationValue
Get the current animation value as a Real- Returns:
- the value
-
getTimes
Get the times as an array- Returns:
- the times or null
-
setSet
Sets the animation times for this instance to use.- Parameters:
newSet
- New animation times.transform
- true to transform- Throws:
VisADException
- if the set isn't 1-D or doesn't have the sameRealType
as the animationScalarMap
.RemoteException
- if a Java RMI failure occurs.
-
getSteps
public long[] getSteps()Returns an array of the dwell times for all the steps in integer milliseconds. Returnsnull
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. deprecated Use getFwdSteps- Returns:
- Dwell delays in milliseconds or
null
.
-
setSteps
public void setSteps(long[] newTimes) Sets an integer array in milliseconds of time delay AFTER display each loop step. deprecated Use setFwdSteps- Parameters:
newTimes
- Dwell delays in milliseconds.
-
getFwdSteps
public long[] getFwdSteps()Returns an array of the dwell times for all the steps in integer milliseconds. Returnsnull
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.- Returns:
- Dwell delays in milliseconds or
null
.
-
setFwdSteps
public void setFwdSteps(long[] newTimes) Sets an integer array in milliseconds of time delay AFTER display each loop step.- Parameters:
newTimes
- Dwell delays in milliseconds.
-
getBackSteps
public long[] getBackSteps()Returns an array of the backward dwell times for all the steps in integer milliseconds. Returnsnull
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.- Returns:
- Dwell delays in milliseconds or
null
.
-
setBackSteps
public void setBackSteps(long[] newTimes) Sets an integer array in milliseconds of time delay AFTER display each loop step when animating backward.- Parameters:
newTimes
- Dwell delays in milliseconds.
-
getNumSteps
public int getNumSteps()Returns the number of time steps- Returns:
- The number of time steps
-
getCurrent
public int getCurrent()Returns the origin-0 index of the current time being shown. Returns 0 if there is no such time.- Returns:
- The index of current time or 0.
-
setAniValue
Sets the current time being shown to the value of the Real.- Parameters:
newTime
- Real of the newTime.
-
setCurrent
public void setCurrent(int newIndex) Sets the current time being shown.- Parameters:
newIndex
- The origin-0 index of the desired time.
-
setCurrent
public void setCurrent(int newIndex, boolean checkUserFrames) Sets the current time being shown.- Parameters:
newIndex
- The origin-0 index of the desired time.checkUserFrames
- If true then go to the next "on" frame.
-
takeStep
public void takeStep()Step one time in the current direction (foward or reverse). -
takeStep
public void takeStep(int direction) Step one time in whatever direction is specified. Remeber to keep direction same as before step was made; taking step does not mean to change direction of looping; that is done through properties.- Parameters:
direction
- an int (0=FORWARD, 1=REVERSE)
-
setStepsOk
Set the steps ok. Reset the animation.- Parameters:
stepsOk
- What steps are ok- Throws:
RemoteException
- On badnessVisADException
- On badness
-
setDirection
public void setDirection(int direction) Set looping direction.- Parameters:
direction
- an int, 0 = FORWARD, 1 = REVERSE
-
takeStepForward
public void takeStepForward()Step one time forward. -
takeStepBackward
public void takeStepBackward()Step one time backward. -
reCalculateAnimationSet
public void reCalculateAnimationSet()Force recalculation of animation time steps based on all data with domains mapped to this Animation'sRealType
. -
equals
Checks the equality of this Animation with the object in question. -
getDateTimeArray
Utility to create an array of DateTime from the given time set- Parameters:
timeSet
- The time set- Returns:
- The array
-
setEnabled
public void setEnabled(boolean value) Set the Enabled property.- Parameters:
value
- The new value for Enabled
-
getEnabled
public boolean getEnabled()Get the Enabled property.- Returns:
- The Enabled
-