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 edu.uci.ics.jung.visualization.control.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 TypeMethodDescriptionvoid
void
mouseDragged
(MouseEvent arg0) void
show a special cursor while the mouse is inside the windowvoid
revert to the default cursor when the mouse leaves this windowvoid
void
If the event occurs on a Vertex, pick that single Vertexvoid
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 viewMethods inherited from class edu.uci.ics.jung.visualization.control.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:
mousePressed
in 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:
mouseReleased
in interfaceMouseListener
- Parameters:
e
- the event
-
mouseClicked
- Specified by:
mouseClicked
in interfaceMouseListener
-
mouseEntered
show a special cursor while the mouse is inside the window- Specified by:
mouseEntered
in interfaceMouseListener
-
mouseExited
revert to the default cursor when the mouse leaves this window- Specified by:
mouseExited
in interfaceMouseListener
-
mouseMoved
- Specified by:
mouseMoved
in interfaceMouseMotionListener
-
mouseDragged
- Specified by:
mouseDragged
in interfaceMouseMotionListener
-