com.speckled.specksim.gui.visualiser
Class GLSelectionListener

java.lang.Object
  extended by com.speckled.specksim.gui.visualiser.GLSelectionListener
Direct Known Subclasses:
BeaconSwitcher, InspectorTrigger, SpeckLoggingController, SpeckSelector

public abstract class GLSelectionListener
extends java.lang.Object

Objects that are interested in what the selection in the visualisation is should extend this and put appropriate behaviour in the mouse* methods. Note that the subclass can also be made Configurable, and an appropriate gui will be made available. Selection listeners are added to the visualiser by calling SpeckVisualiser.loadSelectionListener(String) before the visualiser is constructed

Author:
ryanm

Constructor Summary
GLSelectionListener()
           
 
Method Summary
abstract  java.lang.String getName()
          Gets a name for this listener
abstract  void init(SpeckSim simulator, SimGUI gui, SpeckVisualiser visualiser)
          Called when the listener is loaded.
protected  void mouseClicked(java.awt.event.MouseEvent e)
          Called when the mouse is clicked on the visualisation
protected  void mouseDragged(java.awt.event.MouseEvent e)
          Called when the mouse is dragged on the visualisation
protected  void mouseEntered(java.awt.event.MouseEvent e)
          Called when the mouse cursor enters the visualisation
protected  void mouseExited(java.awt.event.MouseEvent e)
          Called when the mouse cursor leaves the visualisation
protected  void mouseMoved(java.awt.event.MouseEvent e)
          Called when the mouse is moved on the visualisation
protected  void mousePressed(java.awt.event.MouseEvent e)
          Called when the mouse is pressed on the visualisation
protected  void mouseReleased(java.awt.event.MouseEvent e)
          Called when the mouse is released on the visualisation
protected  void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
          Called when the mouse wheel is moved on the visualisation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GLSelectionListener

public GLSelectionListener()
Method Detail

getName

public abstract java.lang.String getName()
Gets a name for this listener

Returns:
A name for this listener

init

public abstract void init(SpeckSim simulator,
                          SimGUI gui,
                          SpeckVisualiser visualiser)
Called when the listener is loaded. You'll probably want to retain the reference to the simulator so as to be able to get access to the selected speck

Parameters:
simulator - The simulator
gui - The simulator interface
visualiser - The visualiser

mouseClicked

protected void mouseClicked(java.awt.event.MouseEvent e)
Called when the mouse is clicked on the visualisation

Parameters:
e - The mouse event

mousePressed

protected void mousePressed(java.awt.event.MouseEvent e)
Called when the mouse is pressed on the visualisation

Parameters:
e - The mouse event

mouseReleased

protected void mouseReleased(java.awt.event.MouseEvent e)
Called when the mouse is released on the visualisation

Parameters:
e - The mouse event

mouseMoved

protected void mouseMoved(java.awt.event.MouseEvent e)
Called when the mouse is moved on the visualisation

Parameters:
e - The mouse event

mouseDragged

protected void mouseDragged(java.awt.event.MouseEvent e)
Called when the mouse is dragged on the visualisation

Parameters:
e - The mouse event

mouseEntered

protected void mouseEntered(java.awt.event.MouseEvent e)
Called when the mouse cursor enters the visualisation

Parameters:
e - The mouse event

mouseExited

protected void mouseExited(java.awt.event.MouseEvent e)
Called when the mouse cursor leaves the visualisation

Parameters:
e - The mouse event

mouseWheelMoved

protected void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
Called when the mouse wheel is moved on the visualisation

Parameters:
e - The mouse event