public interface IEdgeLayout
IEdgeLayout
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.
Modifier and Type | Method and Description |
---|---|
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()
Gets the relative coordinates of the first end point of this layout.
|
YPoint |
getTargetPoint()
Gets 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 value)
Sets the relative coordinates of the first end point of this layout.
|
void |
setTargetPoint(YPoint value)
Sets the relative coordinates of the second end point of this layout.
|
void 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 IEdgeLayout
still keeps the source point
and the
target point
.
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 sequencesetPoint(int, double, double)
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
INodeLayout
.
LayoutGraph.getCenterX(com.yworks.yfiles.algorithms.Node)
,
LayoutGraph.getCenterY(com.yworks.yfiles.algorithms.Node)
,
INodeLayout.getX()
,
INodeLayout.getY()
,
setSourcePoint(YPoint)
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
INodeLayout
.
LayoutGraph.getCenterX(com.yworks.yfiles.algorithms.Node)
,
LayoutGraph.getCenterY(com.yworks.yfiles.algorithms.Node)
,
INodeLayout.getX()
,
INodeLayout.getY()
,
setTargetPoint(YPoint)
int pointCount()
The source and target points are not included in the point count.
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 setSourcePoint(YPoint value)
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
INodeLayout
.
value
- the relative coordinates of the source pointLayoutGraph.getCenterX(com.yworks.yfiles.algorithms.Node)
,
LayoutGraph.getCenterY(com.yworks.yfiles.algorithms.Node)
,
INodeLayout.getX()
,
INodeLayout.getY()
,
getSourcePoint()
void setTargetPoint(YPoint value)
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
INodeLayout
.
value
- the relative coordinates of the target pointLayoutGraph.getCenterX(com.yworks.yfiles.algorithms.Node)
,
LayoutGraph.getCenterY(com.yworks.yfiles.algorithms.Node)
,
INodeLayout.getX()
,
INodeLayout.getY()
,
getTargetPoint()