Class LensKillingGraphMousePlugin<V,E>
- java.lang.Object
-
- org.jungrapht.visualization.control.AbstractGraphMousePlugin
-
- org.jungrapht.visualization.control.SelectingGraphMousePlugin<V,E>
-
- org.jungrapht.visualization.control.LensKillingGraphMousePlugin<V,E>
-
- Type Parameters:
V- vertex typeE- edge type
- All Implemented Interfaces:
MouseListener,MouseMotionListener,EventListener,GraphMousePlugin
public class LensKillingGraphMousePlugin<V,E> extends SelectingGraphMousePlugin<V,E>
A subclass of SelectingGraphMousePlugin that will deactivate the lens- Author:
- Tom Nelson
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jungrapht.visualization.control.SelectingGraphMousePlugin
SelectingGraphMousePlugin.Builder<V,E,T extends SelectingGraphMousePlugin,B extends SelectingGraphMousePlugin.Builder<V,E,T,B>>
-
Nested classes/interfaces inherited from class org.jungrapht.visualization.control.AbstractGraphMousePlugin
AbstractGraphMousePlugin.Selecting
-
-
Field Summary
Fields Modifier and Type Field Description protected TransformSupporttransformSupport-
Fields inherited from class org.jungrapht.visualization.control.SelectingGraphMousePlugin
addSingleSelectionMask, deltaDown, deselectedVertex, edge, footprintRectangle, lensColor, locked, multiSelectionStrategy, pickFootprintPaintable, pickSize, singleSelectionMask, vertex, vertexDragged
-
Fields inherited from class org.jungrapht.visualization.control.AbstractGraphMousePlugin
cursor, down, modifiers
-
-
Constructor Summary
Constructors Constructor Description LensKillingGraphMousePlugin()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Point2DinverseTransform(VisualizationViewer<V,E> vv, Point2D p)Overriden to apply lens effects to the transformation from view to layout coordinatesvoidmouseClicked(MouseEvent e)voidmouseDragged(MouseEvent e)If the mouse is over a selected vertex, drag all selected vertices with the mouse.voidmouseEntered(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 rectanglevoidsetKillSwitch(Runnable killSwitch)protected Shapetransform(VisualizationViewer<V,E> vv, Shape shape)Overriden to perform lens effects when transforming from Layout to view.-
Methods inherited from class org.jungrapht.visualization.control.SelectingGraphMousePlugin
builder, getLensColor, isLocked, setLensColor, setLocked, singleEdgeSelection, singleVertexSelection, toString
-
Methods inherited from class org.jungrapht.visualization.control.AbstractGraphMousePlugin
checkModifiers, getCursor, getModifiersEx, setCursor, setModifiers
-
-
-
-
Field Detail
-
transformSupport
protected TransformSupport transformSupport
-
-
Method Detail
-
setKillSwitch
public void setKillSwitch(Runnable killSwitch)
-
mousePressed
public void mousePressed(MouseEvent e)
Description copied from class:SelectingGraphMousePluginFor 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 interfaceMouseListener- Overrides:
mousePressedin classSelectingGraphMousePlugin<V,E>- Parameters:
e- the event
-
mouseDragged
public void mouseDragged(MouseEvent e)
Description copied from class:SelectingGraphMousePluginIf the mouse is over a selected vertex, drag all selected vertices with the mouse. If the mouse is not over a Vertex, draw the rectangle to select multiple Vertices- Specified by:
mouseDraggedin interfaceMouseMotionListener- Overrides:
mouseDraggedin classSelectingGraphMousePlugin<V,E>
-
mouseClicked
public void mouseClicked(MouseEvent e)
- Specified by:
mouseClickedin interfaceMouseListener- Overrides:
mouseClickedin classSelectingGraphMousePlugin<V,E>
-
mouseEntered
public void mouseEntered(MouseEvent e)
- Specified by:
mouseEnteredin interfaceMouseListener- Overrides:
mouseEnteredin classSelectingGraphMousePlugin<V,E>
-
mouseExited
public void mouseExited(MouseEvent e)
- Specified by:
mouseExitedin interfaceMouseListener- Overrides:
mouseExitedin classSelectingGraphMousePlugin<V,E>
-
mouseMoved
public void mouseMoved(MouseEvent e)
- Specified by:
mouseMovedin interfaceMouseMotionListener- Overrides:
mouseMovedin classSelectingGraphMousePlugin<V,E>
-
mouseReleased
public void mouseReleased(MouseEvent e)
Description copied from class:SelectingGraphMousePluginIf the mouse is dragging a rectangle, pick the Vertices contained in that rectangleclean up settings from mousePressed
- Specified by:
mouseReleasedin interfaceMouseListener- Overrides:
mouseReleasedin classSelectingGraphMousePlugin<V,E>
-
inverseTransform
protected Point2D inverseTransform(VisualizationViewer<V,E> vv, Point2D p)
Overriden to apply lens effects to the transformation from view to layout coordinates- Overrides:
inverseTransformin classSelectingGraphMousePlugin<V,E>- Parameters:
vv-p-- Returns:
-
transform
protected Shape transform(VisualizationViewer<V,E> vv, Shape shape)
Overriden to perform lens effects when transforming from Layout to view. Used when projecting the selection Lens (the rectangular area drawn with the mouse) back into the view.- Overrides:
transformin classSelectingGraphMousePlugin<V,E>- Parameters:
vv-shape-- Returns:
-
-