Class AnimatedPickingGraphMousePlugin<V,E>
java.lang.Object
edu.uci.ics.jung.visualization.control.AbstractGraphMousePlugin
edu.uci.ics.jung.visualization.control.AnimatedPickingGraphMousePlugin<V,E>
- All Implemented Interfaces:
GraphMousePlugin, MouseListener, MouseMotionListener, EventListener
- Direct Known Subclasses:
SatelliteAnimatedPickingGraphMousePlugin
public class AnimatedPickingGraphMousePlugin<V,E>
extends AbstractGraphMousePlugin
implements MouseListener, MouseMotionListener
AnimatedPickingGraphMousePlugin supports the picking of one Graph
Vertex. When the mouse is released, the graph is translated so that
the picked Vertex is moved to the center of the view. This translation
is conducted in an animation Thread so that the graph slides to its
new position
-
Field Summary
FieldsFields inherited from class AbstractGraphMousePlugin
cursor, down, modifiers -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance with default modifiers of BUTTON1_MASK and CTRL_MASKAnimatedPickingGraphMousePlugin(int selectionModifiers) Creates an instance with the specified mouse event modifiers. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidmouseDragged(MouseEvent arg0) voidshow a special cursor while the mouse is inside the windowvoidrevert to the default cursor when the mouse leaves this windowvoidvoidIf the event occurs on a Vertex, pick that single VertexvoidIf a Vertex was picked in the mousePressed event, start a Thread to animate the translation of the graph so that the picked Vertex moves to the center of the viewMethods inherited from class AbstractGraphMousePlugin
checkModifiers, getCursor, getModifiers, setCursor, setModifiers
-
Field Details
-
vertex
the picked Vertex
-
-
Constructor Details
-
AnimatedPickingGraphMousePlugin
public AnimatedPickingGraphMousePlugin()Creates an instance with default modifiers of BUTTON1_MASK and CTRL_MASK -
AnimatedPickingGraphMousePlugin
public AnimatedPickingGraphMousePlugin(int selectionModifiers) Creates an instance with the specified mouse event modifiers.- Parameters:
selectionModifiers- the mouse event modifiers to use.
-
-
Method Details
-
mousePressed
If the event occurs on a Vertex, pick that single Vertex- Specified by:
mousePressedin interfaceMouseListener- Parameters:
e- the event
-
mouseReleased
If a Vertex was picked in the mousePressed event, start a Thread to animate the translation of the graph so that the picked Vertex moves to the center of the view- Specified by:
mouseReleasedin interfaceMouseListener- Parameters:
e- the event
-
mouseClicked
- Specified by:
mouseClickedin interfaceMouseListener
-
mouseEntered
show a special cursor while the mouse is inside the window- Specified by:
mouseEnteredin interfaceMouseListener
-
mouseExited
revert to the default cursor when the mouse leaves this window- Specified by:
mouseExitedin interfaceMouseListener
-
mouseMoved
- Specified by:
mouseMovedin interfaceMouseMotionListener
-
mouseDragged
- Specified by:
mouseDraggedin interfaceMouseMotionListener
-