Search this API

y.layout.router
Class CurveEdgeLayoutDescriptor

java.lang.Object
  extended by y.layout.router.CurveEdgeLayoutDescriptor

public class CurveEdgeLayoutDescriptor
extends java.lang.Object

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.

See Also:
CurveRoutingStage, CurveRoutingStage.CURVE_EDGE_LAYOUT_DESCRIPTOR_DPKEY
 

Constructor Summary
CurveEdgeLayoutDescriptor()
           
 
Method Summary
 CurveEdgeLayoutDescriptor createCopy()
          Creates a copy of this CurveEdgeLayoutDescriptor instance.
 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.
 void setControlPointCreationEnabled(boolean controlPointCreation)
          Specifies whether or not the points of the resulting edge path represent cubic bezier control points.
 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

CurveEdgeLayoutDescriptor

public CurveEdgeLayoutDescriptor()
Method Detail

getMinimumFirstSegmentLength

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

The minimum length must be greater than or equal to 0.

 
The first segment length starts, if present, at the halo of the source node.
 
The first segment length is ignored when using source connection style CurveConnectionStyle.ORGANIC.
Returns:
the minimum length of the first segment
See Also:
setMinimumFirstSegmentLength(double)

setMinimumFirstSegmentLength

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

The minimum length must be greater than or equal to 0.

 
The first segment length starts, if present, at the halo of the source node.
 
The first segment length is ignored when using source connection style CurveConnectionStyle.ORGANIC.
Default Value:
The default value is 5.0.
Parameters:
length - the minimum length of the first segment
Throws:
java.lang.IllegalArgumentException - if the minimum length of the first segment is negative
Sample Graphs:

Minimum first segment length 5

Minimum first segment length 30

getMinimumLastSegmentLength

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

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.

 
The last segment length ends, if present, at the halo of the target node.
 
The last segment length is ignored when using target connection style CurveConnectionStyle.ORGANIC.
Returns:
the minimum length of the last segment
See Also:
setMinimumLastSegmentLength(double)

setMinimumLastSegmentLength

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

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.

 
The last segment length ends, if present, at the halo of the target node.
 
The last segment length is ignored when using target connection style CurveConnectionStyle.ORGANIC.
Default Value:
The default value is 10.0.
Parameters:
length - the minimum length of the last segment
Throws:
java.lang.IllegalArgumentException - if the minimum length of the last segment is negative
Sample Graphs:

Minimum last segment length 10

Minimum last segment length 30

getMinimumEdgeToEdgeDistance

public double getMinimumEdgeToEdgeDistance()
Returns the minimum distance to segments belonging to other edges.

The minimum distance must be greater than or equal to 0.

Returns:
the minimum distance between this curved edge and other edges
See Also:
setMinimumEdgeToEdgeDistance(double)

setMinimumEdgeToEdgeDistance

public void setMinimumEdgeToEdgeDistance(double distance)
Specifies the minimum distance to segments belonging to other edges.

The minimum distance must be greater than or equal to 0.

 
The minimum edge distance influences how the curves are created. If this distance is already violated in the result of the core layout algorithm, it has no effect on the curved routes, i.e. the curved route may also violate it.
Default Value:
The default value is 10.0.
Parameters:
distance - the minimum distance between this curved edge and other edges
Throws:
java.lang.IllegalArgumentException - if the minimum distance is negative

getMinimumNodeToEdgeDistance

public double getMinimumNodeToEdgeDistance()
Returns the minimum distance to nodes.

The minimum distance must be greater than or equal to 0.

 
The minimum node distance influences how the curves are created. If this distance is already violated in the result of the core layout algorithm, it has no effect on the curved routes, i.e. the curved route may also violate it.
Returns:
the minimum distance between this curve edge and nodes
See Also:
setMinimumNodeToEdgeDistance(double)

setMinimumNodeToEdgeDistance

public void setMinimumNodeToEdgeDistance(double distance)
Specifies the minimum distance to nodes.

The minimum distance must be greater than or equal to 0.

 
The minimum node distance influences how the curves are created. If this distance is already violated in the result of the core layout algorithm, it has no effect on the curved routes, i.e. the curved route may also violate it.
Default Value:
The default value is 10.0.
Parameters:
distance - the minimum distance between this curve edge and nodes
Throws:
java.lang.IllegalArgumentException - if the minimum distance is negative

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), CurveConnectionStyle.KEEP_PORT, CurveConnectionStyle.ORGANIC

setSourceCurveConnectionStyle

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

Default Value:
The default value is CurveConnectionStyle.KEEP_PORT. The source port and the first segment is kept.
Parameters:
curveConnectionStyle - one of the predefined curve connection styles
Throws:
java.lang.IllegalArgumentException - if an unknown connection style is given
See Also:
CurveConnectionStyle.KEEP_PORT, CurveConnectionStyle.ORGANIC, setTargetCurveConnectionStyle(byte)

getTargetCurveConnectionStyle

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

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

setTargetCurveConnectionStyle

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

Default Value:
The default value is CurveConnectionStyle.KEEP_PORT. The target port and the last segment is kept.
Parameters:
curveConnectionStyle - one of the predefined curve connection styles
Throws:
java.lang.IllegalArgumentException - if an unknown connection style is given
See Also:
CurveConnectionStyle.KEEP_PORT, CurveConnectionStyle.ORGANIC, setSourceCurveConnectionStyle(byte)

createCopy

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

Returns:
a copy of this CurveEdgeLayoutDescriptor instance

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