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 StringThe name of the animation real-type property.static final StringThe name of the set-of-times property.static final StringThe name of the current time property.static final intThe "forward" animation value.static final intThe "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.booleanChecks the equality of this Animation with the object in question.Get theAnimationInfoassociated with this Animation.Returns the RealType of the Animation parameter.final RealReturns the value of the "aniValue" property.long[]Returns an array of the backward dwell times for all the steps in integer milliseconds.intReturns 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 setbooleanGet the Enabled property.long[]Returns an array of the dwell times for all the steps in integer milliseconds.intReturns 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 arraybooleanIndicates if looping is on.final voidAdds theDataReferences associated with this instance to the display.final voidRemoves theDataReferences associated with this instance from the display.voidForce recalculation of animation time steps based on all data with domains mapped to this Animation'sRealType.voidsetAnimating(boolean on) Begin animating or looping.voidExplicitly sets the animation parameters of this instance.voidsetAnimationRealType(RealType realType) Sets theRealTypeof the VisAD Animation parameter, such asRealType.Time.voidsetAniValue(Real newTime) Sets the current time being shown to the value of the Real.voidsetBackSteps(long[] newTimes) Sets an integer array in milliseconds of time delay AFTER display each loop step when animating backward.voidsetCurrent(int newIndex) Sets the current time being shown.voidsetCurrent(int newIndex, boolean checkUserFrames) Sets the current time being shown.voidsetDirection(int direction) Set looping direction.voidsetEnabled(boolean value) Set the Enabled property.voidsetFwdSteps(long[] newTimes) Sets an integer array in milliseconds of time delay AFTER display each loop step.voidSets the animation times for this instance to use.voidSets the animation times for this instance to use.voidsetSteps(long[] newTimes) Sets an integer array in milliseconds of time delay AFTER display each loop step.voidsetStepsOk(boolean[] stepsOk) Set the steps ok.booleanIndicates if looping is on.booleanshouldShow(Real timeValue) Check if the animationSet.valueToIndex of the given time value is equals to the current time step.voidtakeStep()Step one time in the current direction (foward or reverse).voidtakeStep(int direction) Step one time in whatever direction is specified.voidStep one time backward.voidStep 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.Timefor 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 theRealTypeof the VisAD Animation parameter, such asRealType.Time.- Parameters:
realType- TheRealTypeof 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. Returnsnullif 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:
cloneForDisplayin classDisplayable- Returns:
- A semi-deep clone of this instance.
- Throws:
VisADException- VisAD failure.RemoteException- Java RMI failure.
-
myAddDataReferences
public final void myAddDataReferences()Adds the
DataReferences associated with this instance to the display.This implementation does nothing.
- Specified by:
myAddDataReferencesin classDisplayable
-
myRemoveDataReferences
public final void myRemoveDataReferences()Removes the
DataReferences associated with this instance from the display.This implementation does nothing.
- Specified by:
myRemoveDataReferencesin 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 theAnimationInfoassociated 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 sameRealTypeas 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 sameRealTypeas 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. Returnsnullif 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. Returnsnullif 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. Returnsnullif 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
-