public class EdgeLayoutDescriptor extends Object
HierarchicLayoutCore
during the various phases to provide routing details for the edges of
the graph.
An EdgeLayoutDescriptor
instance can be specified individually for single edges using a IDataProvider
that returns an EdgeLayoutDescriptor
instance for each edge of the graph, or null
if no EdgeLayoutDescriptor
is bound to an edge. The IDataProvider
is registered with the graph using key
HierarchicLayoutCore.EDGE_LAYOUT_DESCRIPTOR_DPKEY
.
This class is designed as a class to allow future additions of new getter methods.
HierarchicLayoutCore.EDGE_LAYOUT_DESCRIPTOR_DPKEY
,
NodeLayoutDescriptor
Constructor and Description |
---|
EdgeLayoutDescriptor()
Creates a new instance of an
EdgeLayoutDescriptor with the default values. |
Modifier and Type | Method and Description |
---|---|
EdgeLayoutDescriptor |
createCopy()
Creates a copy of this
EdgeLayoutDescriptor instance. |
double |
getMinimumDistance()
Gets the preferred minimum distance to obstacles.
|
double |
getMinimumFirstSegmentLength()
Gets the minimum length of the first segment of the edge path (at the source node).
|
double |
getMinimumLastSegmentLength()
Gets the minimum length of the last segment of the edge path (at the target node).
|
double |
getMinimumLength()
Gets the minimum length of an edge.
|
double |
getMinimumOctilinearSegmentLength()
Gets the minimum length of octilinear segments for this edge.
|
double |
getMinimumSlope()
Gets the minimum slope that the mid segments of this edge should have, if the edge is routed polyline in vertical
layouts.
|
RecursiveEdgeStyle |
getRecursiveEdgeStyle()
Gets how edges in grouped graphs are routed between the content of different groups.
|
RoutingStyle |
getRoutingStyle()
Gets the routing style for this edge.
|
boolean |
isDirectGroupContentEdgeRoutingEnabled()
Gets whether or not this edge is routed directly to a group node's border if it connects the group node with one of its
descendants.
|
boolean |
isSourcePortOptimization()
Gets whether or not source port optimization is enabled.
|
boolean |
isTargetPortOptimization()
Gets whether or not target port optimization is enabled.
|
void |
setDirectGroupContentEdgeRoutingEnabled(boolean value)
Sets whether or not this edge is routed directly to a group node's border if it connects the group node with one of its
descendants.
|
void |
setMinimumDistance(double value)
Sets the preferred minimum distance to obstacles.
|
void |
setMinimumFirstSegmentLength(double value)
Sets the minimum length of the first segment of the edge path (at the source node).
|
void |
setMinimumLastSegmentLength(double value)
Sets the minimum length of the last segment of the edge path (at the target node).
|
void |
setMinimumLength(double value)
Sets the minimum length of an edge.
|
void |
setMinimumOctilinearSegmentLength(double value)
Sets the minimum length of octilinear segments for this edge.
|
void |
setMinimumSlope(double value)
Sets the minimum slope that the mid segments of this edge should have, if the edge is routed polyline in vertical
layouts.
|
void |
setRecursiveEdgeStyle(RecursiveEdgeStyle value)
Sets how edges in grouped graphs are routed between the content of different groups.
|
void |
setRoutingStyle(RoutingStyle value)
Sets the routing style for this edge.
|
void |
setSourcePortOptimization(boolean value)
Sets whether or not source port optimization is enabled.
|
void |
setTargetPortOptimization(boolean value)
Sets whether or not target port optimization is enabled.
|
public EdgeLayoutDescriptor()
EdgeLayoutDescriptor
with the default values.public EdgeLayoutDescriptor createCopy()
EdgeLayoutDescriptor
instance.EdgeLayoutDescriptor
instancepublic double getMinimumDistance()
The minimum distance should be greater than 0
.
IllegalArgumentException
- if the minimum length is negativesetMinimumDistance(double)
public double getMinimumFirstSegmentLength()
The minimum length should be greater than 0
.
If the value is 0.0d
the first segment does not need to be orthogonal.
IllegalArgumentException
- if the minimum length of the first segment is negativesetMinimumFirstSegmentLength(double)
public double getMinimumLastSegmentLength()
The minimum length should be greater than 0
.
If the value is 0.0d
the last segment does not need to be orthogonal.
IllegalArgumentException
- if the minimum length of the last segment is negativesetMinimumLastSegmentLength(double)
public double getMinimumLength()
If this is used for polyline routing, it describes the minimum vertical length of the mid segment. If it is used for orthogonal routing, it describes the minimum length of the whole edge.
The minimum length should be greater than 0
.
IllegalArgumentException
- if the minimum length is negativesetMinimumLength(double)
public double getMinimumOctilinearSegmentLength()
IllegalArgumentException
- if the minimum length of the first segment is negativerouting style
is
octilinear
.setRoutingStyle(RoutingStyle)
,
setMinimumOctilinearSegmentLength(double)
public double getMinimumSlope()
The minimum slope should be greater than 0
.
IllegalArgumentException
- if the given minimum slope is negativesetMinimumSlope(double)
public RecursiveEdgeStyle getRecursiveEdgeStyle()
IllegalArgumentException
- if an unknown style is specifieddirect routing between groups and their content
is
enabled, such an edge may not be strictly recursive anymore. Edges may leave/enter group nodes left or right.RecursiveEdgeStyle.DIRECTED
and
RecursiveEdgeStyle.UNDIRECTED
. Any edge grouping information will be ignored, including
automatic groupings
.RecursiveEdgeStyle.OFF
. Edges are not routed recursively.setRecursiveEdgeStyle(RecursiveEdgeStyle)
public RoutingStyle getRoutingStyle()
RoutingStyle
instanceRoutingStyle
,
setRoutingStyle(RoutingStyle)
public boolean isDirectGroupContentEdgeRoutingEnabled()
When enabled, the edge will connect to the inner side of the group node's border instead of leaving the group node and connect from outside.
false
. true
if the edge is routed directly, false
otherwisesetDirectGroupContentEdgeRoutingEnabled(boolean)
public boolean isSourcePortOptimization()
This means that the algorithm should try to find a better source port constraint
if the current constraint is null
or PortSide.ANY
.
false
. Ports being placed at the side of the node which lies closest to the target of the edge in terms of
layering.true
if source port optimization is enabled, false
otherwisesetSourcePortOptimization(boolean)
public boolean isTargetPortOptimization()
This means that the algorithm should try to find a better target port constraint
if the current constraint is null
or PortSide.ANY
.
false
. Ports being placed at the side of the node which lies closest to the source of the edge in terms of
layering.true
if target port optimization should be enabled, false
otherwisesetTargetPortOptimization(boolean)
public void setDirectGroupContentEdgeRoutingEnabled(boolean value)
When enabled, the edge will connect to the inner side of the group node's border instead of leaving the group node and connect from outside.
false
. value
- true
if the edge is routed directly, false
otherwiseisDirectGroupContentEdgeRoutingEnabled()
public void setMinimumDistance(double value)
The minimum distance should be greater than 0
.
IllegalArgumentException
- if the minimum length is negativevalue
- the minimum distance to obstaclesgetMinimumDistance()
public void setMinimumFirstSegmentLength(double value)
The minimum length should be greater than 0
.
If the value is 0.0d
the first segment does not need to be orthogonal.
IllegalArgumentException
- if the minimum length of the first segment is negativevalue
- the minimum length of the first segmentgetMinimumFirstSegmentLength()
public void setMinimumLastSegmentLength(double value)
The minimum length should be greater than 0
.
If the value is 0.0d
the last segment does not need to be orthogonal.
IllegalArgumentException
- if the minimum length of the last segment is negativevalue
- the minimum length of the last segmentgetMinimumLastSegmentLength()
public void setMinimumLength(double value)
If this is used for polyline routing, it describes the minimum vertical length of the mid segment. If it is used for orthogonal routing, it describes the minimum length of the whole edge.
The minimum length should be greater than 0
.
IllegalArgumentException
- if the minimum length is negativevalue
- the minimum segment length.getMinimumLength()
public void setMinimumOctilinearSegmentLength(double value)
IllegalArgumentException
- if the minimum length of the first segment is negativerouting style
is
octilinear
.value
- the minimum length of octilinear segmentsetRoutingStyle(RoutingStyle)
,
getMinimumOctilinearSegmentLength()
public void setMinimumSlope(double value)
The minimum slope should be greater than 0
.
IllegalArgumentException
- if the given minimum slope is negativevalue
- the minimum slope of the mid segmentsgetMinimumSlope()
public void setRecursiveEdgeStyle(RecursiveEdgeStyle value)
IllegalArgumentException
- if an unknown style is specifieddirect routing between groups and their content
is
enabled, such an edge may not be strictly recursive anymore. Edges may leave/enter group nodes left or right.RecursiveEdgeStyle.DIRECTED
and
RecursiveEdgeStyle.UNDIRECTED
. Any edge grouping information will be ignored, including
automatic groupings
.RecursiveEdgeStyle.OFF
. Edges are not routed recursively.value
- one of the predefined recursive routing stylesgetRecursiveEdgeStyle()
public void setRoutingStyle(RoutingStyle value)
value
- a RoutingStyle
instanceRoutingStyle
,
getRoutingStyle()
public void setSourcePortOptimization(boolean value)
This means that the algorithm should try to find a better source port constraint
if the current constraint is null
or PortSide.ANY
.
false
. Ports being placed at the side of the node which lies closest to the target of the edge in terms of
layering.value
- true
if source port optimization is enabled, false
otherwiseisSourcePortOptimization()
public void setTargetPortOptimization(boolean value)
This means that the algorithm should try to find a better target port constraint
if the current constraint is null
or PortSide.ANY
.
false
. Ports being placed at the side of the node which lies closest to the source of the edge in terms of
layering.value
- true
if target port optimization should be enabled, false
otherwiseisTargetPortOptimization()