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.MouseListenermousePressed in class java.awt.event.MouseAdapterpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenermouseReleased in class java.awt.event.MouseAdapterpublic void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged in interface java.awt.event.MouseMotionListenermouseDragged in class java.awt.event.MouseAdapterpublic void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved in interface java.awt.event.MouseMotionListenermouseMoved in class java.awt.event.MouseAdapterpublic void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
mouseWheelMoved in interface java.awt.event.MouseWheelListenermouseWheelMoved in class java.awt.event.MouseAdapter