edu.uci.ics.jung.visualization.control
Class AnimatedPickingGraphMousePlugin<V,E>

java.lang.Object
  extended by edu.uci.ics.jung.visualization.control.AbstractGraphMousePlugin
      extended by 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 translateion is conducted in an animation Thread so that the graph slides to its new position

Author:
Tom Nelson

Field Summary
protected  V vertex
          the picked Vertex
 
Fields inherited from class edu.uci.ics.jung.visualization.control.AbstractGraphMousePlugin
cursor, down, modifiers
 
Constructor Summary
AnimatedPickingGraphMousePlugin()
          create an instance with default modifiers
AnimatedPickingGraphMousePlugin(int selectionModifiers)
          create an instance, overriding the default modifiers
 
Method Summary
 void mouseClicked(MouseEvent e)
           
 void mouseDragged(MouseEvent arg0)
           
 void mouseEntered(MouseEvent e)
          show a special cursor while the mouse is inside the window
 void mouseExited(MouseEvent e)
          revert to the default cursor when the mouse leaves this window
 void mouseMoved(MouseEvent e)
           
 void mousePressed(MouseEvent e)
          If the event occurs on a Vertex, pick that single Vertex
 void mouseReleased(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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

vertex

protected V vertex
the picked Vertex

Constructor Detail

AnimatedPickingGraphMousePlugin

public AnimatedPickingGraphMousePlugin()
create an instance with default modifiers


AnimatedPickingGraphMousePlugin

public AnimatedPickingGraphMousePlugin(int selectionModifiers)
create an instance, overriding the default modifiers

Parameters:
selectionModifiers -
Method Detail

mousePressed

public void mousePressed(MouseEvent e)
If the event occurs on a Vertex, pick that single Vertex

Specified by:
mousePressed in interface MouseListener
Parameters:
e - the event

mouseReleased

public void mouseReleased(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:
mouseReleased in interface MouseListener
Parameters:
e - the event

mouseClicked

public void mouseClicked(MouseEvent e)
Specified by:
mouseClicked in interface MouseListener

mouseEntered

public void mouseEntered(MouseEvent e)
show a special cursor while the mouse is inside the window

Specified by:
mouseEntered in interface MouseListener

mouseExited

public void mouseExited(MouseEvent e)
revert to the default cursor when the mouse leaves this window

Specified by:
mouseExited in interface MouseListener

mouseMoved

public void mouseMoved(MouseEvent e)
Specified by:
mouseMoved in interface MouseMotionListener

mouseDragged

public void mouseDragged(MouseEvent arg0)
Specified by:
mouseDragged in interface MouseMotionListener


Copyright © 2009. All Rights Reserved.