Class GridAddHandler
- java.lang.Object
-
- org.piccolo2d.event.PBasicInputEventHandler
-
- repast.simphony.visualization.editor.GridAddHandler
-
- All Implemented Interfaces:
EventListener
,org.piccolo2d.event.PInputEventListener
,PEditorEventListener
public class GridAddHandler extends org.piccolo2d.event.PBasicInputEventHandler implements PEditorEventListener
Deprecated.2D piccolo based code is being removedHandler for adding via mouse click.- Author:
- Nick Collier
-
-
Constructor Summary
Constructors Constructor Description GridAddHandler(org.piccolo2d.PCanvas canvas, DisplayEditor2D editor, Grid grid)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
destroy()
Deprecated.Cleans up anything created by this listener in init.void
init()
Deprecated.Initializes this listener.void
mouseClicked(org.piccolo2d.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(org.piccolo2d.event.PInputEvent evt)
Deprecated.void
start()
Deprecated.Starts the listener.void
stop()
Deprecated.Stops the listener.-
Methods inherited from class org.piccolo2d.event.PBasicInputEventHandler
acceptsEvent, getEventFilter, keyboardFocusGained, keyboardFocusLost, keyPressed, keyReleased, keyTyped, mouseDragged, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelRotated, mouseWheelRotatedByBlock, processEvent, setEventFilter
-
-
-
-
Constructor Detail
-
GridAddHandler
public GridAddHandler(org.piccolo2d.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 interfacePEditorEventListener
-
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 interfacePEditorEventListener
-
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 interfacePEditorEventListener
-
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 interfacePEditorEventListener
-
mouseEntered
public void mouseEntered(org.piccolo2d.event.PInputEvent evt)
Deprecated.- Overrides:
mouseEntered
in classorg.piccolo2d.event.PBasicInputEventHandler
-
mouseClicked
public void mouseClicked(org.piccolo2d.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 classorg.piccolo2d.event.PBasicInputEventHandler
-
-