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, EventListener

public class ActionInteractor
extends AbstractInteractor

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

Version:
$Revision: 1.6 $
Author:
Steve Neuendorffer (neuendor@eecs.berkeley.edu)

Constructor Summary
ActionInteractor()
          Create a new interactor that will throw a NullPointerException when a mouse button is pressed.
ActionInteractor(Action action)
          Create a new interactor that will activate the given action.
 
Method Summary
 Action getAction()
          Return the action associated with this interactor.
 void mousePressed(LayerEvent layerEvent)
          Activate the action referenced by this interactor.
 void setAction(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
 

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(Action action)
Create a new interactor that will activate the given action.

Method Detail

getAction

public 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(Action action)
Set the action associated with this interactor.



Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.