|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface EdgeLayout
An EdgeLayout
encapsulates the layout information for an edge.
The layout information consists of the two end points of the edge layout and a sequence of control points that determine the visual path of the edge.
Method Summary | |
---|---|
void |
addPoint(double x,
double y)
Adds a control point to the end of the control point sequence. |
void |
clearPoints()
Removes all control points from this edge layout. |
YPoint |
getPoint(int index)
Returns the control point at the given position in the sequence of control points. |
YPoint |
getSourcePoint()
Returns the relative coordinates of the first end point of this layout. |
YPoint |
getTargetPoint()
Returns the relative coordinates of the second end point of this layout. |
int |
pointCount()
Returns the number of control points of the edge. |
void |
setPoint(int index,
double x,
double y)
Sets the absolute coordinates of the control point at the given position in the sequence of control points. |
void |
setSourcePoint(YPoint point)
Sets the relative coordinates of the first end point of this layout. |
void |
setTargetPoint(YPoint point)
Sets the relative coordinates of the second end point of this layout. |
Method Detail |
---|
int pointCount()
The source and target points are not included in the point count.
YPoint getPoint(int index)
The first control point in the sequence has index 0
and the last control point has index
pointCount()
-1
.
index
- the position of the control point in the control point sequence
setPoint(int, double, double)
void setPoint(int index, double x, double y)
The first control point in the sequence has index 0
and the last control point has index
pointCount()
-1
.
index
- the position of the changing control point in the sequencex
- the new absolute x-coordinate of the control point at the given indexy
- the new absolute y-coordinate of the control point at the given indexvoid addPoint(double x, double y)
x
- the absolute x-coordinate of the new control pointy
- the absolute y-coordinate of the new control pointvoid clearPoints()
The EdgeLayout
still keeps the source point
and the
target point
.
YPoint getSourcePoint()
These coordinates are relative to the center location of the edge's
source node. To obtain the absolute coordinates of the end point, the
relative coordinates have to be added to the center coordinates of the
source NodeLayout
.
LayoutGraph.getCenterX(y.base.Node)
,
LayoutGraph.getCenterY(y.base.Node)
,
NodeLayout.getX()
,
NodeLayout.getY()
YPoint getTargetPoint()
These coordinates are relative to the center location of the edge's
target node. To obtain the absolute coordinates of the end point, the
relative coordinates have to be added to the center coordinates of the
target NodeLayout
.
LayoutGraph.getCenterX(y.base.Node)
,
LayoutGraph.getCenterY(y.base.Node)
,
NodeLayout.getX()
,
NodeLayout.getY()
void setSourcePoint(YPoint point)
These coordinates are relative to the center location of the edge's
source node. To obtain the absolute coordinates of the end point, the
relative coordinates have to be added to the center coordinates of the
source NodeLayout
.
point
- the new relative coordinates of the source pointLayoutGraph.getCenterX(y.base.Node)
,
LayoutGraph.getCenterY(y.base.Node)
,
NodeLayout.getX()
,
NodeLayout.getY()
void setTargetPoint(YPoint point)
These coordinates are relative to the center location of the edge's
target node. To obtain the absolute coordinates of the end point, the
relative coordinates have to be added to the center coordinates of the
target NodeLayout
.
point
- the new relative coordinates of the target pointLayoutGraph.getCenterX(y.base.Node)
,
LayoutGraph.getCenterY(y.base.Node)
,
NodeLayout.getX()
,
NodeLayout.getY()
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |