fi.helsinki.dacopan.contsig
Class AnimationTimeState

java.lang.Object
  extended by fi.helsinki.dacopan.contsig.AnimationTimeState
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener

public class AnimationTimeState
extends java.lang.Object
implements java.awt.event.ActionListener


Constructor Summary
AnimationTimeState(float nowTime, float animationEndTime, float timeScale, int stepInterval, StepIterator stepIterator)
          Creates a new instance of AnimationTimeState
AnimationTimeState(float nowTime, float animationEndTime, float timeScale, int stepInterval, StepIterator stepIterator, AnimationSequence animationSequence, float scenarioItemEndTime, float scenarioItemAnimationEndTime)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent event)
           
 void addControlSignalsListener(ControlSignalsListener toAdd)
          Adds a ControlSignalsListener as a listener for this AnimationTimeState.
 void discard()
          Stops the timer without sending any more events.
 float getNowTime()
          Gets the nowTime.
 int getStepInterval()
          Getter for property stepInterval.
 float getTimeScale()
          Getter for property timeScale.
 boolean isPaused()
          Returns true if the animation is currently paused, false otherwise.
 void pause()
          Puts the AnimationTimeState in pause mode.
 void play()
          Puts the AnimationTimeState in play mode.
 void removeControlSignalsListener(ControlSignalsListener toRemove)
          Removes a ControlSignalsListener from the listener list, if it exists in the list.
 void setNowTime(float newNowTime)
          Sets the nowTime and steps all listeners to show that time.
 void setStepInterval(int stepInterval)
          Setter for property stepInterval.
 void setTimeScale(float timeScale)
          Setter for property timeScale.
 void stepBackward()
           
 void stepForward()
           
 void toBeginning()
           
 void toEnd()
           
 void toEndOfScenarioItem()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnimationTimeState

public AnimationTimeState(float nowTime,
                          float animationEndTime,
                          float timeScale,
                          int stepInterval,
                          StepIterator stepIterator)
Creates a new instance of AnimationTimeState


AnimationTimeState

public AnimationTimeState(float nowTime,
                          float animationEndTime,
                          float timeScale,
                          int stepInterval,
                          StepIterator stepIterator,
                          AnimationSequence animationSequence,
                          float scenarioItemEndTime,
                          float scenarioItemAnimationEndTime)
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent event)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

getTimeScale

public float getTimeScale()
Getter for property timeScale.

Returns:
Value of property timeScale.

setTimeScale

public void setTimeScale(float timeScale)
Setter for property timeScale.

Parameters:
timeScale - New value of property timeScale.

getStepInterval

public int getStepInterval()
Getter for property stepInterval.

Returns:
Value of property stepInterval.

setStepInterval

public void setStepInterval(int stepInterval)
Setter for property stepInterval.

Parameters:
stepInterval - New value of property stepInterval.

getNowTime

public float getNowTime()
Gets the nowTime.


setNowTime

public void setNowTime(float newNowTime)
Sets the nowTime and steps all listeners to show that time. If the given parameter is less than zero, time is set to zero. If the parameter is greater than animationEndTime, time is set to animationEndTime.


isPaused

public boolean isPaused()
Returns true if the animation is currently paused, false otherwise.


addControlSignalsListener

public void addControlSignalsListener(ControlSignalsListener toAdd)
Adds a ControlSignalsListener as a listener for this AnimationTimeState.


removeControlSignalsListener

public void removeControlSignalsListener(ControlSignalsListener toRemove)
Removes a ControlSignalsListener from the listener list, if it exists in the list.


play

public void play()
Puts the AnimationTimeState in play mode. In play mode the AnimationTimeState will continuously fire advance events (according to a timer) until the animation is played the the end, or AnimationTimeState is put to pause mode.

Switching to play mode will cause the AnimationTimeState to fire the toPlayMode event once.


pause

public void pause()
Puts the AnimationTimeState in pause mode. In pause mode the AnimationTimeState reacts to other calls (toBeginning, toEnd, stepForward, stepBackward), but does not fire events according to a timer.

Switching to pause mode will cause the AnimationTimeState to fire the toPauseMode event once.


toBeginning

public void toBeginning()

toEnd

public void toEnd()

toEndOfScenarioItem

public void toEndOfScenarioItem()

stepForward

public void stepForward()

stepBackward

public void stepBackward()

discard

public void discard()
Stops the timer without sending any more events.



© Dacopan2 team, 2005-