public class PickingGraphMousePlugin<V,E> extends AbstractGraphMousePlugin implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener
Modifier and Type | Field and Description |
---|---|
protected int |
addToSelectionModifiers
additional modifiers for the action of adding to an existing
selection
|
protected E |
edge
the picked Edge, if any
|
protected java.awt.Color |
lensColor
color for the picking rectangle
|
protected VisualizationServer.Paintable |
lensPaintable
the Paintable for the lens picking rectangle
|
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 java.awt.geom.Rectangle2D |
rect
used to draw a rectangle to contain picked vertices
|
protected V |
vertex
the picked Vertex, if any
|
cursor, down, modifiers
Constructor and Description |
---|
PickingGraphMousePlugin()
create an instance with default settings
|
PickingGraphMousePlugin(int selectionModifiers,
int addToSelectionModifiers)
create an instance with overides
|
Modifier and Type | Method and Description |
---|---|
java.awt.Color |
getLensColor() |
boolean |
isLocked() |
void |
mouseClicked(java.awt.event.MouseEvent e) |
void |
mouseDragged(java.awt.event.MouseEvent e)
If the mouse is over a picked vertex, drag all picked
vertices with the mouse.
|
void |
mouseEntered(java.awt.event.MouseEvent e) |
void |
mouseExited(java.awt.event.MouseEvent e) |
void |
mouseMoved(java.awt.event.MouseEvent e) |
void |
mousePressed(java.awt.event.MouseEvent e)
For primary modifiers (default, MouseButton1):
pick a single Vertex or Edge that
is under the mouse pointer.
|
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
|
protected void |
pickContainedVertices(VisualizationViewer<V,E> vv,
java.awt.geom.Point2D down,
java.awt.geom.Point2D out,
boolean clear)
pick the vertices inside the rectangle created from points
'down' and 'out'
|
void |
setLensColor(java.awt.Color lensColor) |
void |
setLocked(boolean locked) |
checkModifiers, getCursor, getModifiers, setCursor, setModifiers
protected V vertex
protected E edge
protected double offsetx
protected double offsety
protected boolean locked
protected int addToSelectionModifiers
protected java.awt.geom.Rectangle2D rect
protected VisualizationServer.Paintable lensPaintable
protected java.awt.Color lensColor
public PickingGraphMousePlugin()
public PickingGraphMousePlugin(int selectionModifiers, int addToSelectionModifiers)
selectionModifiers
- for primary selectionaddToSelectionModifiers
- for additional selectionpublic java.awt.Color getLensColor()
public void setLensColor(java.awt.Color lensColor)
lensColor
- The lensColor to set.public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
e
- the eventpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
protected void pickContainedVertices(VisualizationViewer<V,E> vv, java.awt.geom.Point2D down, java.awt.geom.Point2D out, boolean clear)
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
public boolean isLocked()
public void setLocked(boolean locked)
locked
- The locked to set.