public class SimpleGraphMouse extends java.awt.event.MouseAdapter implements VisualizationViewer.GraphMouse
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
SimpleGraphMouse(VisualizationViewer vv)
create an instance for the passed VisualizationViewer
|
Modifier and Type | Method and Description |
---|---|
void |
mouseDragged(java.awt.event.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(java.awt.event.MouseEvent e)
no-op here
|
void |
mousePressed(java.awt.event.MouseEvent e)
Uses the layout class to attempt to pick a vertex in
the graph.
|
void |
mouseReleased(java.awt.event.MouseEvent e)
clean up after the pick of a Vertex or Edge
|
void |
mouseWheelMoved(java.awt.event.MouseWheelEvent e)
no-op here
|
protected VisualizationViewer vv
protected float offsetx
protected float offsety
protected Vertex vertexToDrag
public SimpleGraphMouse(VisualizationViewer vv)
vv
- public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
mousePressed
in class java.awt.event.MouseAdapter
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
mouseReleased
in class java.awt.event.MouseAdapter
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
mouseDragged
in class java.awt.event.MouseAdapter
public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
mouseMoved
in class java.awt.event.MouseAdapter
public void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
mouseWheelMoved
in interface java.awt.event.MouseWheelListener
mouseWheelMoved
in class java.awt.event.MouseAdapter