diva.canvas.interactor
Class ActionInteractor

java.lang.Object
  extended by diva.canvas.interactor.AbstractInteractor
      extended by diva.canvas.interactor.ActionInteractor
All Implemented Interfaces:
LayerListener, LayerMotionListener, Interactor, java.util.EventListener
Direct Known Subclasses:
ActorEditorGraphController.RelationCreator

public class ActionInteractor
extends AbstractInteractor

An interactor that fires an Action when a mouse pressed event occurs.

Version:
$Id: ActionInteractor.java 38798 2005-07-08 20:00:01Z cxh $
Author:
Steve Neuendorffer

Field Summary
(package private)  javax.swing.Action _action
           
 
Constructor Summary
ActionInteractor()
          Create a new interactor that will throw a NullPointerException when a mouse button is pressed.
ActionInteractor(javax.swing.Action action)
          Create a new interactor that will activate the given action.
 
Method Summary
 javax.swing.Action getAction()
          Return the action associated with this interactor.
 void mousePressed(LayerEvent layerEvent)
          Activate the action referenced by this interactor.
 void setAction(javax.swing.Action action)
          Set the action associated with this interactor.
 
Methods inherited from class diva.canvas.interactor.AbstractInteractor
accept, getMouseFilter, isConsuming, isEnabled, isMotionEnabled, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mouseReleased, setConsuming, setEnabled, setMotionEnabled, setMouseFilter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_action

javax.swing.Action _action
Constructor Detail

ActionInteractor

public ActionInteractor()
Create a new interactor that will throw a NullPointerException when a mouse button is pressed. (In some cases we have to set the action after creating it.)


ActionInteractor

public ActionInteractor(javax.swing.Action action)
Create a new interactor that will activate the given action.

Method Detail

getAction

public javax.swing.Action getAction()
Return the action associated with this interactor.


mousePressed

public void mousePressed(LayerEvent layerEvent)
Activate the action referenced by this interactor. The source of the ActionEvent is the layer event.

Specified by:
mousePressed in interface LayerListener
Overrides:
mousePressed in class AbstractInteractor

setAction

public void setAction(javax.swing.Action action)
Set the action associated with this interactor.