public class ActionTrigger extends Trigger implements ActionListener
ActionTrigger trigger = ActionTrigger.addTrigger(button, anim);
Constructor and Description |
---|
ActionTrigger(Animator animator)
Creates an ActionTrigger that will start the animator upon receiving
any ActionEvents.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent ae)
Called by an object generating ActionEvents to which this
trigger was added as an ActionListener.
|
static ActionTrigger |
addTrigger(Object object,
Animator animator)
Creates an ActionTrigger and adds it as a listener to object.
|
public ActionTrigger(Animator animator)
animator
- the Animator that start when the event occurspublic static ActionTrigger addTrigger(Object object, Animator animator)
object
- an object that will be used as an event source for
this trigger. This object must have the method addActionListener.animator
- the Animator that start when the event occursIllegalArgumentException
- if object has no
addActionListener()
public void actionPerformed(ActionEvent ae)
actionPerformed
in interface ActionListener