edu.uci.ics.jung.visualization.control
Class PickingGraphMousePlugin<V,E>
- java.lang.Object
-
- edu.uci.ics.jung.visualization.control.AbstractGraphMousePlugin
-
- edu.uci.ics.jung.visualization.control.PickingGraphMousePlugin<V,E>
-
- All Implemented Interfaces:
- GraphMousePlugin, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.util.EventListener
public class PickingGraphMousePlugin<V,E> extends AbstractGraphMousePlugin implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener
PickingGraphMousePlugin supports the picking of graph elements with the mouse. MouseButtonOne picks a single vertex or edge, and MouseButtonTwo adds to the set of selected Vertices or EdgeType. If a Vertex is selected and the mouse is dragged while on the selected Vertex, then that Vertex will be repositioned to follow the mouse until the button is released.
-
-
Constructor Summary
Constructors Constructor and Description PickingGraphMousePlugin()create an instance with default settingsPickingGraphMousePlugin(int selectionModifiers, int addToSelectionModifiers)create an instance with overides
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.awt.ColorgetLensColor()booleanisLocked()voidmouseClicked(java.awt.event.MouseEvent e)voidmouseDragged(java.awt.event.MouseEvent e)If the mouse is over a picked vertex, drag all picked vertices with the mouse.voidmouseEntered(java.awt.event.MouseEvent e)voidmouseExited(java.awt.event.MouseEvent e)voidmouseMoved(java.awt.event.MouseEvent e)voidmousePressed(java.awt.event.MouseEvent e)For primary modifiers (default, MouseButton1): pick a single Vertex or Edge that is under the mouse pointer.voidmouseReleased(java.awt.event.MouseEvent e)If the mouse is dragging a rectangle, pick the Vertices contained in that rectangle clean up settings from mousePressedvoidsetLensColor(java.awt.Color lensColor)voidsetLocked(boolean locked)-
Methods inherited from class edu.uci.ics.jung.visualization.control.AbstractGraphMousePlugin
checkModifiers, getCursor, getModifiers, setCursor, setModifiers
-
-
-
-
Constructor Detail
-
PickingGraphMousePlugin
public PickingGraphMousePlugin()
create an instance with default settings
-
PickingGraphMousePlugin
public PickingGraphMousePlugin(int selectionModifiers, int addToSelectionModifiers)create an instance with overides- Parameters:
selectionModifiers- for primary selectionaddToSelectionModifiers- for additional selection
-
-
Method Detail
-
getLensColor
public java.awt.Color getLensColor()
- Returns:
- Returns the lensColor.
-
setLensColor
public void setLensColor(java.awt.Color lensColor)
- Parameters:
lensColor- The lensColor to set.
-
mousePressed
public void mousePressed(java.awt.event.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:
mousePressedin interfacejava.awt.event.MouseListener- Parameters:
e- the event
-
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent e)
If the mouse is dragging a rectangle, pick the Vertices contained in that rectangle clean up settings from mousePressed- Specified by:
mouseReleasedin interfacejava.awt.event.MouseListener
-
mouseDragged
public void mouseDragged(java.awt.event.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:
mouseDraggedin interfacejava.awt.event.MouseMotionListener
-
mouseClicked
public void mouseClicked(java.awt.event.MouseEvent e)
- Specified by:
mouseClickedin interfacejava.awt.event.MouseListener
-
mouseEntered
public void mouseEntered(java.awt.event.MouseEvent e)
- Specified by:
mouseEnteredin interfacejava.awt.event.MouseListener
-
mouseExited
public void mouseExited(java.awt.event.MouseEvent e)
- Specified by:
mouseExitedin interfacejava.awt.event.MouseListener
-
mouseMoved
public void mouseMoved(java.awt.event.MouseEvent e)
- Specified by:
mouseMovedin interfacejava.awt.event.MouseMotionListener
-
isLocked
public boolean isLocked()
- Returns:
- Returns the locked.
-
setLocked
public void setLocked(boolean locked)
- Parameters:
locked- The locked to set.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG