Package diva.canvas.interactor
Class ActionInteractor
- java.lang.Object
-
- diva.canvas.interactor.AbstractInteractor
-
- 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$
- Author:
- Steve Neuendorffer
-
-
Constructor Summary
Constructors Constructor Description 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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
-
-
-
-
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 interfaceLayerListener
- Overrides:
mousePressed
in classAbstractInteractor
- Parameters:
layerEvent
- The event
-
setAction
public void setAction(javax.swing.Action action)
Set the action associated with this interactor.
-
-