public class AnimationWidget extends SharableImpl implements java.awt.event.ActionListener
Modifier and Type | Field and Description |
---|---|
static boolean |
bigIcon
Do we show the big icon
|
static java.lang.String |
CMD_BACKWARD
property for setting the widget to the loop in reverse
|
static java.lang.String |
CMD_BEGINNING
property for setting the widget to the first frame
|
static java.lang.String |
CMD_END
property for setting the widget to the last frame
|
static java.lang.String |
CMD_FORWARD
property for setting the widget to the loop forward
|
static java.lang.String |
CMD_INDEX
Flag for changing the INDEX
|
static java.lang.String |
CMD_PROPS
property for properties
|
static java.lang.String |
CMD_STARTSTOP
property for setting the widget to the start or stop
|
static java.lang.String |
SHARE_INDEX
The property for sharing the animation index
|
static java.lang.String |
SHARE_VALUE
The property for sharing the animation value
|
Constructor and Description |
---|
AnimationWidget()
Default Constructor
|
AnimationWidget(AnimationInfo info)
Contruct an AnimationWidget using the info supplied.
|
AnimationWidget(javax.swing.JFrame parentf)
Construct an AnimationWidget using the parent supplied.
|
AnimationWidget(javax.swing.JFrame parentf,
Animation anim)
Construct an AnimationWidget using the parent, the
Animation
|
AnimationWidget(javax.swing.JFrame parentf,
Animation anim,
AnimationInfo info)
Contruct a new AnimationWidget.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
Public by implementing ActionListener.
|
void |
actionPerformed(java.lang.String cmd)
Handle the action
|
void |
addAnimation(Animation anim)
Deprecated.
use setAnimation();
|
void |
animationSetChanged()
Changing the info from the dialog
|
protected void |
applyProperties(AnimationInfo info,
boolean andShare)
Apply the info from the dialog
|
protected void |
boxPanelChanged(AnimationBoxPanel boxPanel)
Called when the box panel has changed through a user drag or click
|
void |
destroy()
Method called when destroying this object.
|
AnimationInfo |
getAnimationInfo()
Get the
AnimationInfo associated with this widget. |
AnimationSetInfo |
getAnimationSetInfo()
Holds the synthetic animation set info
|
boolean |
getBoxPanelVisible()
Get the BoxPanelVisible property.
|
javax.swing.JComponent |
getContents()
Get the Java Component which is the set of controls.
|
javax.swing.JComponent |
getContents(boolean floatToolBar)
get the Java Component which is the set of controls.
|
protected DisplayMaster |
getDisplayMaster()
Get the display master that the animation is in
|
java.awt.Component |
getIndicatorComponent()
Get the component used to display the time step value.
|
visad.DateTime |
getTimeAtIndex(int index)
Get the time at the given index.
|
visad.DateTime[] |
getTimes()
Get the array of times
|
visad.DateTime[] |
getTimesArray()
Get the time list.
|
void |
gotoBeginning()
Go to the beginning of the animation sequence.
|
void |
gotoEnd()
Go to the end of the animation sequence.
|
void |
gotoIndex(int index)
Set the current frame to the index supplied.
|
protected void |
handleSharedTime(visad.Real time)
We got the tiem from another animation widget.
|
boolean |
isRunning()
Are we running
|
static void |
main(java.lang.String[] args)
Main method for testing
|
void |
receiveShareData(Sharable from,
java.lang.Object dataId,
java.lang.Object[] data)
Method called when sharing is turned on.
|
void |
resetProperties()
Force the existing animation properties, held in the animation widget's
"animationInfo" member data, into this widget's set of
Animation objects.
|
void |
setAnimation(Animation newAnimation)
Sets the
ucar.visad.display.Animation
controlled by this widget. |
void |
setBaseTimes(visad.Set times)
Set the times that should be used.
|
void |
setBoxPanelVisible(boolean value)
Set the BoxPanelVisible property.
|
void |
setProperties(AnimationInfo transfer)
From the "animationInfo" set of animation properties, set all these
values into all the Animation objects held as memeber data.
|
void |
setRunning(boolean state)
Set the animation state and change the start/stop widget
|
void |
setTimeFromUser(visad.Real time)
THis allows external code to set the time.
|
protected void |
shareIndex()
Share the index of the animation step.
|
protected void |
shareValue()
Share the value of the animation step.
|
protected void |
shareValue(visad.Real time)
Share the time value
|
void |
showDateBox(boolean v)
Show the date box
|
protected void |
showPropertiesDialog()
Make and show an AnimationPropertiesDialog;
if that returns animationInfo ok,
set the new animationInfo data into the the Animations.
|
protected void |
stepBackward()
Take one step backward in the animation sequence.
|
void |
stepForward()
Take one step forward in the animation sequence.
|
void |
stepsOkChanged(boolean[] stepsOk)
The user has clicked on the box.
|
void |
updateIndicator(visad.Set timeSet)
Update the indicator with the list of times
|
applySharableProperties, doShare, doShare, doShareExternal, doShareInternal, getReceiveShareTime, getSharablePropertiesComponent, getShareGroup, getSharing, getUniqueId, initSharable, removeSharable, setReceiveShareTime, setShareGroup, setSharing, setUniqueId, showSharableDialog
public static boolean bigIcon
public static final java.lang.String CMD_INDEX
public static final java.lang.String CMD_BEGINNING
public static final java.lang.String CMD_BACKWARD
public static final java.lang.String CMD_STARTSTOP
public static final java.lang.String CMD_FORWARD
public static final java.lang.String CMD_END
public static final java.lang.String CMD_PROPS
public static final java.lang.String SHARE_VALUE
public static final java.lang.String SHARE_INDEX
public AnimationWidget()
public AnimationWidget(AnimationInfo info)
info
- default state to use.public AnimationWidget(javax.swing.JFrame parentf)
parentf
- the parent JFramepublic AnimationWidget(javax.swing.JFrame parentf, Animation anim)
parentf
- the parent JFrameanim
- a ucar.visad.display.Animation object to managepublic AnimationWidget(javax.swing.JFrame parentf, Animation anim, AnimationInfo info)
parentf
- the parent JFrameanim
- a ucar.visad.display.Animation object to manageinfo
- Default values for the AnimationInfopublic void showDateBox(boolean v)
v
- true to showpublic void setBaseTimes(visad.Set times) throws visad.VisADException, java.rmi.RemoteException
times
- List of timesjava.rmi.RemoteException
- On badnessvisad.VisADException
- On badnesspublic javax.swing.JComponent getContents()
public javax.swing.JComponent getContents(boolean floatToolBar)
floatToolBar
- true if the toolbar should be floatablepublic java.awt.Component getIndicatorComponent()
protected void applyProperties(AnimationInfo info, boolean andShare)
info
- The infoandShare
- Share the state with other widgetspublic void animationSetChanged()
protected void showPropertiesDialog()
protected void boxPanelChanged(AnimationBoxPanel boxPanel)
boxPanel
- The changed box panelpublic void resetProperties()
public void setProperties(AnimationInfo transfer)
transfer
- AnimationInfo to get properties fromprotected DisplayMaster getDisplayMaster()
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
e
- ActionEvent to checkpublic void actionPerformed(java.lang.String cmd)
cmd
- The actionprotected void handleSharedTime(visad.Real time)
time
- The time.public void setTimeFromUser(visad.Real time)
time
- The timepublic void receiveShareData(Sharable from, java.lang.Object dataId, java.lang.Object[] data)
receiveShareData
in interface Sharable
receiveShareData
in class SharableImpl
from
- source of shareable informationdataId
- ID for the datadata
- the shareable datapublic void setRunning(boolean state)
state
- true to start animatingpublic boolean isRunning()
public AnimationInfo getAnimationInfo()
AnimationInfo
associated with this widget.public AnimationSetInfo getAnimationSetInfo()
protected void shareIndex()
protected void shareValue()
protected void shareValue(visad.Real time)
time
- The value to sharepublic void stepForward()
protected void stepBackward()
public void gotoIndex(int index)
index
- index into the animation setpublic void gotoBeginning()
public visad.DateTime[] getTimes()
public void gotoEnd()
public void stepsOkChanged(boolean[] stepsOk)
stepsOk
- What time steps are okpublic void setAnimation(Animation newAnimation)
ucar.visad.display.Animation
controlled by this widget. Removes
any other ucar.visad.display.Animation
from the control of this widget.newAnimation
- ucar.visad.display.Animation to controlpublic void destroy()
public void addAnimation(Animation anim)
ucar.visad.display.Animation
to be controlled by this widget.anim
- ucar.visad.display.Animation to control (must not be null)public void updateIndicator(visad.Set timeSet)
timeSet
- set of timespublic visad.DateTime getTimeAtIndex(int index)
index
- Indexpublic visad.DateTime[] getTimesArray()
public void setBoxPanelVisible(boolean value)
value
- The new value for BoxPanelVisiblepublic boolean getBoxPanelVisible()
public static void main(java.lang.String[] args)
args
- arguments