Class AnimatedPickingGraphMousePlugin<V,E>
- java.lang.Object
-
- org.jungrapht.visualization.control.AbstractGraphMousePlugin
-
- org.jungrapht.visualization.control.AnimatedPickingGraphMousePlugin<V,E>
-
- All Implemented Interfaces:
MouseListener,MouseMotionListener,EventListener,GraphMousePlugin
- 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 selected 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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jungrapht.visualization.control.AbstractGraphMousePlugin
AbstractGraphMousePlugin.Selecting
-
-
Field Summary
Fields Modifier and Type Field Description protected intselectionModifiersprotected Vvertexthe selected Vertex-
Fields inherited from class org.jungrapht.visualization.control.AbstractGraphMousePlugin
cursor, down, modifiers
-
-
Constructor Summary
Constructors Constructor Description AnimatedPickingGraphMousePlugin()Creates an instance with default modifiers of BUTTON1_DOWN_MASK and CTRL_DOWN_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(MouseEvent e)voidmouseDragged(MouseEvent arg0)voidmouseEntered(MouseEvent e)show a special cursor while the mouse is inside the windowvoidmouseExited(MouseEvent e)revert to the default cursor when the mouse leaves this windowvoidmouseMoved(MouseEvent e)voidmousePressed(MouseEvent e)If the event occurs on a Vertex, pick that single VertexvoidmouseReleased(MouseEvent e)If a Vertex was selected in the mousePressed event, start a Thread to animate the translation of the graph so that the selected Vertex moves to the center of the view-
Methods inherited from class org.jungrapht.visualization.control.AbstractGraphMousePlugin
checkModifiers, getCursor, getModifiersEx, setCursor, setModifiers
-
-
-
-
Field Detail
-
vertex
protected V vertex
the selected Vertex
-
selectionModifiers
protected int selectionModifiers
-
-
Constructor Detail
-
AnimatedPickingGraphMousePlugin
public AnimatedPickingGraphMousePlugin()
Creates an instance with default modifiers of BUTTON1_DOWN_MASK and CTRL_DOWN_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(MouseEvent e)
If the event occurs on a Vertex, pick that single Vertex- Specified by:
mousePressedin interfaceMouseListener- Parameters:
e- the event
-
mouseReleased
public void mouseReleased(MouseEvent e)
If a Vertex was selected in the mousePressed event, start a Thread to animate the translation of the graph so that the selected Vertex moves to the center of the view- Specified by:
mouseReleasedin interfaceMouseListener- Parameters:
e- the event
-
mouseClicked
public void mouseClicked(MouseEvent e)
- Specified by:
mouseClickedin interfaceMouseListener
-
mouseEntered
public void mouseEntered(MouseEvent e)
show a special cursor while the mouse is inside the window- Specified by:
mouseEnteredin interfaceMouseListener
-
mouseExited
public void mouseExited(MouseEvent e)
revert to the default cursor when the mouse leaves this window- Specified by:
mouseExitedin interfaceMouseListener
-
mouseMoved
public void mouseMoved(MouseEvent e)
- Specified by:
mouseMovedin interfaceMouseMotionListener
-
mouseDragged
public void mouseDragged(MouseEvent arg0)
- Specified by:
mouseDraggedin interfaceMouseMotionListener
-
-