fr.lri.swingstates.canvas
Class CStateMachine.AnimationResumed

java.lang.Object
  extended by fr.lri.swingstates.sm.Transition
      extended by fr.lri.swingstates.sm.transitions.Event
          extended by fr.lri.swingstates.canvas.CStateMachine.AnimationResumed
Enclosing class:
CStateMachine

public class CStateMachine.AnimationResumed
extends Event

A transition triggered by an animation that has just been resumed. For example, one can want to suspend an animation animAwake when an animation animSlept is resumed.

        Transition tshape = new AnimationResumed(animSlept) {
                public void action() {
                        // suspends
 
 animAwake
 
  animation.
                        animAwake.suspend();
                }
        }
        
 

Author:
Caroline Appert

Constructor Summary
CStateMachine.AnimationResumed()
          Builds a transition that loops on the current state triggered when any animation that has just been resumed.
CStateMachine.AnimationResumed(Animation anim)
          Builds a transition that loops on the current state triggered when an animation that has just been resumed.
CStateMachine.AnimationResumed(Animation anim, java.lang.String outState)
          Builds a transition triggered when an animation that has just been resumed.
CStateMachine.AnimationResumed(ATag tagAnim)
          Builds a transition that loops on the current state triggered when a tagged animation that has just been resumed.
CStateMachine.AnimationResumed(ATag tagAnim, java.lang.String outState)
          Builds a transition triggered when a tagged animation that has just been resumed.
CStateMachine.AnimationResumed(java.lang.String outState)
          Builds a transition triggered when any animation that has just been resumed.
 
Method Summary
 Animation getAnimation()
           
 VirtualAnimationEvent getAnimationEvent()
           
 boolean matches(java.util.EventObject eventObject)
          Tests if an event can trigger that transition.
 java.lang.String toString()
          
 
Methods inherited from class fr.lri.swingstates.sm.Transition
action, getEvent, getInputState, getOutputState, guard, oldToString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CStateMachine.AnimationResumed

public CStateMachine.AnimationResumed()
Builds a transition that loops on the current state triggered when any animation that has just been resumed.


CStateMachine.AnimationResumed

public CStateMachine.AnimationResumed(Animation anim)
Builds a transition that loops on the current state triggered when an animation that has just been resumed.

Parameters:
anim - The animation that fires this transition.

CStateMachine.AnimationResumed

public CStateMachine.AnimationResumed(ATag tagAnim)
Builds a transition that loops on the current state triggered when a tagged animation that has just been resumed.

Parameters:
tagAnim - The tag of the animation that fires this transition.

CStateMachine.AnimationResumed

public CStateMachine.AnimationResumed(java.lang.String outState)
Builds a transition triggered when any animation that has just been resumed.

Parameters:
outState - The name of the output state.

CStateMachine.AnimationResumed

public CStateMachine.AnimationResumed(Animation anim,
                                      java.lang.String outState)
Builds a transition triggered when an animation that has just been resumed.

Parameters:
anim - The animation that fires this transition.
outState - The name of the output state.

CStateMachine.AnimationResumed

public CStateMachine.AnimationResumed(ATag tagAnim,
                                      java.lang.String outState)
Builds a transition triggered when a tagged animation that has just been resumed.

Parameters:
tagAnim - The tag of the animation that fires this transition.
outState - The name of the output state.
Method Detail

getAnimation

public Animation getAnimation()
Returns:
the animation that has just fired this transition.

getAnimationEvent

public VirtualAnimationEvent getAnimationEvent()

toString

public java.lang.String toString()

Overrides:
toString in class Event

matches

public boolean matches(java.util.EventObject eventObject)
Tests if an event can trigger that transition.

Overrides:
matches in class Event
Parameters:
eventObject - The event to test
Returns:
True if the eventObject can trigger this transition.