|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.layout.router.CurveEdgeLayoutDescriptor
public class CurveEdgeLayoutDescriptor
This class is used by CurveRoutingStage
to provide routing details for the edges of the graph.
A CurveEdgeLayoutDescriptor
instance can be specified individually for single edges using a
DataProvider
that returns an CurveEdgeLayoutDescriptor
instance for each edge of the graph,
or null
if no CurveEdgeLayoutDescriptor
is bound to an edge. The DataProvider
is
registered with the graph using key CurveRoutingStage.CURVE_EDGE_LAYOUT_DESCRIPTOR_DPKEY
.
This class is designed such that it allows future additions of new getter methods.
CurveRoutingStage
,
CurveRoutingStage.CURVE_EDGE_LAYOUT_DESCRIPTOR_DPKEY
Constructor Summary | |
---|---|
CurveEdgeLayoutDescriptor()
|
Method Summary | |
---|---|
CurveEdgeLayoutDescriptor |
createCopy()
Creates a copy of this CurveEdgeLayoutDescriptor instance. |
double |
getCurveUTurnSymmetry()
Returns how symmetric u-turn parts of the curved routes should preferably be. |
double |
getMinimumEdgeToEdgeDistance()
Returns the minimum distance to segments belonging to other edges. |
double |
getMinimumFirstSegmentLength()
Returns the minimum length of the first segment of the edge path (at the source node). |
double |
getMinimumLastSegmentLength()
Returns the minimum length of the last segment of the edge path (at the target node). |
double |
getMinimumNodeToEdgeDistance()
Returns the minimum distance to nodes. |
byte |
getSourceCurveConnectionStyle()
Returns the style which determines how curved edge paths connect at the source side of the edge. |
byte |
getTargetCurveConnectionStyle()
Returns the style which determines how curved edge paths connect at the target side of the edge. |
boolean |
isControlPointCreationEnabled()
Returns whether or not the points of the resulting edge path represent cubic bezier control points. |
boolean |
isCurveShortcutsAllowed()
Returns whether or not curved edges may shortcut and introduce additional edge crossings if that makes the curves more direct and smoother. |
void |
setControlPointCreationEnabled(boolean controlPointCreation)
Specifies whether or not the points of the resulting edge path represent cubic bezier control points. |
void |
setCurveShortcutsAllowed(boolean curveShortcutsAllowed)
Specifies whether or not curved edges may shortcut and introduce additional edge crossings if that makes the curves more direct and smoother. |
void |
setCurveUTurnSymmetry(double curveUTurnSymmetry)
Specifies how symmetric u-turn parts of the curved routes should preferably be. |
void |
setMinimumEdgeToEdgeDistance(double distance)
Specifies the minimum distance to segments belonging to other edges. |
void |
setMinimumFirstSegmentLength(double length)
Specifies the minimum length of the first segment of the edge path (at the source node). |
void |
setMinimumLastSegmentLength(double length)
Specifies the minimum length of the last segment of the edge path (at the target node). |
void |
setMinimumNodeToEdgeDistance(double distance)
Specifies the minimum distance to nodes. |
void |
setSourceCurveConnectionStyle(byte curveConnectionStyle)
Specifies the style which determines how curved edge paths connect at the source side of the edge. |
void |
setTargetCurveConnectionStyle(byte curveConnectionStyle)
Specifies the style which determines how curved edge paths connect at the target side of the edge. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CurveEdgeLayoutDescriptor()
Method Detail |
---|
public double getMinimumFirstSegmentLength()
The minimum length must be greater than or equal to 0
.
halo
of the source node.CurveConnectionStyle.ORGANIC
.setMinimumFirstSegmentLength(double)
public void setMinimumFirstSegmentLength(double length)
The minimum length must be greater than or equal to 0
.
halo
of the source node.CurveConnectionStyle.ORGANIC
.length
- the minimum length of the first segment
java.lang.IllegalArgumentException
- if the minimum length of the first segment is negativeMinimum first segment length 5 | Minimum first segment length 30 |
public double getMinimumLastSegmentLength()
The minimum length must be greater than or equal to 0
.
If the minimum length is zero, the curved route may end with a non-orthogonal last segment such that
the port location provided by the core layout
may also be changed.
halo
of the target node.CurveConnectionStyle.ORGANIC
.setMinimumLastSegmentLength(double)
public void setMinimumLastSegmentLength(double length)
The minimum length must be greater than or equal to 0
.
If the minimum length is zero, the curved route may end with a non-orthogonal last segment such that
the port location provided by the core layout
may also be changed.
halo
of the target node.CurveConnectionStyle.ORGANIC
.length
- the minimum length of the last segment
java.lang.IllegalArgumentException
- if the minimum length of the last segment is negativeMinimum last segment length 10 | Minimum last segment length 30 |
public double getMinimumEdgeToEdgeDistance()
The minimum distance must be greater than or equal to 0
.
setMinimumEdgeToEdgeDistance(double)
public void setMinimumEdgeToEdgeDistance(double distance)
The minimum distance must be greater than or equal to 0
.
core layout algorithm
, it has no
effect on the curved routes, i.e. the curved route may also violate it.distance
- the minimum distance between this curved edge and other edges
java.lang.IllegalArgumentException
- if the minimum distance is negativepublic double getMinimumNodeToEdgeDistance()
The minimum distance must be greater than or equal to 0
.
core layout algorithm
, it has no
effect on the curved routes, i.e. the curved route may also violate it.setMinimumNodeToEdgeDistance(double)
public void setMinimumNodeToEdgeDistance(double distance)
The minimum distance must be greater than or equal to 0
.
core layout algorithm
, it has no
effect on the curved routes, i.e. the curved route may also violate it.distance
- the minimum distance between this curve edge and nodes
java.lang.IllegalArgumentException
- if the minimum distance is negativepublic boolean isControlPointCreationEnabled()
true
if the bends are interpreted as cubic bezier control points, false
otherwisesetControlPointCreationEnabled(boolean)
public void setControlPointCreationEnabled(boolean controlPointCreation)
controlPointCreation
- true
if the points of the edge path should represent cubic
bezier control points, false
otherwisepublic boolean isCurveShortcutsAllowed()
If enabled, curved edges may shortcut and cross additional edges. This can yield to a direct and possibly smoother curved route. Still, intersections with nodes, node labels and edge labels are not allowed. Note that it is not possible to precisely predict the impact of this setting for the general case.
symmetric u-turns
are preferred, enabling this property
may be beneficial. For example, creating a perfectly symmetric u-turn curve may require to cross an
additional edge.true
, if curved edges may shortcut and introduce additional edge crossings
in favor of more direct curves, false
, otherwisesetCurveShortcutsAllowed(boolean)
public void setCurveShortcutsAllowed(boolean curveShortcutsAllowed)
If enabled, curved edges may shortcut and cross additional edges. This can yield to a direct and possibly smoother curved route. Still, intersections with nodes, node labels and edge labels are not allowed. Note that it is not possible to precisely predict the impact of this setting for the general case.
symmetric u-turns
are preferred, enabling this property
may be beneficial. For example, creating a perfectly symmetric u-turn curve may require to cross an
additional edge.curveShortcutsAllowed
- true
, if curved edges may shortcut and introduce additional edge
crossings in favor of more direct curves, false
, otherwiseCurve shortcuts are disabled | Curve shortcuts are enabled |
public double getCurveUTurnSymmetry()
If this property is greater than zero
, the algorithm tries to achieve a more symmetric path for
180-degree turns (u-turns) by specifically handling them. Symmetric turns likely require more space compared
to more direct variants.
The value of this property must be within interval [0,1]
, where a higher value indicates
more emphasis on symmetry and lower values that symmetry is not important.
This setting influences the symmetry of a single curved route and does not affect symmetry of multiple curves in relation to each other.
0
might be perceived as being greater than the difference
between other values. The reason is that with 0
, u-turns are not handled specifically at all.[0,1]
, where a higher value means that symmetric turns are preferredsetCurveUTurnSymmetry(double)
public void setCurveUTurnSymmetry(double curveUTurnSymmetry)
If this property is greater than zero
, the algorithm tries to achieve a more symmetric path for
180-degree turns (u-turns) by specifically handling them. Symmetric turns likely require more space compared
to more direct variants.
The value of this property must be within interval [0,1]
, where a higher value indicates
more emphasis on symmetry and lower values that symmetry is not important.
This setting influences the symmetry of a single curved route and does not affect symmetry of multiple curves in relation to each other.
0
might be perceived as being greater than the difference
between other values. The reason is that with 0
, u-turns are not handled specifically at all.curveUTurnSymmetry
- the symmetry preference for u-turns of curved edges within interval
[0,1]
, where a higher value means that symmetric turns are preferred
java.lang.IllegalArgumentException
- if the given symmetry value is negative or larger than one0.0 | 0.7 | 1.0 |
public byte getSourceCurveConnectionStyle()
setTargetCurveConnectionStyle(byte)
,
setSourceCurveConnectionStyle(byte)
,
CurveConnectionStyle.KEEP_PORT
,
CurveConnectionStyle.ORGANIC
public void setSourceCurveConnectionStyle(byte curveConnectionStyle)
CurveConnectionStyle.KEEP_PORT
. The source port and the first segment is kept.curveConnectionStyle
- one of the predefined curve connection styles
java.lang.IllegalArgumentException
- if an unknown connection style is givenCurveConnectionStyle.KEEP_PORT
,
CurveConnectionStyle.ORGANIC
,
setTargetCurveConnectionStyle(byte)
public byte getTargetCurveConnectionStyle()
setSourceCurveConnectionStyle(byte)
,
setTargetCurveConnectionStyle(byte)
,
CurveConnectionStyle.KEEP_PORT
,
CurveConnectionStyle.ORGANIC
public void setTargetCurveConnectionStyle(byte curveConnectionStyle)
CurveConnectionStyle.KEEP_PORT
. The target port and the last segment is kept.curveConnectionStyle
- one of the predefined curve connection styles
java.lang.IllegalArgumentException
- if an unknown connection style is givenCurveConnectionStyle.KEEP_PORT
,
CurveConnectionStyle.ORGANIC
,
setSourceCurveConnectionStyle(byte)
public CurveEdgeLayoutDescriptor createCopy()
CurveEdgeLayoutDescriptor
instance.
CurveEdgeLayoutDescriptor
instance
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |