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,java.awt.event.MouseListener,java.awt.event.MouseMotionListener,java.util.EventListener
- Direct Known Subclasses:
SatelliteAnimatedPickingGraphMousePlugin
public class AnimatedPickingGraphMousePlugin<V,E> extends AbstractGraphMousePlugin implements java.awt.event.MouseListener, java.awt.event.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- Author:
- Tom Nelson
-
-
Constructor Summary
Constructors Constructor Description AnimatedPickingGraphMousePlugin()Creates an instance with default modifiers of BUTTON1_MASK and CTRL_MASKAnimatedPickingGraphMousePlugin(int selectionModifiers)Creates an instance with the specified mouse event modifiers.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidmouseClicked(java.awt.event.MouseEvent e)voidmouseDragged(java.awt.event.MouseEvent arg0)voidmouseEntered(java.awt.event.MouseEvent e)show a special cursor while the mouse is inside the windowvoidmouseExited(java.awt.event.MouseEvent e)revert to the default cursor when the mouse leaves this windowvoidmouseMoved(java.awt.event.MouseEvent e)voidmousePressed(java.awt.event.MouseEvent e)If the event occurs on a Vertex, pick that single VertexvoidmouseReleased(java.awt.event.MouseEvent e)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-
Methods inherited from class edu.uci.ics.jung.visualization.control.AbstractGraphMousePlugin
checkModifiers, getCursor, getModifiers, setCursor, setModifiers
-
-
-
-
Field Detail
-
vertex
protected V vertex
the picked Vertex
-
-
Constructor Detail
-
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 Detail
-
mousePressed
public void mousePressed(java.awt.event.MouseEvent e)
If the event occurs on a Vertex, pick that single Vertex- Specified by:
mousePressedin interfacejava.awt.event.MouseListener- Parameters:
e- the event
-
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent e)
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 interfacejava.awt.event.MouseListener- Parameters:
e- the event
-
mouseClicked
public void mouseClicked(java.awt.event.MouseEvent e)
- Specified by:
mouseClickedin interfacejava.awt.event.MouseListener
-
mouseEntered
public void mouseEntered(java.awt.event.MouseEvent e)
show a special cursor while the mouse is inside the window- Specified by:
mouseEnteredin interfacejava.awt.event.MouseListener
-
mouseExited
public void mouseExited(java.awt.event.MouseEvent e)
revert to the default cursor when the mouse leaves this window- Specified by:
mouseExitedin interfacejava.awt.event.MouseListener
-
mouseMoved
public void mouseMoved(java.awt.event.MouseEvent e)
- Specified by:
mouseMovedin interfacejava.awt.event.MouseMotionListener
-
mouseDragged
public void mouseDragged(java.awt.event.MouseEvent arg0)
- Specified by:
mouseDraggedin interfacejava.awt.event.MouseMotionListener
-
-