repast.simphony.visualization.editor
Class GridAddHandler

java.lang.Object
  extended by edu.umd.cs.piccolo.event.PBasicInputEventHandler
      extended by repast.simphony.visualization.editor.GridAddHandler
All Implemented Interfaces:
edu.umd.cs.piccolo.event.PInputEventListener, EventListener, PEditorEventListener

Deprecated. 2D piccolo based code is being removed

public class GridAddHandler
extends edu.umd.cs.piccolo.event.PBasicInputEventHandler
implements PEditorEventListener

Handler for adding via mouse click.

Author:
Nick Collier

Constructor Summary
GridAddHandler(edu.umd.cs.piccolo.PCanvas canvas, DisplayEditor2D editor, Grid grid)
          Deprecated.  
 
Method Summary
 void destroy()
          Deprecated. Cleans up anything created by this listener in init.
 void init()
          Deprecated. Initializes this listener.
 void mouseClicked(edu.umd.cs.piccolo.event.PInputEvent evt)
          Deprecated. double[] origin = space.getDimensions().originToDoubleArray(null); double xOffset = origin[0]; double yOffset = origin[1]; if (x < space.getDimensions().getWidth() && x >= 0 && y < space.getDimensions().getHeight() && y >= 0) { editor.addAgentAt(x-xOffset, y-yOffset);
 void mouseEntered(edu.umd.cs.piccolo.event.PInputEvent evt)
          Deprecated.  
 void start()
          Deprecated. Starts the listener.
 void stop()
          Deprecated. Stops the listener.
 
Methods inherited from class edu.umd.cs.piccolo.event.PBasicInputEventHandler
acceptsEvent, getEventFilter, keyboardFocusGained, keyboardFocusLost, keyPressed, keyReleased, keyTyped, mouseDragged, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelRotated, mouseWheelRotatedByBlock, paramString, processEvent, setEventFilter, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.umd.cs.piccolo.event.PInputEventListener
processEvent
 

Constructor Detail

GridAddHandler

public GridAddHandler(edu.umd.cs.piccolo.PCanvas canvas,
                      DisplayEditor2D editor,
                      Grid grid)
Deprecated. 
Method Detail

init

public void init()
Deprecated. 
Description copied from interface: PEditorEventListener
Initializes this listener. This happens only once whereas start / stop may occur multiple times.

Specified by:
init in interface PEditorEventListener

destroy

public void destroy()
Deprecated. 
Description copied from interface: PEditorEventListener
Cleans up anything created by this listener in init. This happens only once whereas start / stop may occur multiple times.

Specified by:
destroy in interface PEditorEventListener

start

public void start()
Deprecated. 
Starts the listener. At the very least this should add the listener to whatever PNode it is listening on.

Specified by:
start in interface PEditorEventListener

stop

public void stop()
Deprecated. 
Stops the listener. At the very least this should remove the listener to whatever PNode it is listening on.

Specified by:
stop in interface PEditorEventListener

mouseEntered

public void mouseEntered(edu.umd.cs.piccolo.event.PInputEvent evt)
Deprecated. 
Overrides:
mouseEntered in class edu.umd.cs.piccolo.event.PBasicInputEventHandler

mouseClicked

public void mouseClicked(edu.umd.cs.piccolo.event.PInputEvent evt)
Deprecated. 
double[] origin = space.getDimensions().originToDoubleArray(null); double xOffset = origin[0]; double yOffset = origin[1]; if (x < space.getDimensions().getWidth() && x >= 0 && y < space.getDimensions().getHeight() && y >= 0) { editor.addAgentAt(x-xOffset, y-yOffset);

Overrides:
mouseClicked in class edu.umd.cs.piccolo.event.PBasicInputEventHandler