|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--y.view.ViewMode | +--y.view.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 specialized versions.
Field Summary | |
protected ViewMode |
createEdgeMode
|
protected ViewMode |
hotSpotMode
|
protected ViewMode |
moveLabelMode
|
protected ViewMode |
movePortMode
|
protected ViewMode |
moveSelectionMode
|
protected ViewMode |
popupMode
Predefined Modes, which represent substates |
protected Node |
pressedNode
Will be set when the mouse was press over a node. |
protected ViewMode |
selectionBoxMode
|
Fields inherited from class y.view.ViewMode |
lastClickEvent, lastDragEvent, lastPressEvent, lastReleaseEvent, originalX, originalY, view |
Constructor Summary | |
EditMode()
Instantiates a new EditMode |
|
EditMode(ViewContainer vc)
Instantiates a new EditMode for a given ViewContainer |
Method Summary | |
void |
activate(boolean b)
Invoked when the Mode is activated/deactiveted from the ViewControl |
void |
allowBendCreation(boolean b)
Allows or disallows bend creation. |
void |
allowEdgeCreation(boolean b)
Allows or disallows edge creation. |
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 |
allowResizeNodes(boolean b)
Allows or disllows resizing of nodes by dragging at the selection hotspots. |
protected ViewMode |
createCreateEdgeMode()
Factory method, which creates the CreateEdgeMode. |
protected ViewMode |
createHotSpotMode()
Factory method, which creates the HotSpotMode. |
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 |
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 |
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 |
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. |
ViewMode |
getCreateEdgeMode()
Returns the minor create edge mode associated with this mode. |
protected String |
getEdgeTip(Edge e)
Returns the tip text displayed for the given edge. |
ViewMode |
getHotSpotMode()
Getter for child mode HotSpotMode. |
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. |
protected String |
getNodeTip(Node v)
Returns the tip text displayed for the given node. |
ViewMode |
getPopupMode()
Returns the minor popup mode associated with this mode |
ViewMode |
getSelectionBoxMode()
Returns the minor selection box mode associated with this mode. |
protected boolean |
isCreateEdgeGesture(MouseEvent lastPress,
MouseEvent lastDrag)
|
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 |
mousePressedLeft(double x,
double y)
Takes the given coordiante 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 actived. |
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 coordiante 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(Node v)
This method gets called after a left mouse click on a node occured. |
protected void |
nodeCreated(Node v)
This method gets called after a new node was completely created by this mode. |
void |
setCreateEdgeMode(ViewMode mode)
Sets the minor create edge mode associated with this mode. |
void |
setHotSpotMode(ViewMode hotSpotMode)
Setter for child mode HotSpotMode. |
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 |
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
EditMode.getEdgeTip(Edge e) . |
void |
showNodeTips(boolean b)
If set to true this mode will show a tip
displaying whatever is returned by EditMode.getNodeTip(Node v) . |
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
Constructor Detail |
public EditMode(ViewContainer vc)
public EditMode()
Method Detail |
protected ViewMode createHotSpotMode()
protected ViewMode createMovePortMode()
protected ViewMode createMoveLabelMode()
protected ViewMode createMoveSelectionMode()
protected ViewMode createCreateEdgeMode()
protected ViewMode createSelectionBoxMode()
protected ViewMode createPopupMode()
null
public void activate(boolean b)
ViewMode
activate
in class ViewMode
b
- set true
when mode should be activated
false
otherwisepublic void allowNodeCreation(boolean b)
public void allowEdgeCreation(boolean b)
public void allowBendCreation(boolean b)
public void allowMoveSelection(boolean b)
public void allowMoving(boolean b)
public void allowResizeNodes(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 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 doAllowMoveSelection()
public boolean doAllowMoving()
public boolean doAllowResizeNodes()
public void showNodeTips(boolean b)
true
this mode will show a tip
displaying whatever is returned by EditMode.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
EditMode.getEdgeTip(Edge e)
.
public boolean doShowEdgeTips()
true
if this mode should display
tip text for an edge.
public ViewMode getPopupMode()
public void setPopupMode(ViewMode mode)
public ViewMode getMoveSelectionMode()
public void setMoveSelectionMode(ViewMode 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 ViewMode
x
- 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 ViewMode
x
- 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 ViewMode
x
- the x-coordinate of the mouse event in world coordinates.y
- the y-coordinate of the mouse event in world coordinates.public void mouseShiftReleasedLeft(double x, double y)
mouseShiftReleasedLeft
in class ViewMode
x
- the x-coordinate of the mouse event in world coordinates.y
- the y-coordinate of the mouse event in world coordinates.public void mousePressedRight(double x, double y)
mousePressedRight
in class ViewMode
x
- the x-coordinate of the mouse event in world coordinates.y
- the y-coordinate of the mouse event in world coordinates.public void mouseDraggedLeft(double x, double y)
mouseDraggedLeft
in class ViewMode
x
- 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 ViewMode
x
- the x-coordinate of the mouse event in world coordinates.y
- the y-coordinate of the mouse event in world coordinates.protected String getNodeTip(Node v)
showNodeTips
.
By default the label text of the node will be returned. Subclasses may want to overwrite this behaviour.
protected String getEdgeTip(Edge e)
showEdgeTips
.
By default the first label text of the edge will be returned. Subclasses may want to overwrite this behaviour.
protected void nodeCreated(Node v)
protected void nodeClicked(Node v)
public ViewMode getMoveLabelMode()
public 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)
|
© Copyright 2000-2003, yWorks GmbH. All rights reserved. 2003 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |