Search this API

y.layout.router.polyline
Class EdgeLayoutDescriptor

java.lang.Object
  extended by y.layout.router.polyline.EdgeLayoutDescriptor

public class EdgeLayoutDescriptor
extends java.lang.Object

This class is used by EdgeRouter to provide routing details for the edges of the graph.

An EdgeLayoutDescriptor instance can be specified individually for single edges using a DataProvider that returns an EdgeLayoutDescriptor instance for each edge of the graph, or null if no EdgeLayoutDescriptor is bound to an edge. The DataProvider 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.

 
Not all of the values contained in this class will be considered for all kinds of edges and algorithm settings.
See Also:
EdgeRouter.EDGE_LAYOUT_DESCRIPTOR_DPKEY
 

Field Summary
static byte EDGE_STYLE_CURVED
          A routing style constant specifying that the edge should be curved.
static byte EDGE_STYLE_OCTILINEAR
          A routing style constant specifying that the edge should be octilinear.
static byte EDGE_STYLE_ORTHOGONAL
          A routing style constant specifying that the edge should be orthogonal.
static byte MONOTONIC_BOTH
          A constant specifying monotonic edge path restrictions for the horizontal and vertical direction.
static byte MONOTONIC_HORIZONTAL
          A constant specifying monotonic edge path restrictions for the horizontal direction.
static byte MONOTONIC_NONE
          A constant specifying that there are no monotonic edge path restrictions.
static byte MONOTONIC_VERTICAL
          A constant specifying monotonic edge path restrictions for the vertical direction.
 
Constructor Summary
EdgeLayoutDescriptor()
          Creates a new instance of an EdgeLayoutDescriptor with the default settings.
 
Method Summary
 EdgeLayoutDescriptor createCopy()
          Creates a copy of this EdgeLayoutDescriptor instance.
 java.util.List getIntermediateRoutingPoints()
          Returns the list of intermediate YPoints that need to lie on the edge route.
 double getMaximumOctilinearSegmentRatio()
          Specifies the maximum ratio between the horizontal/vertical part of a segment and the non-orthogonal, octilinear part.
 double getMinimalEdgeToEdgeDistance()
          Returns the minimum distance between a pair of edges.
 double getMinimalFirstSegmentLength()
          Returns the minimum length of the first segment of the edge path (at the source node).
 double getMinimalLastSegmentLength()
          Returns the minimum length of the last segment of the edge path (at the target node).
 double getMinimalNodeCornerDistance()
          Returns the minimum distance that the edge should maintain from node corners when entering or leaving the node.
 byte getMonotonicPathRestriction()
          Returns the monotonic path restrictions that should be applied.
 PenaltySettings getPenaltySettings()
          Returns the PenaltySettings used for this edge.
 double getPreferredOctilinearSegmentLength()
          Returns the preferred length of non-orthogonal, octilinear segments.
 byte getRoutingStyle()
          Returns the routing style for the edge associated with this descriptor.
 byte getSourceCurveConnectionStyle()
          Returns the style which determines how curved edge paths connect at the source side of the edge.
 byte getTargetCurveConnectionStyle()
          Returns the style using which determines how 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 isDirectGroupContentEdgeRoutingEnabled()
          Returns 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 setControlPointCreationEnabled(boolean controlPointCreation)
          Specifies whether or not the points of the resulting edge path represent cubic bezier control points.
 void setDirectGroupContentEdgeRoutingEnabled(boolean enabled)
          Specifies 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 setIntermediateRoutingPoints(java.util.List intermediateRoutingPoints)
          Specifies the list of intermediate YPoints that need to lie on the edge route.
 void setMaximumOctilinearSegmentRatio(double maximumRatio)
          Specifies the maximum ratio between the horizontal/vertical part of a segment and the non-orthogonal, octilinear part.
 void setMinimalEdgeToEdgeDistance(double distance)
          Specifies the minimum distance between a pair of edges.
 void setMinimalFirstSegmentLength(double length)
          Specifies the minimum length of the first segment of the edge path (at the source node).
 void setMinimalLastSegmentLength(double length)
          Specifies the minimum length of the last segment of the edge path (at the target node).
 void setMinimalNodeCornerDistance(double distance)
          Specifies the minimum distance that the edge should maintain from node corners when entering or leaving the node.
 void setMonotonicPathRestriction(byte restriction)
          Specifies the monotonic path restrictions that should be applied.
 void setPenaltySettings(PenaltySettings penaltySettings)
          Specifies the PenaltySettings used for this edge.
 void setPreferredOctilinearSegmentLength(double preferredLength)
          Specifies the preferred length of non-orthogonal, octilinear segments.
 void setRoutingStyle(byte routingStyle)
          Specifies the routing style for the edge associated with this descriptor.
 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
 

Field Detail

EDGE_STYLE_ORTHOGONAL

public static final byte EDGE_STYLE_ORTHOGONAL
A routing style constant specifying that the edge should be orthogonal. Orthogonal edges only consist of vertical and horizontal segments.

See Also:
Constant Field Values
Sample Graph:

Routing style orthogonal

EDGE_STYLE_OCTILINEAR

public static final byte EDGE_STYLE_OCTILINEAR
A routing style constant specifying that the edge should be octilinear. Octilinear edges consist of vertical and horizontal segments as well as segments with slope -1 and 1.

 
Backbone segments of a bus are always routed orthogonally. Bus connections that lead from the backbone to the actual end nodes can be octilinear.
See Also:
Constant Field Values
Sample Graph:

Routing style octilinear

EDGE_STYLE_CURVED

public static final byte EDGE_STYLE_CURVED
A routing style constant specifying that the edge should be curved.

Curved edges are constructed using cubic bezier splines. As for all routing styles, overlaps with other elements are avoided. If there is very little space for a smooth curve, it can happen that the resulting path remains orthogonal. Therefore, the curved routing style does not produce optimal results for input graphs that offer little space for the edge routes.

When integrated edge labeling is enabled, for edge labels a straight, non-curved segment where the label is placed will be inserted. All the settings of the PreferredPlacementDescriptor are supported. Similarly, for the minimum first segment length and the minimum last segment length, a straight edge segment is created to fulfill the constraints.

 
Compared to the other routing styles, the curved routing style may significantly increase the runtime, especially for graphs with a large number of edges.
 
If the bends should actually be interpreted as bezier points, i.e. to let the visualization create the spline curves, enable setControlPointCreationEnabled(boolean)
See Also:
Constant Field Values
Sample Graph:

Routing style curved

MONOTONIC_NONE

public static final byte MONOTONIC_NONE
A constant specifying that there are no monotonic edge path restrictions.

The direction of the edge segments is not restricted, hence, intermediate segments might also point in a direction other than the one towards the target.

See Also:
setMonotonicPathRestriction(byte), Constant Field Values

MONOTONIC_VERTICAL

public static final byte MONOTONIC_VERTICAL
A constant specifying monotonic edge path restrictions for the vertical direction.

This implies that each vertical edge segment is directed from the source to the target. Note that if the source and target node are located on the same y-coordinate, then this restriction can not have an effect.

See Also:
setMonotonicPathRestriction(byte), Constant Field Values

MONOTONIC_HORIZONTAL

public static final byte MONOTONIC_HORIZONTAL
A constant specifying monotonic edge path restrictions for the horizontal direction.

This implies that each horizontal edge segment is directed from the source to the target. Note that if the source and target node are located on the same x-coordinate, then this restriction can not have an effect.

See Also:
setMonotonicPathRestriction(byte), Constant Field Values

MONOTONIC_BOTH

public static final byte MONOTONIC_BOTH
A constant specifying monotonic edge path restrictions for the horizontal and vertical direction.

This implies that each horizontal as well as each vertical edge segment is directed from the source to the target.

See Also:
setMonotonicPathRestriction(byte), Constant Field Values
Constructor Detail

EdgeLayoutDescriptor

public EdgeLayoutDescriptor()
Creates a new instance of an EdgeLayoutDescriptor with the default settings.

Method Detail

setMinimalFirstSegmentLength

public void setMinimalFirstSegmentLength(double length)
Specifies the minimum length of the first segment of the edge path (at the source node).

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.

 
The final segment length also depends on the used grid size (see Grid.getSpacing()). If the grid is larger than the specified minimum length, then the grid size defines the actual minimum.
 
The first segment length may be violated for curved edge routes when using source connection style CurveConnectionStyle.ORGANIC.
Default Value:
The default value is 5.0.
Parameters:
length - the minimum length of the first segment
Sample Graphs:

Minimum first segment length 10

Minimum first segment length 100

getMinimalFirstSegmentLength

public double getMinimalFirstSegmentLength()
Returns the minimum length of the first segment of the edge path (at the source node).

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.

 
The final segment length also depends on the used grid size (see Grid.getSpacing()). If the grid is larger than the specified minimum length, then the grid size defines the actual minimum.
 
The first segment length may be violated for curved edge routes when using source connection style CurveConnectionStyle.ORGANIC.
Returns:
the minimum length of the first segment
See Also:
setMinimalFirstSegmentLength(double)

setMinimalLastSegmentLength

public void setMinimalLastSegmentLength(double length)
Specifies the minimum length of the last segment of the edge path (at the target node).

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.

 
The final segment length also depends on the used grid size (see Grid.getSpacing()). If the grid is larger than the specified minimum length, then the grid size defines the actual minimum.
 
The last segment length may be violated for curved edge routes when using target connection style CurveConnectionStyle.ORGANIC.
Default Value:
The default value is 10.0.
Parameters:
length - the minimum length of the last segment
Sample Graphs:

Minimum last segment length 10

Minimum last segment length 200

getMinimalLastSegmentLength

public double getMinimalLastSegmentLength()
Returns the minimum length of the last segment of the edge path (at the target node).

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.

 
The final segment length also depends on the used grid size (see Grid.getSpacing()). If the grid is larger than the specified minimum length, then the grid size defines the actual minimum.
 
The last segment length may be violated for curved edge routes when using target connection style CurveConnectionStyle.ORGANIC.
Returns:
the minimum length of the last segment
See Also:
setMinimalLastSegmentLength(double)

getMinimalEdgeToEdgeDistance

public double getMinimalEdgeToEdgeDistance()
Returns the minimum distance between a pair of edges.

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.

Returns:
the minimum distance between a pair of edges
See Also:
setMinimalEdgeToEdgeDistance(double)

setMinimalEdgeToEdgeDistance

public void setMinimalEdgeToEdgeDistance(double distance)
Specifies the minimum distance between a pair of edges.

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.

Default Value:
The default value is 3.0.
Parameters:
distance - the minimum distance between a pair of edges
Sample Graphs:

Minimum edge to edge distance 3.0

Minimum edge to edge distance 25.0

getMinimalNodeCornerDistance

public double getMinimalNodeCornerDistance()
Returns the minimum distance that the edge should maintain from node corners when entering or leaving the node.

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.

Returns:
the minimum distance the edge should maintain from node corners
See Also:
setMinimalNodeCornerDistance(double)

setMinimalNodeCornerDistance

public void setMinimalNodeCornerDistance(double distance)
Specifies the minimum distance that the edge should maintain from node corners when entering or leaving the node.

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.

Default Value:
The default value is 3.0.
Parameters:
distance - the minimum distance the edge should maintain from node corners
Sample Graphs:

Minimum node corner distance 3.0

Minimum node corner distance 10.0

getMonotonicPathRestriction

public byte getMonotonicPathRestriction()
Returns the monotonic path restrictions that should be applied.

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, MONOTONIC_NONE will be used instead.

Returns:
one of the predefined monotonic path restrictions
See Also:
setMonotonicPathRestriction(byte)

setMonotonicPathRestriction

public void setMonotonicPathRestriction(byte restriction)
Specifies the monotonic path restrictions that should be applied.

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, MONOTONIC_NONE will be used instead.

