jInfer

cz.cuni.mff.ksi.jinfer.autoeditor.automatonvisualizer.graphmouseplugins
Class VertexPickingGraphMousePlugin<V>

java.lang.Object
  extended by edu.uci.ics.jung.visualization.control.AbstractGraphMousePlugin
      extended by cz.cuni.mff.ksi.jinfer.autoeditor.automatonvisualizer.graphmouseplugins.VertexPickingGraphMousePlugin<V>
All Implemented Interfaces:
edu.uci.ics.jung.visualization.control.GraphMousePlugin, MouseListener, MouseMotionListener, EventListener

public class VertexPickingGraphMousePlugin<V>
extends edu.uci.ics.jung.visualization.control.AbstractGraphMousePlugin
implements MouseListener, MouseMotionListener

Graph mouse plugin providing picking of one vertex and notifying AbstractComponent to end user interaction. Modified VerticesPickingGraphMousePlugin originally by sviro.


Field Summary
protected  AbstractComponent<V> component
          component that has to be notified that a vertex was picked by calling its GUIDone method.
protected  Step<V> edge
          the picked Edge, if any
protected  boolean locked
          controls whether the Vertices may be moved with the mouse
protected  double offsetx
          the x distance from the picked vertex center to the mouse point
protected  double offsety
          the y distance from the picked vertex center to the mouse point
protected  State<V> vertex
          the picked Vertex, if any
 
Fields inherited from class edu.uci.ics.jung.visualization.control.AbstractGraphMousePlugin
cursor, down, modifiers
 
Constructor Summary
VertexPickingGraphMousePlugin(AbstractComponent<V> component)
          Create an instance with default settings.
 
Method Summary
 void mouseClicked(MouseEvent e)
           
 void mouseDragged(MouseEvent e)
           
 void mouseEntered(MouseEvent e)
           
 void mouseExited(MouseEvent e)
           
 void mouseMoved(MouseEvent e)
           
 void mousePressed(MouseEvent e)
          For primary modifiers (default, MouseButton1): pick a single Vertex or Edge that is under the mouse pointer.
 void mouseReleased(MouseEvent e)
          clean up settings from mousePressed
 
Methods inherited from class edu.uci.ics.jung.visualization.control.AbstractGraphMousePlugin
checkModifiers, getCursor, getModifiers, setCursor, setModifiers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

component

protected AbstractComponent<V> component
component that has to be notified that a vertex was picked by calling its GUIDone method.


vertex

protected State<V> vertex
the picked Vertex, if any


edge

protected Step<V> edge
the picked Edge, if any


offsetx

protected double offsetx
the x distance from the picked vertex center to the mouse point


offsety

protected double offsety
the y distance from the picked vertex center to the mouse point


locked

protected boolean locked
controls whether the Vertices may be moved with the mouse

Constructor Detail

VertexPickingGraphMousePlugin

public VertexPickingGraphMousePlugin(AbstractComponent<V> component)
Create an instance with default settings.

Method Detail

mousePressed

public void mousePressed(MouseEvent e)
For primary modifiers (default, MouseButton1): pick a single Vertex or Edge that is under the mouse pointer. If no Vertex or edge is under the pointer, unselect all picked Vertices and edges, and set up to draw a rectangle for multiple selection of contained Vertices. For additional selection (default Shift+MouseButton1): Add to the selection, a single Vertex or Edge that is under the mouse pointer. If a previously picked Vertex or Edge is under the pointer, it is un-picked. If no vertex or Edge is under the pointer, set up to draw a multiple selection rectangle (as above) but do not unpick previously picked elements.

Specified by:
mousePressed in interface MouseListener
Parameters:
e - the event

mouseReleased

public void mouseReleased(MouseEvent e)
clean up settings from mousePressed

Specified by:
mouseReleased in interface MouseListener

mouseDragged

public void mouseDragged(MouseEvent e)
Specified by:
mouseDragged in interface MouseMotionListener

mouseClicked

public void mouseClicked(MouseEvent e)
Specified by:
mouseClicked in interface MouseListener

mouseEntered

public void mouseEntered(MouseEvent e)
Specified by:
mouseEntered in interface MouseListener

mouseExited

public void mouseExited(MouseEvent e)
Specified by:
mouseExited in interface MouseListener

mouseMoved

public void mouseMoved(MouseEvent e)
Specified by:
mouseMoved in interface MouseMotionListener

jInfer

Generated on Fri Dec 9 00:01:25 CET 2011