|
Search this API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.view.ViewMode
y.view.MoveNodePortMode
public class MoveNodePortMode
This view mode allows interactive reassignment of node port positions.
A node port can be moved to another position by pressing with the left mouse
button and dragging the node port around.
The movement is restricted by the PortLocationModel of the
dragged node port.
![]() |
![]() |
| Field Summary | |
|---|---|
protected NodePort |
port
The node port that is being moved. |
| 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 | |
|---|---|
MoveNodePortMode()
Initializes a new MoveNodePortMode instance. |
|
MoveNodePortMode(ViewContainer vc)
Initializes a new MoveNodePortMode instance. |
|
| Method Summary | |
|---|---|
protected YPoint |
adjustCoordinates(double x,
double y)
Determines the best-match location for the port location model of the currently moved node port. |
protected YPoint |
adjustCoordinates(NodePort port,
double x,
double y)
Determines the best-match location for the port location model of the currently moved node port. |
void |
cancelEditing()
This can be used to cleanly exit an edit that is currently in progress. |
protected HitInfo |
getHitInfo(double x,
double y)
Determines whether or not a node port is located at the specified coordinates. |
protected boolean |
isOrthogonalRouting(Edge edge)
Determines whether the given edge instance should be routed orthogonally. |
void |
mouseDraggedLeft(double x,
double y)
Moves the current node port to the specified location. |
void |
mousePressedLeft(double x,
double y)
Determines the node port that will be moved. |
void |
mouseReleasedLeft(double x,
double y)
Ends the movement of the current node port. |
protected void |
portMoved(NodePort port,
double x,
double y)
Invoked when the moved node port has been assigned its final position. |
protected void |
portWillBeMoved(NodePort port)
Invoked when the node port that will be moved is first determined. |
protected void |
updatePortPosition(double x,
double y)
Updates the position of the currently moved node port to the specified coordinates. |
protected void |
updatePortPosition(NodePort port,
double x,
double y)
Updates the position of the currently moved node port to the specified coordinates. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected NodePort port
| Constructor Detail |
|---|
public MoveNodePortMode()
MoveNodePortMode instance.
public MoveNodePortMode(ViewContainer vc)
MoveNodePortMode instance.
vc - the container that will provide the Graph2DView
for this MoveNodePortMode instance.| Method Detail |
|---|
protected boolean isOrthogonalRouting(Edge edge)
DataProvider bound to the
current graph via the EditMode.ORTHOGONAL_ROUTING_DPKEY
data provider key to determine whether the given edge should be routed
orthogonally.
edge - the edge to check.
true if the edge should be routed orthogonally;
false otherwise.EditMode.isOrthogonalRouting(y.base.Edge)
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 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.
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.
public void cancelEditing()
throws java.lang.UnsupportedOperationException
ViewModesetEditing(false) if
ViewMode.isEditing() returns true
cancelEditing in class ViewModejava.lang.UnsupportedOperationException - if the editing cannot be canceled
for any reason.protected void portWillBeMoved(NodePort port)
port - the port that will be moved.
protected void portMoved(NodePort port,
double x,
double y)
port - the port that has been moved.x - the port's final, absolute x-coordinate.y - the port's final, absolute y-coordinate.
protected YPoint adjustCoordinates(double x,
double y)
adjustCoordinates(NodePort, double, double).
x - the x-coordinate of the location that should be matched as best as
possible.y - the y-coordinate of the location that should be matched as best as
possible.
protected YPoint adjustCoordinates(NodePort port,
double x,
double y)
port - the port that is moved.x - the x-coordinate of the location that should be matched as best as
possible.y - the y-coordinate of the location that should be matched as best as
possible.
protected void updatePortPosition(double x,
double y)
updatePortPosition(NodePort, double, double).
x - the x-coordinate of the node port's new position.y - the y-coordinate of the node port's new position.
protected void updatePortPosition(NodePort port,
double x,
double y)
port - the port that is moved.x - the x-coordinate of the node port's new position.y - the y-coordinate of the node port's new position.
protected HitInfo getHitInfo(double x,
double y)
getHitInfo in class ViewModex - x world coordinate.y - y world coordinate.
ViewMode.createHitInfo(double,double,boolean)
|
© Copyright 2000-2025, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||