Default Value:
The default value is MONOTONIC_NONE. No path restrictions are used.
Parameters:
restriction - one of the predefined monotonic path restrictions

getRoutingStyle

public byte getRoutingStyle()
Returns the routing style for the edge associated with this descriptor.

Returns:
one of the predefined routing styles
See Also:
setRoutingStyle(byte)

setRoutingStyle

public void setRoutingStyle(byte routingStyle)
Specifies the routing style for the edge associated with this descriptor.

Default Value:
The default value is EDGE_STYLE_ORTHOGONAL
Parameters:
routingStyle - one of the predefined routing styles
Throws:
java.lang.IllegalArgumentException - if an unknown routing style is given

getPenaltySettings

public PenaltySettings getPenaltySettings()
Returns the 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.

Returns:
the penalty settings used for this edge
See Also:
PenaltySettings.OPTIMIZATION_BALANCED, PenaltySettings.OPTIMIZATION_EDGE_BENDS, PenaltySettings.OPTIMIZATION_EDGE_CROSSINGS, PenaltySettings.OPTIMIZATION_EDGE_LENGTHS

setPenaltySettings

public void setPenaltySettings(PenaltySettings penaltySettings)
Specifies the 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.

Parameters:
penaltySettings - the penalty settings used for this edge
Throws:
java.lang.IllegalArgumentException - if the given penalty settings are null
See Also:
PenaltySettings.OPTIMIZATION_BALANCED, PenaltySettings.OPTIMIZATION_EDGE_BENDS, PenaltySettings.OPTIMIZATION_EDGE_CROSSINGS, PenaltySettings.OPTIMIZATION_EDGE_LENGTHS

isDirectGroupContentEdgeRoutingEnabled

public boolean isDirectGroupContentEdgeRoutingEnabled()
Returns 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.

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.

PortCandidates as well as PortConstraints are supported for direct content edges, including fixed PortCandidates and strong PortConstraints. Note that, for example, a constraint with direction PortConstraint.NORTH at the side of the enclosing group node means that the edge connects to the upper group node border from inside and never leaves the group node.

 
Edges that are completely overlapped by their source or target may require special attention during visualization. They can disappear when edges are clipped at their source and target.
 
This only applies to edges that connect to a group node from inside this group node.
Returns:
true if the edge is routed directly, false otherwise
See Also:
setDirectGroupContentEdgeRoutingEnabled(boolean)

setDirectGroupContentEdgeRoutingEnabled

public void setDirectGroupContentEdgeRoutingEnabled(boolean enabled)
Specifies 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.

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.

PortCandidates as well as PortConstraints are supported for direct content edges, including fixed PortCandidates and strong PortConstraints. Note that, for example, a constraint with direction PortConstraint.NORTH at the side of the enclosing group node means that the edge connects to the upper group node border from inside and never leaves the group node.

 
Edges that are completely overlapped by their source or target may require special attention during visualization. They can disappear when edges are clipped at their source and target.
 
This only applies to edges that connect to a group node from inside this group node.
Default Value:
The default value is false.
Parameters:
enabled - true if the edge is routed directly, false otherwise
Sample Graphs:

false

true

getIntermediateRoutingPoints

public java.util.List getIntermediateRoutingPoints()
Returns the list of intermediate YPoints that need to lie on the edge route.

The edge route is constructed such that all the specified intermediate points lie on the route in the order they are specified. The route can, but must not necessarily bend at the specified points.

 
This setting can be used to control the rough shape of an edge route. This also applies for grouped edges. If the grouped edges have a set of common intermediate points, the shared path will contain all these common intermediate points. This way, the actual style of the edge grouping can be influenced, i.e., it can be forced that grouped edges are routed together up to a certain location. Only afterwards they are allowed to split up. On the individual part they can again have other, individual intermediate points.
 
Intermediate points are only considered for edges that are not part of a bus structure, see EdgeRouter.BUS_DESCRIPTOR_DPKEY.
 
The algorithm tries to avoid edges with self-crossings, but when specifying intermediate points it can not be guaranteed that no such crossings occur.
Returns:
the list of YPoints representing intermediate routing points, or null if there are no intermediate points
See Also:
setIntermediateRoutingPoints(List), EdgeRouter.BUS_DESCRIPTOR_DPKEY

setIntermediateRoutingPoints

public void setIntermediateRoutingPoints(java.util.List intermediateRoutingPoints)
Specifies the list of intermediate YPoints that need to lie on the edge route.

The edge route is constructed such that all the specified intermediate points lie on the route in the order they are specified. The route can, but must not necessarily bend at the specified points.

 
This setting can be used to control the rough shape of an edge route. This also applies for grouped edges. If the grouped edges have a set of common intermediate points, the shared path will contain all these common intermediate points. This way, the actual style of the edge grouping can be influenced, i.e., it can be forced that grouped edges are routed together up to a certain location. Only afterwards they are allowed to split up. On the individual part they can again have other, individual intermediate points.
 
Intermediate points are only considered for edges that are not part of a bus structure, see EdgeRouter.BUS_DESCRIPTOR_DPKEY.
 
The algorithm tries to avoid edges with self-crossings, but when specifying intermediate points it can not be guaranteed that no such crossings occur.
Default Value:
The default value is null. The route does not obey any intermediate points.
Parameters:
intermediateRoutingPoints - the list of YPoints representing intermediate routing points, or null if there should be no intermediate points
See Also:
EdgeRouter.BUS_DESCRIPTOR_DPKEY

isControlPointCreationEnabled

public boolean isControlPointCreationEnabled()
Returns whether or not the points of the resulting edge path represent cubic bezier control points.

 
This feature is useful when the visualization of the edge draws bezier curves instead of polyline paths.
Returns:
true if the bends are interpreted as cubic bezier control points, false otherwise
See Also:
setControlPointCreationEnabled(boolean)

setControlPointCreationEnabled

public void setControlPointCreationEnabled(boolean controlPointCreation)
Specifies whether or not the points of the resulting edge path represent cubic bezier control points.

 
This feature is useful when the visualization of the edge draws bezier curves instead of polyline paths.
Default Value:
The default value is false. Each point is a normal polyline bend point.
Parameters:
controlPointCreation - true if the points of the edge path should represent cubic bezier control points, false otherwise

getSourceCurveConnectionStyle

public byte getSourceCurveConnectionStyle()
Returns the style which determines how curved edge paths connect at the source side of the edge.

Returns:
one of the predefined curve connection styles
See Also:
setTargetCurveConnectionStyle(byte), setSourceCurveConnectionStyle(byte)

setSourceCurveConnectionStyle

public void setSourceCurveConnectionStyle(byte curveConnectionStyle)
Specifies the style which determines how curved edge paths connect at the source side of the edge.

Parameters:
curveConnectionStyle - one of the predefined curve connection styles
Throws:
java.lang.IllegalArgumentException - if an unknown connection style is given
See Also:
setTargetCurveConnectionStyle(byte)
Sample Graphs:

CurveConnectionStyle.KEEP_PORT setting at source and target side - normal ports by the routing algorithm

CurveConnectionStyle.ORGANIC setting at source and target side - more organic ports and more direct curves

getTargetCurveConnectionStyle

public byte getTargetCurveConnectionStyle()
Returns the style using which determines how edge paths connect at the target side of the edge.

Returns:
one of the predefined curve connection styles
See Also:
setSourceCurveConnectionStyle(byte), setTargetCurveConnectionStyle(byte)

setTargetCurveConnectionStyle

public void setTargetCurveConnectionStyle(byte curveConnectionStyle)
Specifies the style which determines how curved edge paths connect at the target side of the edge.

Parameters:
curveConnectionStyle - one of the predefined curve connection styles
Throws:
java.lang.IllegalArgumentException - if an unknown connection style is given
See Also:
setSourceCurveConnectionStyle(byte)
Sample Graphs:

CurveConnectionStyle.KEEP_PORT setting at source and target side - normal ports by the routing algorithm

CurveConnectionStyle.ORGANIC setting at source and target side - more organic ports and more direct curves

getPreferredOctilinearSegmentLength

public double getPreferredOctilinearSegmentLength()
Returns the preferred length of non-orthogonal, octilinear segments.

If there is not enough space to use this preferred length, the segments may also be shorter.

The preferred length of non-orthogonal, octilinear segments has to be greater than or equal to 0.

 
This setting applies only for edges with octilinear routing.
Returns:
the preferred length of non-orthogonal, octilinear segments
See Also:
setPreferredOctilinearSegmentLength(double), EDGE_STYLE_OCTILINEAR, setMaximumOctilinearSegmentRatio(double)

setPreferredOctilinearSegmentLength

public void setPreferredOctilinearSegmentLength(double preferredLength)
Specifies the preferred length of non-orthogonal, octilinear segments.

If there is not enough space to use this preferred length, the segments may also be shorter.

The preferred length of non-orthogonal, octilinear segments has to be greater than or equal to 0.

 
This setting applies only for edges with octilinear routing.
Default Value:
The default value is 30.
Parameters:
preferredLength - the preferred length of non-orthogonal, octilinear segments
Throws:
java.lang.IllegalArgumentException - if the preferred octilinear segment length is negative
See Also:
EDGE_STYLE_OCTILINEAR, setMaximumOctilinearSegmentRatio(double)
Sample Graphs:

Preferred octilinear segment length 10

Preferred octilinear segment length 50

getMaximumOctilinearSegmentRatio

public double getMaximumOctilinearSegmentRatio()
Specifies the maximum ratio between the horizontal/vertical part of a segment and the non-orthogonal, octilinear part.

When octilinear segments are added to an edge path, corners between horizontal and vertical segments are cut and replaced by the new segment. This ratio describes the cutting points on a segment. If it is zero, the route stays orthogonal. The value cannot be larger than 0.5 because there may be another non-orthogonal segment at the other side of the segment. For long orthogonal segments the length of the octilinear segment is determined by the value of property getPreferredOctilinearSegmentLength().

The maximum octilinear segment ratio must be between 0 and 0.5.

 
This setting applies only for edges with octilinear routing.
Returns:
the maximum octilinear segment ratio
See Also:
setMaximumOctilinearSegmentRatio(double), EDGE_STYLE_OCTILINEAR, setPreferredOctilinearSegmentLength(double)

setMaximumOctilinearSegmentRatio

public void setMaximumOctilinearSegmentRatio(double maximumRatio)
Specifies the maximum ratio between the horizontal/vertical part of a segment and the non-orthogonal, octilinear part.

When octilinear segments are added to an edge path, corners between horizontal and vertical segments are cut and replaced by the new segment. This ratio describes the cutting points on a segment. If it is zero, the route stays orthogonal. The value cannot be larger than 0.5 because there may be another non-orthogonal segment at the other side of the segment. For long orthogonal segments the length of the octilinear segment is determined by the value of property getPreferredOctilinearSegmentLength().

The maximum octilinear segment ratio must be between 0 and 0.5.

 
This setting applies only for edges with octilinear routing.
Default Value:
The default value is 0.3.
Parameters:
maximumRatio - the maximum octilinear segment ratio
Throws:
java.lang.IllegalArgumentException - if the maximum ratio is negative or greater than 0.5
See Also:
EDGE_STYLE_OCTILINEAR, setPreferredOctilinearSegmentLength(double)
Sample Graphs:

Ratio 0.3, the octilinear parts from left and right both cover a third of the horizontal distance

Ratio 0.5, the octilinear parts from left and right both cover half of the horizontal distance

createCopy

public EdgeLayoutDescriptor createCopy()
Creates a copy of this EdgeLayoutDescriptor instance.

Returns:
a copy of this EdgeLayoutDescriptor instance

© Copyright 2000-2021,
yWorks GmbH.
All rights reserved.