samples.preview_new_graphdraw.impl
Class GraphLayoutPanelMouseListener
java.lang.Object
java.awt.event.MouseAdapter
samples.preview_new_graphdraw.impl.GraphLayoutPanelMouseListener
- All Implemented Interfaces:
- MouseListener, MouseMotionListener, MouseWheelListener, EventListener
public class GraphLayoutPanelMouseListener
- extends MouseAdapter
- Author:
- danyelf
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
panel
protected final GraphLayoutPanel panel
VERTEX_CLICK_THRESHOLD
public static double VERTEX_CLICK_THRESHOLD
- This constant tracks how far a click needs to be before it's too far to
register at all.
EDGE_CLICK_THRESHOLD
public static double EDGE_CLICK_THRESHOLD
VERTEX_BIAS
public static double VERTEX_BIAS
- If the system is set to accept both VERTEX and EDGE clicks, then any
edge click will be just as far from a vertex as a vertex click is.
(After all, each edge terminates in a vertex.) This bias allows the
vertex a little extra radius near it. A value of 2.0 means that a click
can be 2 times as far from the nearest vertex as the nearest edge, and
still be registered.
GraphLayoutPanelMouseListener
public GraphLayoutPanelMouseListener(GraphLayoutPanel panel)
- Parameters:
panel
-
fireVertexEvent
protected void fireVertexEvent(Vertex v,
double dist_to_closest_vertex,
MouseEvent e)
fireEdgeEvent
protected void fireEdgeEvent(Edge e,
double dist_to_closest_edge,
MouseEvent me)
mouseClicked
public void mouseClicked(MouseEvent e)
- Specified by:
mouseClicked
in interface MouseListener
- Overrides:
mouseClicked
in class MouseAdapter