public class EditingGraphMousePlugin<V,E> extends AbstractGraphMousePlugin implements MouseListener, MouseMotionListener
| Modifier and Type | Field and Description |
|---|---|
protected VisualizationServer.Paintable |
arrowPaintable |
protected Shape |
arrowShape |
protected Point2D |
down |
protected org.apache.commons.collections4.Factory<E> |
edgeFactory |
protected EdgeType |
edgeIsDirected |
protected VisualizationServer.Paintable |
edgePaintable |
protected Shape |
edgeShape |
protected Shape |
rawArrowShape |
protected CubicCurve2D |
rawEdge |
protected V |
startVertex |
protected org.apache.commons.collections4.Factory<V> |
vertexFactory |
cursor, modifiers| Constructor and Description |
|---|
EditingGraphMousePlugin(org.apache.commons.collections4.Factory<V> vertexFactory,
org.apache.commons.collections4.Factory<E> edgeFactory) |
EditingGraphMousePlugin(int modifiers,
org.apache.commons.collections4.Factory<V> vertexFactory,
org.apache.commons.collections4.Factory<E> edgeFactory)
create instance and prepare shapes for visual effects
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkModifiers(MouseEvent e)
Overridden to be more flexible, and pass events with
key combinations.
|
void |
mouseClicked(MouseEvent e) |
void |
mouseDragged(MouseEvent e)
If startVertex is non-null, stretch an edge shape between
startVertex and the mouse pointer to simulate edge creation
|
void |
mouseEntered(MouseEvent e) |
void |
mouseExited(MouseEvent e) |
void |
mouseMoved(MouseEvent e) |
void |
mousePressed(MouseEvent e)
If the mouse is pressed in an empty area, create a new vertex there.
|
void |
mouseReleased(MouseEvent e)
If startVertex is non-null, and the mouse is released over an
existing vertex, create an undirected edge from startVertex to
the vertex under the mouse pointer.
|
getCursor, getModifiers, setCursor, setModifiersprotected V startVertex
protected Point2D down
protected CubicCurve2D rawEdge
protected Shape edgeShape
protected Shape rawArrowShape
protected Shape arrowShape
protected VisualizationServer.Paintable edgePaintable
protected VisualizationServer.Paintable arrowPaintable
protected EdgeType edgeIsDirected
protected org.apache.commons.collections4.Factory<V> vertexFactory
protected org.apache.commons.collections4.Factory<E> edgeFactory
public EditingGraphMousePlugin(org.apache.commons.collections4.Factory<V> vertexFactory, org.apache.commons.collections4.Factory<E> edgeFactory)
public boolean checkModifiers(MouseEvent e)
checkModifiers in interface GraphMousePlugincheckModifiers in class AbstractGraphMousePlugine - an event to compare topublic void mousePressed(MouseEvent e)
mousePressed in interface MouseListenerpublic void mouseReleased(MouseEvent e)
mouseReleased in interface MouseListenerpublic void mouseDragged(MouseEvent e)
mouseDragged in interface MouseMotionListenerpublic void mouseClicked(MouseEvent e)
mouseClicked in interface MouseListenerpublic void mouseEntered(MouseEvent e)
mouseEntered in interface MouseListenerpublic void mouseExited(MouseEvent e)
mouseExited in interface MouseListenerpublic void mouseMoved(MouseEvent e)
mouseMoved in interface MouseMotionListenerCopyright © 2015. All rights reserved.