edu.uci.ics.jung.visualization.control
Class LabelEditingGraphMousePlugin<V,E>

java.lang.Object
  extended by edu.uci.ics.jung.visualization.control.AbstractGraphMousePlugin
      extended by edu.uci.ics.jung.visualization.control.LabelEditingGraphMousePlugin<V,E>
All Implemented Interfaces:
GraphMousePlugin, MouseListener, EventListener

public class LabelEditingGraphMousePlugin<V,E>
extends AbstractGraphMousePlugin
implements MouseListener

Author:
Tom Nelson

Field Summary
protected  E edge
          the picked Edge, if any
protected  V vertex
          the picked Vertex, if any
 
Fields inherited from class edu.uci.ics.jung.visualization.control.AbstractGraphMousePlugin
cursor, down, modifiers
 
Constructor Summary
LabelEditingGraphMousePlugin()
          create an instance with default settings
LabelEditingGraphMousePlugin(int selectionModifiers)
          create an instance with overides
 
Method Summary
 void mouseClicked(MouseEvent e)
          For primary modifiers (default, MouseButton1): pick a single Vertex or Edge that is under the mouse pointer.
 void mouseEntered(MouseEvent e)
           
 void mouseExited(MouseEvent e)
           
 void mousePressed(MouseEvent e)
          If the mouse is over a picked vertex, drag all picked vertices with the mouse.
 void mouseReleased(MouseEvent e)
          If the mouse is dragging a rectangle, pick the Vertices contained in that rectangle 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

vertex

protected V vertex
the picked Vertex, if any


edge

protected E edge
the picked Edge, if any

Constructor Detail

LabelEditingGraphMousePlugin

public LabelEditingGraphMousePlugin()
create an instance with default settings


LabelEditingGraphMousePlugin

public LabelEditingGraphMousePlugin(int selectionModifiers)
create an instance with overides

Parameters:
selectionModifiers - for primary selection
addToSelectionModifiers - for additional selection
Method Detail

mouseClicked

public void mouseClicked(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:
mouseClicked in interface MouseListener
Parameters:
e - the event

mouseReleased

public void mouseReleased(MouseEvent e)
If the mouse is dragging a rectangle, pick the Vertices contained in that rectangle clean up settings from mousePressed

Specified by:
mouseReleased in interface MouseListener

mousePressed

public void mousePressed(MouseEvent e)
If the mouse is over a picked vertex, drag all picked vertices with the mouse. If the mouse is not over a Vertex, draw the rectangle to select multiple Vertices

Specified by:
mousePressed 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


Copyright © 2009. All Rights Reserved.