|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.uci.ics.jung.visualization.control.AbstractGraphMousePlugin edu.uci.ics.jung.visualization.control.PickingGraphMousePlugin<V,E>
public class PickingGraphMousePlugin<V,E>
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.
Field Summary | |
---|---|
protected int |
addToSelectionModifiers
additional modifiers for the action of adding to an existing selection |
protected E |
edge
the picked Edge, if any |
protected 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 Rectangle2D |
rect
used to draw a rectangle to contain picked vertices |
protected V |
vertex
the picked Vertex, if any |
Fields inherited from class edu.uci.ics.jung.visualization.control.AbstractGraphMousePlugin |
---|
cursor, down, modifiers |
Constructor Summary | |
---|---|
PickingGraphMousePlugin()
create an instance with default settings |
|
PickingGraphMousePlugin(int selectionModifiers,
int addToSelectionModifiers)
create an instance with overides |
Method Summary | |
---|---|
Color |
getLensColor()
|
boolean |
isLocked()
|
void |
mouseClicked(MouseEvent e)
|
void |
mouseDragged(MouseEvent e)
If the mouse is over a picked vertex, drag all picked vertices with the mouse. |
void |
mouseEntered(MouseEvent e)
|
void |
mouseExited(MouseEvent e)
|
void |
mouseMoved(MouseEvent e)
|
void |
mousePressed(MouseEvent e)
For primary modifiers (default, MouseButton1): pick a single Vertex or Edge that is under the mouse pointer. |
void |
mouseReleased(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,
Point2D down,
Point2D out,
boolean clear)
pick the vertices inside the rectangle created from points 'down' and 'out' |
void |
setLensColor(Color lensColor)
|
void |
setLocked(boolean locked)
|
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 |
---|
protected V vertex
protected E edge
protected double offsetx
protected double offsety
protected boolean locked
protected int addToSelectionModifiers
protected Rectangle2D rect
protected VisualizationServer.Paintable lensPaintable
protected Color lensColor
Constructor Detail |
---|
public PickingGraphMousePlugin()
public PickingGraphMousePlugin(int selectionModifiers, int addToSelectionModifiers)
selectionModifiers
- for primary selectionaddToSelectionModifiers
- for additional selectionMethod Detail |
---|
public Color getLensColor()
public void setLensColor(Color lensColor)
lensColor
- The lensColor to set.public void mousePressed(MouseEvent e)
mousePressed
in interface MouseListener
e
- the eventpublic void mouseReleased(MouseEvent e)
mouseReleased
in interface MouseListener
public void mouseDragged(MouseEvent e)
mouseDragged
in interface MouseMotionListener
protected void pickContainedVertices(VisualizationViewer<V,E> vv, Point2D down, Point2D out, boolean clear)
public void mouseClicked(MouseEvent e)
mouseClicked
in interface MouseListener
public void mouseEntered(MouseEvent e)
mouseEntered
in interface MouseListener
public void mouseExited(MouseEvent e)
mouseExited
in interface MouseListener
public void mouseMoved(MouseEvent e)
mouseMoved
in interface MouseMotionListener
public boolean isLocked()
public void setLocked(boolean locked)
locked
- The locked to set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |