|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.event.MouseAdapter
edu.uci.ics.jung.visualization.SimpleGraphMouse
public class SimpleGraphMouse
SimpleGraphMouse is the original GraphMouse class that was nested in VisualizationViewer and installed as a listener for mouse events and mouse motion events. Users can restore previous capability by creating an instance of this class and using VisualizationViewer.setGraphMouse() to re-install it. Changes in this code from the nested version are mainly those necessary to move it outside the VisualizationViewer class, and to properly handle the transform values of the VisualizationViewer (the zoom and pan)
Field Summary | |
---|---|
protected float |
offsetx
how far the mouse point x is from the vertex center x |
protected float |
offsety
how far the mouse point y is from the vertex center y |
protected Vertex |
vertexToDrag
the vertex to drag with a mouseDragged operation |
protected VisualizationViewer |
vv
the VisualizationViewer who's mouse events call these methods. |
Constructor Summary | |
---|---|
SimpleGraphMouse(VisualizationViewer vv)
create an instance for the passed VisualizationViewer |
Method Summary | |
---|---|
void |
mouseDragged(MouseEvent e)
if a Vertex was picked in the mousePressed method, use the layout class to force that Vertex to move, following the motion of the mouse. |
void |
mouseMoved(MouseEvent e)
no-op here |
void |
mousePressed(MouseEvent e)
Uses the layout class to attempt to pick a vertex in the graph. |
void |
mouseReleased(MouseEvent e)
clean up after the pick of a Vertex or Edge |
void |
mouseWheelMoved(MouseWheelEvent e)
no-op here |
Methods inherited from class java.awt.event.MouseAdapter |
---|
mouseClicked, mouseEntered, mouseExited |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.awt.event.MouseListener |
---|
mouseClicked, mouseEntered, mouseExited |
Field Detail |
---|
protected VisualizationViewer vv
protected float offsetx
protected float offsety
protected Vertex vertexToDrag
Constructor Detail |
---|
public SimpleGraphMouse(VisualizationViewer vv)
vv
- Method Detail |
---|
public void mousePressed(MouseEvent e)
mousePressed
in interface MouseListener
mousePressed
in class MouseAdapter
public void mouseReleased(MouseEvent e)
mouseReleased
in interface MouseListener
mouseReleased
in class MouseAdapter
public void mouseDragged(MouseEvent e)
mouseDragged
in interface MouseMotionListener
public void mouseMoved(MouseEvent e)
mouseMoved
in interface MouseMotionListener
public void mouseWheelMoved(MouseWheelEvent e)
mouseWheelMoved
in interface MouseWheelListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |