|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--fcmodeler.animation.Animator
An animation controller. This class uses a list of sets of node mappings and a list of sets of edge mappings, and applies each set of mappings to all node and edge figures in the view one at a time to produce an animation of changing visual attributes. Each element in the lists represents one time step.
Constructor Summary | |
Animator(java.util.List nodeMappings,
java.util.List edgeMappings,
diva.graph.GraphView view)
Creates a new Animator using the specified node and edge mappings. |
|
Animator(java.io.Reader reader,
diva.graph.GraphView view)
Creates a new Animator using the node and edge mappings in the XML obtained from
the specified reader. |
Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent actionEvent)
Invoked by the timer when the next frame of the animation should be shown. |
void |
addAnimationListener(AnimationListener listener)
Registers the specified animation listener to receive animation events from this animator. |
protected void |
fireAnimationPaused()
Notifies all animation listeners that the animation was paused. |
protected void |
fireAnimationStarted()
Notifies all animation listeners that the animation was started. |
protected void |
fireAnimationStopped()
Notifies all animation listeners that the animation was stopped. |
protected void |
fireFrameShown()
Notifies all animation listeners that a new frame was shown. |
java.util.Iterator |
getAnimationListeners()
Returns an iterator over the animation listeners registered with this animator. |
int |
getDelay()
Returns the delay between animation steps. |
java.util.List |
getEdgeMappings()
Returns the list of sets of edge mappings. |
int |
getFrame()
Returns the current frame being shown by this animator. |
int |
getFrameCount()
Returns the total number of frames to be shown by this animator. |
diva.graph.GraphView |
getGraphView()
Returns the graph view used by this animator. |
java.util.List |
getNodeMappings()
Returns the list of sets of node mappings. |
boolean |
isPaused()
Returns true if the animation is paused. |
boolean |
isStopped()
Returns true if the animation is stopped. |
boolean |
isValidFrame(int frame)
Returns true if the specified frame number is valid. |
void |
next()
Shows the next frame of the animation. |
void |
pause()
Pauses the animation. |
void |
previous()
Shows the previous frame of the animation. |
void |
removeAnimationListener(AnimationListener listener)
Removes the specified animation listener from the list of listeners for this animator. |
void |
setDelay(int delay)
Sets the delay between animation steps to the specified value. |
void |
showFrame(int frame)
Shows the specified frame of the animation. |
void |
start()
Starts the animation. |
void |
stop()
Stops the animation. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Animator(java.io.Reader reader, diva.graph.GraphView view)
Animator
using the node and edge mappings in the XML obtained from
the specified reader.reader
- the reader that provides the node and edge mappings in XML.view
- the graph view containing the node and edge figures.public Animator(java.util.List nodeMappings, java.util.List edgeMappings, diva.graph.GraphView view)
Animator
using the specified node and edge mappings.nodeMappings
- the list of sets of node mappings.edgeMappings
- the list of sets of edge mappings.view
- the graph view containing the node and edge figures.Method Detail |
public void actionPerformed(java.awt.event.ActionEvent actionEvent)
actionPerformed
in interface java.awt.event.ActionListener
actionEvent
- totally ignored by this method.public void addAnimationListener(AnimationListener listener)
listener
- the animation listener to register with this animator.protected void fireAnimationPaused()
protected void fireAnimationStarted()
protected void fireAnimationStopped()
protected void fireFrameShown()
public java.util.Iterator getAnimationListeners()
public int getDelay()
public java.util.List getEdgeMappings()
public int getFrame()
public int getFrameCount()
public diva.graph.GraphView getGraphView()
public java.util.List getNodeMappings()
public boolean isValidFrame(int frame)
true
if the specified frame number is valid.frame
- the frame number to test for validity.true
if frame >= 0
and frame < getFrameCount()
.public boolean isPaused()
true
if the animation is paused.true
if the animation is paused.public boolean isStopped()
true
if the animation is stopped.true
if the animation is stopped.public void next()
public void pause()
public void previous()
public void removeAnimationListener(AnimationListener listener)
listener
- the animation listener to remove.public void setDelay(int delay)
delay
- the delay between animation steps in milliseconds.public void showFrame(int frame)
frame
- the frame to show.public void start()
public void stop()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |