public class EdgeLayoutDescriptor extends Object
EdgeRouter
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
EdgeRouter.EDGE_LAYOUT_DESCRIPTOR_DPKEY
.
This class is designed such that it allows future additions of new getter methods.
EdgeRouter.EDGE_LAYOUT_DESCRIPTOR_DPKEY
Constructor and Description |
---|
EdgeLayoutDescriptor()
Creates a new instance of an
EdgeLayoutDescriptor with the default settings. |
Modifier and Type | Method and Description |
---|---|
EdgeLayoutDescriptor |
createCopy()
Creates a copy of this
EdgeLayoutDescriptor instance. |
double |
getMinimumEdgeToEdgeDistance()
Gets the minimum distance between a pair of edges.
|
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 |
getMinimumNodeCornerDistance()
Gets the minimum distance that the edge should maintain from node corners when entering or leaving the node.
|
MonotonicPathRestriction |
getMonotonicPathRestriction()
Gets the monotonic path restrictions that should be applied.
|
PenaltySettings |
getPenaltySettings()
Gets the
PenaltySettings used for this edge. |
void |
setMinimumEdgeToEdgeDistance(double value)
Sets the minimum distance between a pair of edges.
|
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 |
setMinimumNodeCornerDistance(double value)
Sets the minimum distance that the edge should maintain from node corners when entering or leaving the node.
|
void |
setMonotonicPathRestriction(MonotonicPathRestriction value)
Sets the monotonic path restrictions that should be applied.
|
void |
setPenaltySettings(PenaltySettings value)
Sets the
PenaltySettings used for this edge. |
public EdgeLayoutDescriptor()
EdgeLayoutDescriptor
with the default settings.public EdgeLayoutDescriptor createCopy()
EdgeLayoutDescriptor
instance.EdgeLayoutDescriptor
instancepublic double getMinimumEdgeToEdgeDistance()
The minimum distance should be greater than or equal to 0
. If a negative value is given as input, the default
value, i.e., 3.0
, will be used instead.
setMinimumEdgeToEdgeDistance(double)
public double getMinimumFirstSegmentLength()
The minimum length should be greater than or equal to 0
. If a negative value is given as input, the default
value, i.e., 5.0
, will be used instead.
Spacing
). If the grid is larger than the
specified minimum length, then the grid size defines the actual minimum.setMinimumFirstSegmentLength(double)
public double getMinimumLastSegmentLength()
The minimum length should be greater than or equal to 0
. If a negative value is given as input, the default
value, i.e., 10.0
, will be used instead.
Spacing
). If the grid is larger than the
specified minimum length, then the grid size defines the actual minimum.setMinimumLastSegmentLength(double)
public double getMinimumNodeCornerDistance()
The minimum distance should be greater than or equal to 0
. If a negative value is given as input, the default
value, i.e., 3.0
, will be used instead.
setMinimumNodeCornerDistance(double)
public MonotonicPathRestriction getMonotonicPathRestriction()
Monotonic path restrictions imply that (ideally) the vertical and/or horizontal segments of an edge path are directed from the source node towards the target node without ever changing their direction back towards the source node.
If an unknown restriction is specified, MonotonicPathRestriction.NONE
will be used instead.
MonotonicPathRestriction.NONE
. No path restrictions are used.setMonotonicPathRestriction(MonotonicPathRestriction)
public PenaltySettings getPenaltySettings()
PenaltySettings
used for this edge.
Besides specifying a completely customized setting, the user can choose between four predefined optimization strategies:
PenaltySettings.OPTIMIZATION_BALANCED
, PenaltySettings.OPTIMIZATION_EDGE_BENDS
, PenaltySettings.OPTIMIZATION_EDGE_CROSSINGS
and PenaltySettings.OPTIMIZATION_EDGE_LENGTHS
.
IllegalArgumentException
- if the given penalty settings are null
PenaltySettings.OPTIMIZATION_BALANCED
,
PenaltySettings.OPTIMIZATION_EDGE_BENDS
,
PenaltySettings.OPTIMIZATION_EDGE_CROSSINGS
,
PenaltySettings.OPTIMIZATION_EDGE_LENGTHS
,
setPenaltySettings(PenaltySettings)
public void setMinimumEdgeToEdgeDistance(double value)
The minimum distance should be greater than or equal to 0
. If a negative value is given as input, the default
value, i.e., 3.0
, will be used instead.
value
- the minimum distance between a pair of edgesgetMinimumEdgeToEdgeDistance()
public void setMinimumFirstSegmentLength(double value)
The minimum length should be greater than or equal to 0
. If a negative value is given as input, the default
value, i.e., 5.0
, will be used instead.
Spacing
). If the grid is larger than the
specified minimum length, then the grid size defines the actual minimum.value
- the minimum length of the first segmentgetMinimumFirstSegmentLength()
public void setMinimumLastSegmentLength(double value)
The minimum length should be greater than or equal to 0
. If a negative value is given as input, the default
value, i.e., 10.0
, will be used instead.
Spacing
). If the grid is larger than the
specified minimum length, then the grid size defines the actual minimum.value
- the minimum length of the last segmentgetMinimumLastSegmentLength()
public void setMinimumNodeCornerDistance(double value)
The minimum distance should be greater than or equal to 0
. If a negative value is given as input, the default
value, i.e., 3.0
, will be used instead.
value
- the minimum distance the edge should maintain from node cornersgetMinimumNodeCornerDistance()
public void setMonotonicPathRestriction(MonotonicPathRestriction value)
Monotonic path restrictions imply that (ideally) the vertical and/or horizontal segments of an edge path are directed from the source node towards the target node without ever changing their direction back towards the source node.
If an unknown restriction is specified, MonotonicPathRestriction.NONE
will be used instead.
MonotonicPathRestriction.NONE
. No path restrictions are used.value
- one of the predefined monotonic path restrictionsgetMonotonicPathRestriction()
public void setPenaltySettings(PenaltySettings value)
PenaltySettings
used for this edge.
Besides specifying a completely customized setting, the user can choose between four predefined optimization strategies:
PenaltySettings.OPTIMIZATION_BALANCED
, PenaltySettings.OPTIMIZATION_EDGE_BENDS
, PenaltySettings.OPTIMIZATION_EDGE_CROSSINGS
and PenaltySettings.OPTIMIZATION_EDGE_LENGTHS
.
IllegalArgumentException
- if the given penalty settings are null
value
- the penalty settings used for this edgePenaltySettings.OPTIMIZATION_BALANCED
,
PenaltySettings.OPTIMIZATION_EDGE_BENDS
,
PenaltySettings.OPTIMIZATION_EDGE_CROSSINGS
,
PenaltySettings.OPTIMIZATION_EDGE_LENGTHS
,
getPenaltySettings()