Class EdgeSelectingGraphMousePlugin<V,E>
- java.lang.Object
- 
- org.jungrapht.visualization.control.AbstractGraphMousePlugin
- 
- org.jungrapht.visualization.control.EdgeSelectingGraphMousePlugin<V,E>
 
 
- 
- Type Parameters:
- V- vertex type
- E- edge type
 - All Implemented Interfaces:
- MouseListener,- MouseMotionListener,- EventListener,- GraphMousePlugin
 
 public class EdgeSelectingGraphMousePlugin<V,E> extends AbstractGraphMousePlugin implements MouseListener, MouseMotionListener EdgeSelectingGraphMousePlugin supports the selecting of graph elements with the mouse. MouseButtonOne selects 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.- Author:
- Tom Nelson
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class org.jungrapht.visualization.control.AbstractGraphMousePluginAbstractGraphMousePlugin.Selecting
 
- 
 - 
Field SummaryFields Modifier and Type Field Description protected intaddSingleSelectionMaskprotected Point2DdeltaDownprotected Eedgethe selected Edge, if anyprotected Rectangle2DfootprintRectangleprotected ColorlensColorcolor for the picking rectangleprotected VisualizationServer.PaintablepickFootprintPaintableprotected intpickSizeprotected intsingleSelectionMask- 
Fields inherited from class org.jungrapht.visualization.control.AbstractGraphMousePlugincursor, down, modifiers
 
- 
 - 
Constructor SummaryConstructors Constructor Description EdgeSelectingGraphMousePlugin(int singleSelectionMask, int addSingleSelectionMask)create an instance with overrides
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description ColorgetLensColor()protected Point2DinverseTransform(VisualizationViewer<V,E> vv, Point2D p)override to consider Lens effectsvoidmouseClicked(MouseEvent e)voidmouseDragged(MouseEvent e)no opvoidmouseEntered(MouseEvent e)voidmouseExited(MouseEvent e)voidmouseMoved(MouseEvent e)voidmousePressed(MouseEvent e)For primary modifiers (default, MouseButton1): pick a single Vertex or Edge that is under the mouse pointer.voidmouseReleased(MouseEvent e)If the mouse is dragging a rectangle, pick the Vertices contained in that rectanglevoidsetLensColor(Color lensColor)protected booleansingleEdgeSelection(MouseEvent e, Point2D layoutPoint, boolean addToSelection)protected Shapetransform(VisualizationViewer<V,E> vv, Shape shape)override to consider Lens effects- 
Methods inherited from class org.jungrapht.visualization.control.AbstractGraphMousePlugincheckModifiers, getCursor, getModifiersEx, setCursor, setModifiers
 
- 
 
- 
- 
- 
Field Detail- 
pickSizeprotected int pickSize 
 - 
edgeprotected E edge the selected Edge, if any
 - 
footprintRectangleprotected Rectangle2D footprintRectangle 
 - 
pickFootprintPaintableprotected VisualizationServer.Paintable pickFootprintPaintable 
 - 
lensColorprotected Color lensColor color for the picking rectangle
 - 
deltaDownprotected Point2D deltaDown 
 - 
singleSelectionMaskprotected int singleSelectionMask 
 - 
addSingleSelectionMaskprotected int addSingleSelectionMask 
 
- 
 - 
Method Detail- 
getLensColorpublic Color getLensColor() - Returns:
- Returns the lensColor.
 
 - 
setLensColorpublic void setLensColor(Color lensColor) - Parameters:
- lensColor- The lensColor to set.
 
 - 
mousePressedpublic 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 selected 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 selected Vertex or Edge is under the pointer, it is un-selected. If no vertex or Edge is under the pointer, set up to draw a multiple selection rectangle (as above) but do not unpick previously selected elements.- Specified by:
- mousePressedin interface- MouseListener
- Parameters:
- e- the event
 
 - 
singleEdgeSelectionprotected boolean singleEdgeSelection(MouseEvent e, Point2D layoutPoint, boolean addToSelection) 
 - 
mouseReleasedpublic void mouseReleased(MouseEvent e) If the mouse is dragging a rectangle, pick the Vertices contained in that rectangleclean up settings from mousePressed - Specified by:
- mouseReleasedin interface- MouseListener
 
 - 
mouseDraggedpublic void mouseDragged(MouseEvent e) no op- Specified by:
- mouseDraggedin interface- MouseMotionListener
 
 - 
inverseTransformprotected Point2D inverseTransform(VisualizationViewer<V,E> vv, Point2D p) override to consider Lens effects- Parameters:
- vv-
- p-
- Returns:
 
 - 
transformprotected Shape transform(VisualizationViewer<V,E> vv, Shape shape) override to consider Lens effects- Parameters:
- vv-
- shape-
- Returns:
 
 - 
mouseClickedpublic void mouseClicked(MouseEvent e) - Specified by:
- mouseClickedin interface- MouseListener
 
 - 
mouseEnteredpublic void mouseEntered(MouseEvent e) - Specified by:
- mouseEnteredin interface- MouseListener
 
 - 
mouseExitedpublic void mouseExited(MouseEvent e) - Specified by:
- mouseExitedin interface- MouseListener
 
 - 
mouseMovedpublic void mouseMoved(MouseEvent e) - Specified by:
- mouseMovedin interface- MouseMotionListener
 
 
- 
 
-