|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.view.ViewMode
y.view.EditMode
public class EditMode
This view mode is the default edit mode for a Graph2DView. With this mode it is possible to
This complex mode makes use of other minor modes that have specialized responsibilities.
It is possible to exchange these minor modes by customized versions.
Optionally, this mode and its associated minor modes provide special support
for maintaining orthogonal edge paths.
See ORTHOGONAL_ROUTING_DPKEY, isOrthogonalRouting(y.base.Edge),
and setOrthogonalEdgeRouting(boolean).
| Field Summary | |
|---|---|
protected ViewMode |
createEdgeMode
The minor create edge mode associated with this mode. |
protected ViewMode |
editNodeMode
The minor edit node mode associated with this mode. |
protected ViewMode |
hotSpotMode
Child mode HotSpotMode |
protected MouseInputMode |
mouseInputMode
The minor mouse input mode associated with this mode. |
protected ViewMode |
moveLabelMode
The minor move label mode associated with this mode. |
protected ViewMode |
movePortMode
The minor move port mode associated with this mode. |
protected ViewMode |
moveSelectionMode
The minor move selection mode associated with this mode. |
protected ViewMode |
moveViewPortMode
The minor move viewport mode associated with this mode. |
static Object |
ORTHOGONAL_ROUTING_DPKEY
A DataProvider that can be registered with the graph to determine whether an edge should be routed orthogonally. |
protected ViewMode |
popupMode
The minor popup mode associated with this mode |
protected Node |
pressedNode
Will be set when the mouse was pressed over a node. |
protected ViewMode |
selectionBoxMode
The minor selection box mode associated with this mode. |
| Fields inherited from class y.view.ViewMode |
|---|
ACTIVE_PROPERTY, ACTIVE_VIEW_PROPERTY, CHILD_MODE_PROPERTY, EDITING_PROPERTY, GRAB_FOCUS_ENABLED_PROPERTY, lastClickEvent, lastDragEvent, lastMoveEvent, lastPressEvent, lastReleaseEvent, MODIFIER_MASK_PROPERTY, NAME_PROPERTY, originalX, originalY, PARENT_MODE_PROPERTY, view |
| Constructor Summary | |
|---|---|
EditMode()
Instantiates a new EditMode |
|
EditMode(ViewContainer vc)
Instantiates a new EditMode for a given ViewContainer |
|
| Method Summary | |
|---|---|
void |
activate(boolean activate)
Invoked when the Mode is activated/deactivated from the ViewControl or via the setChild() and reactivateParent operations This behaves like a bound property using ViewMode.ACTIVE_PROPERTY as the property name. |
void |
allowBendCreation(boolean b)
Allows or disallows bend creation. |
void |
allowEdgeCreation(boolean b)
Allows or disallows edge creation. |
void |
allowLabelSelection(boolean b)
Allows or disallows selecting labels by clicking on them. |
void |
allowMouseInput(boolean b)
Allows or disallows the delegation of events to a MouseInputMode. |
void |
allowMoveLabels(boolean b)
Allows or disallows moving around labels in the displayed graph. |
void |
allowMovePorts(boolean b)
Allows or disallows moving around ports in the displayed graph. |
void |
allowMoveSelection(boolean b)
Allows or disallows moving around the selected features of the displayed graph. |
void |
allowMoving(boolean b)
Allows or disallows moving the viewport of the view via the right mouse button. |
void |
allowNodeCreation(boolean b)
Allows or disallows node creation. |
void |
allowNodeEditing(boolean b)
Allows or disallows node editing. |
void |
allowResizeNodes(boolean b)
Allows or disallows resizing of nodes by dragging at the selection hotspots. |
void |
assignNodeLabel(boolean b)
Determines whether to assign a generic node label for newly created nodes. |
protected void |
bendClicked(Graph2D graph,
Bend bend,
boolean wasSelected,
double x,
double y,
boolean modifierSet)
Callback called by both mouseReleasedLeft(double, double) and
mouseShiftReleasedLeft(double, double) when a Bend has been
clicked. |
protected void |
bendCreated(Graph2D graph,
Edge edge,
Bend bend,
double x,
double y)
This method gets called after a new bend has been created by this mode. |
protected Bend |
createBend(Graph2D graph,
Edge edge,
double x,
double y)
Callback called by mouseDraggedLeft(double, double) when
a bend should be created. |
protected ViewMode |
createCreateEdgeMode()
Factory method, which creates the CreateEdgeMode. |
protected ViewMode |
createEditNodeMode()
Factory method, which can create the minor mode that is responsible for node editing. |
protected ViewMode |
createHotSpotMode()
Factory method, which creates the HotSpotMode. |
protected MouseInputMode |
createMouseInputMode()
Factory method, which creates the MouseInputMode. |
protected ViewMode |
createMoveLabelMode()
Factory method, which creates the MoveLabelMode. |
protected ViewMode |
createMovePortMode()
Factory method, which creates the MovePortMode. |
protected ViewMode |
createMoveSelectionMode()
Factory method, which creates the MoveSelectionMode. |
protected ViewMode |
createMoveViewPortMode()
Factory method, which creates the MoveViewPortMode. |
protected Node |
createNode(Graph2D graph,
double x,
double y)
Callback called by paperClicked(Graph2D, double, double, boolean) when
a node should be created. |
protected ViewMode |
createOrthogonalMoveBendsMode()
Factory method that creates an OrthogonalMoveBendsMode. |
protected ViewMode |
createPopupMode()
Factory method, which can create the PopupMode. |
protected ViewMode |
createSelectionBoxMode()
Factory method, which creates the SelectionBoxMode. |
boolean |
doAllowBendCreation()
Returns true iff the creation of bends should be allowed. |
boolean |
doAllowEdgeCreation()
Returns true iff the creation of edges should be allowed. |
boolean |
doAllowLabelSelection()
Returns true iff the selection of labels via mouse clicks
should be allowed. |
boolean |
doAllowMouseInput()
Returns true iff events will be handled by a MouseInputMode first. |
boolean |
doAllowMoveLabels()
Returns true iff the moving of labels should be allowed. |
boolean |
doAllowMovePorts()
Returns true iff the moving of ports should be allowed. |
boolean |
doAllowMoveSelection()
Whether or not to allow moving around the selected features of the displayed graph. |
boolean |
doAllowMoving()
Whether or not to allow moving the viewport of the view via right mouse drag action. |
boolean |
doAllowNodeCreation()
Returns true iff the creation of nodes should be allowed. |
boolean |
doAllowNodeEditing()
Returns true iff the editing of nodes should be allowed. |
boolean |
doAllowResizeNodes()
Whether or not to allow resizing of nodes by dragging at the selection hotspots. |
boolean |
doShowEdgeTips()
Returns true if this mode should display
tip text for an edge. |
boolean |
doShowNodeTips()
Returns true if this mode should display
tip text for a node. |
protected void |
edgeClicked(Graph2D graph,
Edge edge,
boolean wasSelected,
double x,
double y,
boolean modifierSet)
Callback called by both mouseReleasedLeft(double, double) and
mouseShiftReleasedLeft(double, double) when an Edge has been
clicked. |
protected boolean |
editNode(Node hitNode,
EventObject e)
Tries to start editing the given Node using the current editNodeMode. |
ViewMode |
getCreateEdgeMode()
Returns the minor create edge mode associated with this mode. |
Cursor |
getDefaultCursor()
Returns the default cursor displayed by this mode if no other cursor can be found. |
protected String |
getEdgeTip(Edge e)
Returns the tip text displayed for the given edge. |
ViewMode |
getEditNodeMode()
Returns the minor mode for node editing associated with this mode |
ViewMode |
getHotSpotMode()
Getter for child mode HotSpotMode. |
MouseInputMode |
getMouseInputMode()
Returns the minor mode for delegating mouse input, i.e., mouse events, to. |
ViewMode |
getMoveLabelMode()
Getter for child mode MoveLabelMode. |
ViewMode |
getMovePortMode()
Getter for child mode MovePortMode. |
ViewMode |
getMoveSelectionMode()
Returns the minor move selection mode associated with this mode. |
ViewMode |
getMoveViewPortMode()
Getter for child mode MoveViewPortMode. |
protected String |
getNodeTip(Node v)
Returns the tip text displayed for the given node. |
ViewMode |
getOrthogonalMoveBendsMode()
Getter for child mode OrthogonalMoveBendsMode. |
ViewMode |
getPopupMode()
Returns the minor popup mode associated with this mode |
ViewMode |
getSelectionBoxMode()
Returns the minor selection box mode associated with this mode. |
boolean |
isAdjustScrollBarPolicy()
Returns true if the scroll bars in Graph2DView will be shown (if needed) when this mode is activated (default). |
protected boolean |
isCreateEdgeGesture(MouseEvent lastPress,
MouseEvent lastDrag)
Determines whether the last press and drag initiates a create edge gesture. |
protected boolean |
isEditNodeGesture(Node hitNode,
MouseEvent lastPressEvent,
MouseEvent lastReleaseEvent,
MouseEvent lastClickEvent)
Determines if the given gesture is considered a gesture to start node editing. |
boolean |
isMixedSelectionEnabled()
Returns whether this instance allows mixed selections (node/bend selections and edge selections). |
boolean |
isOrthogonalEdgeRouting()
Returns whether special support for orthogonal edge paths is enabled for all edges. |
protected boolean |
isOrthogonalRouting(Edge edge)
Callback that determines whether an edge should be treated as an orthogonally routed edge. |
protected void |
labelClicked(Graph2D graph,
YLabel label,
boolean wasSelected,
double x,
double y,
boolean modifierSet)
Callback called by both mouseReleasedLeft(double, double) and
mouseShiftReleasedLeft(double, double) when a YLabel has been
clicked. |
protected void |
labelClicked(YLabel label)
This method gets called after a left mouse click on a label occurred. |
void |
mouseClicked(double x,
double y)
Called when the mouse was clicked |
void |
mouseDraggedLeft(double x,
double y)
Activates a minor mode. |
void |
mouseMoved(double x,
double y)
When moving the mouse, the mouse cursor has to be adjusted. |
void |
mousePressed(MouseEvent e)
A mouse button gets pressed. |
void |
mousePressedLeft(double x,
double y)
Takes the given coordinate and performs with it a hit test on all graph elements. |
void |
mousePressedRight(double x,
double y)
If a popup mode is associates with this mode then it will be activated. |
void |
mouseReleasedLeft(double x,
double y)
Depending on the history, actions are triggered, but only if Mouse was not moved since the button was pressed. |
void |
mouseShiftPressedLeft(double x,
double y)
Takes the given coordinate and performs with it a hit test on all graph elements. |
void |
mouseShiftReleasedLeft(double x,
double y)
Depending on the history, actions are triggered, but only if Mouse was not moved since the button was pressed. |
protected void |
nodeClicked(Graph2D graph,
Node node,
boolean wasSelected,
double x,
double y,
boolean modifierSet)
Callback called by both mouseReleasedLeft(double, double) and
mouseShiftReleasedLeft(double, double) when a Node has been
clicked. |
protected void |
nodeClicked(Node v)
This method gets called after a left mouse click on a node occurred. |
protected void |
nodeCreated(Node v)
This method gets called after a new node was completely created by this mode. |
protected void |
paperClicked(Graph2D graph,
double x,
double y,
boolean modifierSet)
Callback called by both mouseReleasedLeft(double, double) and
mouseShiftReleasedLeft(double, double) when a the canvas has been
clicked. |
protected void |
prepareView(Graph2DView view)
Callback called by activate(true) to initialize the view. |
void |
setAdjustScrollBarPolicy(boolean adjustScrollBarPolicy)
Whether the scroll bars will be shown (if needed) when this mode is activated. |
void |
setCreateEdgeMode(ViewMode mode)
Sets the minor create edge mode associated with this mode. |
void |
setDefaultCursor(Cursor defaultCursor)
Sets the default cursor displayed by this mode if no other cursor is determined. |
void |
setEditNodeMode(ViewMode mode)
Sets the minor mode for node editing associated with this mode. |
void |
setHotSpotMode(ViewMode hotSpotMode)
Setter for child mode HotSpotMode. |
void |
setMixedSelectionEnabled(boolean enable)
Allows or disallows mixed selections (node/bend selections and edge selections) to exist at the same time. |
void |
setMouseInputMode(MouseInputMode mode)
Sets the minor mouse input mode associated with this mode. |
void |
setMoveLabelMode(ViewMode moveLabelMode)
Setter for child mode MoveLabelMode. |
void |
setMovePortMode(ViewMode movePortMode)
Setter for child mode MovePortMode. |
void |
setMoveSelectionMode(ViewMode mode)
Sets the minor move selection mode associated with this mode. |
void |
setMoveViewPortMode(ViewMode moveViewPortMode)
Setter for child mode MovePortMode. |
void |
setOrthogonalEdgeRouting(boolean enable)
Sets whether special support for orthogonal edge paths should be enabled for all edges. |
void |
setOrthogonalMoveBendsMode(ViewMode orthogonalMoveBendMode)
Setter for child mode OrthogonalMoveBendsMode. |
void |
setPopupMode(ViewMode mode)
Sets the minor popup mode associated with this mode. |
void |
setSelectionBoxMode(ViewMode mode)
Sets the minor selection box mode associated with this mode. |
void |
showEdgeTips(boolean b)
If set to true this mode will show a tip
displaying whatever is returned by
getEdgeTip(Edge e). |
void |
showNodeTips(boolean b)
If set to true this mode will show a tip
displaying whatever is returned by getNodeTip(Node v). |
boolean |
startEditor(MouseInputEditor editor)
Tries to start the given MouseInputEditor if mouse input is currently allowed and the corresponding MouseInputMode is available. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Node pressedNode
protected ViewMode popupMode
protected ViewMode hotSpotMode
protected ViewMode selectionBoxMode
protected ViewMode createEdgeMode
protected ViewMode moveSelectionMode
protected ViewMode moveLabelMode
protected ViewMode movePortMode
protected ViewMode editNodeMode
protected ViewMode moveViewPortMode
protected MouseInputMode mouseInputMode
public static final Object ORTHOGONAL_ROUTING_DPKEY
boolean
for each Edge object it is queried for.
Note that if no DataProvider is bound to the graph instance this mode will
automatically register one that delegates the request to isOrthogonalRouting(y.base.Edge).
isOrthogonalRouting(y.base.Edge)| Constructor Detail |
|---|
public EditMode(ViewContainer vc)
public EditMode()
| Method Detail |
|---|
public boolean isAdjustScrollBarPolicy()
true if the scroll bars in Graph2DView will be shown (if needed) when this mode is activated (default).
true if the scroll bars in Graph2DView will be shown when this mode is activated (default).public void setAdjustScrollBarPolicy(boolean adjustScrollBarPolicy)
adjustScrollBarPolicy - true if the scroll bars in Graph2DView should be shown (if needed) when this mode is activated (default).protected ViewMode createHotSpotMode()
protected MouseInputMode createMouseInputMode()
MouseInputMode.protected ViewMode createMovePortMode()
protected ViewMode createMoveViewPortMode()
protected ViewMode createMoveLabelMode()
protected ViewMode createMoveSelectionMode()
protected ViewMode createCreateEdgeMode()
protected ViewMode createSelectionBoxMode()
protected ViewMode createPopupMode()
nullprotected ViewMode createEditNodeMode()
nullpublic void activate(boolean activate)
ViewModeViewMode.ACTIVE_PROPERTY as the property name.
activate in class ViewModeactivate - set true when mode was activated
false otherwiseprotected void prepareView(Graph2DView view)
activate(true) to initialize the view.
This implementation sets the scrollbar policy and the cursor.
view - the view to initialize.public void setMixedSelectionEnabled(boolean enable)
true.
public boolean isMixedSelectionEnabled()
true.
public void setOrthogonalEdgeRouting(boolean enable)
false.
See ORTHOGONAL_ROUTING_DPKEY and isOrthogonalRouting(y.base.Edge)
for information on how to enable this special support for only a subset of
edges.
enable - true if all edges should be treated as being orthogonal.isOrthogonalEdgeRouting()public boolean isOrthogonalEdgeRouting()
false.
setOrthogonalEdgeRouting(boolean)public void assignNodeLabel(boolean b)
true.
public void allowNodeCreation(boolean b)
public void allowNodeEditing(boolean b)
public void allowEdgeCreation(boolean b)
public void allowBendCreation(boolean b)
public void allowMoveSelection(boolean b)
public void allowMoveLabels(boolean b)
public void allowMovePorts(boolean b)
public void allowLabelSelection(boolean b)
true.
doAllowLabelSelection()public void allowMoving(boolean b)
public void allowResizeNodes(boolean b)
public void allowMouseInput(boolean b)
public boolean doAllowNodeCreation()
true iff the creation of nodes should be allowed.
This mode will act according to the return value of this method.
public boolean doAllowNodeEditing()
true iff the editing of nodes should be allowed.
This mode will act according to the return value of this method.
public boolean doAllowEdgeCreation()
true iff the creation of edges should be allowed.
This mode will act according to the return value of this method.
public boolean doAllowBendCreation()
true iff the creation of bends should be allowed.
This mode will act according to the return value of this method.
public boolean doAllowLabelSelection()
true iff the selection of labels via mouse clicks
should be allowed.
This mode will act according to the return value of this method.
The default value is true.
allowLabelSelection(boolean)public boolean doAllowMoveLabels()
true iff the moving of labels should be allowed.
This mode will act according to the return value of this method.
public boolean doAllowMovePorts()
true iff the moving of ports should be allowed.
This mode will act according to the return value of this method.
public boolean doAllowMouseInput()
true iff events will be handled by a MouseInputMode first.
This mode will act according to the return value of this method.
public boolean doAllowMoveSelection()
public boolean doAllowMoving()
public boolean doAllowResizeNodes()
public void showNodeTips(boolean b)
true this mode will show a tip
displaying whatever is returned by getNodeTip(Node v).
public boolean doShowNodeTips()
true if this mode should display
tip text for a node.
public void showEdgeTips(boolean b)
true this mode will show a tip
displaying whatever is returned by
getEdgeTip(Edge e).
public boolean doShowEdgeTips()
true if this mode should display
tip text for an edge.
public ViewMode getEditNodeMode()
public void setEditNodeMode(ViewMode mode)
public ViewMode getPopupMode()
public void setPopupMode(ViewMode mode)
public ViewMode getMoveSelectionMode()
public void setMoveSelectionMode(ViewMode mode)
public MouseInputMode getMouseInputMode()
public void setMouseInputMode(MouseInputMode mode)
public ViewMode getCreateEdgeMode()
public void setCreateEdgeMode(ViewMode mode)
public ViewMode getSelectionBoxMode()
public void setSelectionBoxMode(ViewMode mode)
public void mousePressedLeft(double x,
double y)
mousePressedLeft in class ViewModex - the x-coordinate of the mouse event in world coordinates.y - the y-coordinate of the mouse event in world coordinates.
public void mouseShiftPressedLeft(double x,
double y)
mouseShiftPressedLeft in class ViewModex - the x-coordinate of the mouse event in world coordinates.y - the y-coordinate of the mouse event in world coordinates.
public void mouseReleasedLeft(double x,
double y)
mouseReleasedLeft in class ViewModex - the x-coordinate of the mouse event in world coordinates.y - the y-coordinate of the mouse event in world coordinates.
protected void labelClicked(Graph2D graph,
YLabel label,
boolean wasSelected,
double x,
double y,
boolean modifierSet)
mouseReleasedLeft(double, double) and
mouseShiftReleasedLeft(double, double) when a YLabel has been
clicked. This method implements the default operations of EditMode that
are performed when a label has been clicked.
graph - the graph the node resides inlabel - the label which has been clickedwasSelected - whether the element is already selectedx - the x coordinate where the mouse was clickedy - the y coordinate where the mouse was clickedmodifierSet - true if the caller is mouseShiftReleasedLeft(double, double),
false otherwiseprotected void labelClicked(YLabel label)
public void mouseShiftReleasedLeft(double x,
double y)
mouseShiftReleasedLeft in class ViewModex - the x-coordinate of the mouse event in world coordinates.y - the y-coordinate of the mouse event in world coordinates.
protected void nodeClicked(Graph2D graph,
Node node,
boolean wasSelected,
double x,
double y,
boolean modifierSet)
mouseReleasedLeft(double, double) and
mouseShiftReleasedLeft(double, double) when a Node has been
clicked. This method implements the default operations of EditMode that
are performed when a node has been clicked.
graph - the graph the node resides innode - the node which has been clickedwasSelected - whether the element is already selectedx - the x coordinate where the mouse was clickedy - the y coordinate where the mouse was clickedmodifierSet - true if the caller is mouseShiftReleasedLeft(double, double),
false otherwise
protected void bendClicked(Graph2D graph,
Bend bend,
boolean wasSelected,
double x,
double y,
boolean modifierSet)
mouseReleasedLeft(double, double) and
mouseShiftReleasedLeft(double, double) when a Bend has been
clicked. This method implements the default operations of EditMode that
are performed when a bend has been clicked.
graph - the graph the bend resides inbend - the bend which has been clickedwasSelected - whether the element is already selectedx - the x coordinate where the mouse was clickedy - the y coordinate where the mouse was clickedmodifierSet - true if the caller is mouseShiftReleasedLeft(double, double),
false otherwise
protected void edgeClicked(Graph2D graph,
Edge edge,
boolean wasSelected,
double x,
double y,
boolean modifierSet)
mouseReleasedLeft(double, double) and
mouseShiftReleasedLeft(double, double) when an Edge has been
clicked. This method implements the default operations of EditMode that
are performed when a edge has been clicked.
graph - the graph the edge resides inedge - the edge which has been clickedwasSelected - whether the element is already selectedx - the x coordinate where the mouse was clickedy - the y coordinate where the mouse was clickedmodifierSet - true if the caller is mouseShiftReleasedLeft(double, double),
false otherwise
protected void paperClicked(Graph2D graph,
double x,
double y,
boolean modifierSet)
mouseReleasedLeft(double, double) and
mouseShiftReleasedLeft(double, double) when a the canvas has been
clicked. This method implements the default operations of EditMode that
are performed when nothing is clicked.
By default this method calls createNode(Graph2D, double, double) when
node creation is allowed and nothing is currently selected.
graph - the graph which resides in the canvasx - the x coordinate where the mouse was clickedy - the y coordinate where the mouse was clickedmodifierSet - true if the caller is mouseShiftReleasedLeft(double, double),
false otherwisepublic void mousePressed(MouseEvent e)
ViewMode
mousePressed in interface MouseListenermousePressed in class ViewMode
public void mouseDraggedLeft(double x,
double y)
mouseDraggedLeft in class ViewModex - the x-coordinate of the mouse event in world coordinates.y - the y-coordinate of the mouse event in world coordinates.protected boolean isOrthogonalRouting(Edge edge)
edge - the edge to determine the attribute for
true if the edge should be routed orthogonallyORTHOGONAL_ROUTING_DPKEY,
OrthogonalMoveBendsMode,
HotSpotMode.isOrthogonalRouting(y.base.Edge),
MoveSelectionMode.isOrthogonalRouting(y.base.Edge),
MovePortMode.isOrthogonalRouting(y.base.Edge),
CreateEdgeMode.setOrthogonalEdgeCreation(boolean)
protected Bend createBend(Graph2D graph,
Edge edge,
double x,
double y)
mouseDraggedLeft(double, double) when
a bend should be created. This method implements the default bend creation
code of EditMode: graph.getRealizer(edge).insertBend(x,y)
graph - the graph which resided in the canvasedge - the edge to create the bend onx - the x coordinate where the mouse was draggedy - the y coordinate where the mouse was dragged
null if no bend should be created
protected Node createNode(Graph2D graph,
double x,
double y)
paperClicked(Graph2D, double, double, boolean) when
a node should be created. This method implements the default node creation
code of EditMode.
graph - the graph which resided in the canvasx - the x coordinate where the mouse was clickedy - the y coordinate where the mouse was clicked
null if no node should be created
public void mousePressedRight(double x,
double y)
mousePressedRight in class ViewModex - the x-coordinate of the mouse event in world coordinates.y - the y-coordinate of the mouse event in world coordinates.
public void mouseMoved(double x,
double y)
mouseMoved in class ViewModex - the x-coordinate of the mouse event in world coordinates.y - the y-coordinate of the mouse event in world coordinates.
public void mouseClicked(double x,
double y)
ViewMode
mouseClicked in class ViewModex - the x-coordinate of the mouse event in world coordinates.y - the y-coordinate of the mouse event in world coordinates.public boolean startEditor(MouseInputEditor editor)
editor - the editor to start
doAllowMouseInput(),
setMouseInputMode(MouseInputMode)protected String getNodeTip(Node v)
showNodeTips.
By default the label text of the node will be returned.
Subclasses may want to overwrite this behavior.
protected String getEdgeTip(Edge e)
showEdgeTips.
By default the first label text of the edge will be returned.
Subclasses may want to overwrite this behavior.
protected void nodeCreated(Node v)
protected void bendCreated(Graph2D graph,
Edge edge,
Bend bend,
double x,
double y)
protected void nodeClicked(Node v)
public ViewMode getMoveViewPortMode()
MoveViewPortMode. This mode gets activated when the user
right-drags with the mouse if there is no popup mode
public ViewMode getMoveLabelMode()
public void setMoveViewPortMode(ViewMode moveViewPortMode)
MovePortMode is set.
moveViewPortMode - the new modepublic void setMoveLabelMode(ViewMode moveLabelMode)
MoveLabelMode
is set.
moveLabelMode - New value of property moveLabelMode.public ViewMode getMovePortMode()
public void setMovePortMode(ViewMode movePortMode)
MovePortMode is set.
movePortMode - New value of property movePortMode.public ViewMode getHotSpotMode()
public void setHotSpotMode(ViewMode hotSpotMode)
HotSpotMode is set.
protected boolean isCreateEdgeGesture(MouseEvent lastPress,
MouseEvent lastDrag)
lastPress - the last press eventlastDrag - the last drag event
protected boolean isEditNodeGesture(Node hitNode,
MouseEvent lastPressEvent,
MouseEvent lastReleaseEvent,
MouseEvent lastClickEvent)
true if the clickCount
of lastClickEvent is 2.
hitNode - the node that was hitlastPressEvent - the last mouse pressed eventlastReleaseEvent - the last mouse released eventlastClickEvent - the last mouse clicked event
public Cursor getDefaultCursor()
public void setDefaultCursor(Cursor defaultCursor)
defaultCursor - the cursor to use by default
protected boolean editNode(Node hitNode,
EventObject e)
editNodeMode.
If the current editNodeMode is a CellEditorMode, this method asks
the mode whether the node is editable and
then invokes CellEditorMode.editNode(y.base.Node, java.util.EventObject).
hitNode - the node that has been hit and should be editede - the event object that can be used to trigger the editing, may be null
public ViewMode getOrthogonalMoveBendsMode()