Search this API

y.layout.circular
Class ExteriorEdgeLayoutDescriptor

java.lang.Object
  extended by y.layout.circular.ExteriorEdgeLayoutDescriptor

public class ExteriorEdgeLayoutDescriptor
extends java.lang.Object

This class provides routing settings for edges routed externally by the CircularLayouter.

The offered settings affect only edges routed on the exterior of a circle partition. The edge routing policy determines the edges that are exterior. An exterior edge consists of three different path components:

  1. Two straight parts, one starting at the source node and one ending at the target node. The angle between the straight parts of adjacent edges at the same node can be specified with the preferred angle property.
  2. The main arc path that runs around the exterior of the circle from source to target. The radii of the arc paths depend on the specified getCircleDistance() and the getPreferredCurveLength(). The getEdgeToEdgeDistance() determines the distance between arcs of different edges.
  3. Two curve parts that connect the straight part at the source side with the arc and the arc with the straight part at the target side. Its length is specifiable via setPreferredCurveLength(double).

See Also:
CircularLayouter.setEdgeRoutingPolicy(byte), CircularLayouter.EDGE_ROUTING_POLICY_AUTOMATIC, CircularLayouter.EDGE_ROUTING_POLICY_EXTERIOR, CircularLayouter.EDGE_ROUTING_POLICY_MARKED_EXTERIOR
 

Constructor Summary
ExteriorEdgeLayoutDescriptor()
           
 
Method Summary
 double getCircleDistance()
          Returns the minimum distance between the outer border of the circle partition and the arc path of exterior edges that run around the circle.
 double getEdgeToEdgeDistance()
          Returns the minimum distance that exterior edges keep to each other.
 double getPreferredAngle()
          Returns the preferred angle (in degrees) between adjacent segments of exterior edges at the same node.
 double getPreferredCurveLength()
          Returns the preferred length of the curve part that connects the first or last segment with the outer arc.
 double getSmoothness()
          Returns the smoothness of the exterior edges which determines how many bend points are generated to approximate the curvature of the edge paths.
 void setCircleDistance(double circleDistance)
          Specifies the minimum distance between the outer border of the circle partition and the arc path of exterior edges that run around the circle.
 void setEdgeToEdgeDistance(double edgeToEdgeDistance)
          Specifies the minimum distance that exterior edges keep to each other.
 void setPreferredAngle(double preferredAngle)
          Specifies the preferred angle (in degrees) between adjacent segments of exterior edges at the same node.
 void setPreferredCurveLength(double preferredCurveLength)
          Specifies the preferred length of the curve part that connects the first or last segment with the outer arc.
 void setSmoothness(double smoothness)
          Specifies the smoothness of the exterior edges which determines how many bend points are generated to approximate the curvature of the edge paths.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExteriorEdgeLayoutDescriptor

public ExteriorEdgeLayoutDescriptor()
Method Detail

getEdgeToEdgeDistance

public double getEdgeToEdgeDistance()
Returns the minimum distance that exterior edges keep to each other.

Returns:
the minimum distance of exterior edges to each other
See Also:
setEdgeToEdgeDistance(double)

setEdgeToEdgeDistance

public void setEdgeToEdgeDistance(double edgeToEdgeDistance)
Specifies the minimum distance that exterior edges keep to each other.

Default Value:
The default value is 10.0.
Parameters:
edgeToEdgeDistance - the minimum distance of exterior edges to each other
Throws:
java.lang.IllegalArgumentException - if the minimum distance is negative
Sample Graphs:

Exterior edge-to-edge distance 10.

Exterior edge-to-edge distance 30.

getPreferredAngle

public double getPreferredAngle()
Returns the preferred angle (in degrees) between adjacent segments of exterior edges at the same node.

When the angle is zero, all exterior edges start/end with a segment of the same slope and, thus, overlap each other. The segment in this case is the extension of the line connecting the partition circle center with the respective node center.

An angle greater than zero means that the edge segments are distributed, get different slopes and are not overlapping each other anymore. The preferred angle may at most be 45 degrees and must not be negative. Importantly, it can not always be obeyed. When there are too many edges to distribute at a node or if the preferred angle would lead to overlaps with other nodes, the actual angle can become smaller.

 
An angle of zero means overlapping start/end segments, which might be desired in case edges should have a grouped style at their common end points.
 
It is not guaranteed that this angle is obeyed, as a wedge of at most 90 degrees is available to distribute the edges at a node (45 degrees for edges running in clockwise direction and 45 degrees for edges running in counterclockwise direction). To avoid overlaps with other elements, this maximum wedge angle is often even smaller than 90 degrees.
Returns:
the preferred angle between adjacent exterior edges in the interval [0,45]
See Also:
setPreferredAngle(double)

setPreferredAngle

public void setPreferredAngle(double preferredAngle)
Specifies the preferred angle (in degrees) between adjacent segments of exterior edges at the same node.

When the angle is zero, all exterior edges start/end with a segment of the same slope and, thus, overlap each other. The segment in this case is the extension of the line connecting the partition circle center with the respective node center.

An angle greater than zero means that the edge segments are distributed, get different slopes and are not overlapping each other anymore. The preferred angle may at most be 45 degrees and must not be negative. Importantly, it can not always be obeyed. When there are too many edges to distribute at a node or if the preferred angle would lead to overlaps with other nodes, the actual angle can become smaller.

 
An angle of zero means overlapping start/end segments, which might be desired in case edges should have a grouped style at their common end points.
 
It is not guaranteed that this angle is obeyed, as a wedge of at most 90 degrees is available to distribute the edges at a node (45 degrees for edges running in clockwise direction and 45 degrees for edges running in counterclockwise direction). To avoid overlaps with other elements, this maximum wedge angle is often even smaller than 90 degrees.
Default Value:
The default value is 10.0.
Parameters:
preferredAngle - the preferred angle between adjacent exterior edges in the interval [0,45]
Throws:
java.lang.IllegalArgumentException - if the given angle is negative or larger than 45
Sample Graphs:

Preferred angle 10

Preferred angle 0 - results in overlapping segments

getPreferredCurveLength

public double getPreferredCurveLength()
Returns the preferred length of the curve part that connects the first or last segment with the outer arc.

An exterior edge consists of a straight part starting at the source node (or ending at the target node) and a main arc that runs around the exterior of the circle from source to target. A curve connects these two parts. Its length is configured by this setting.

When the preferred length is zero, there is no curve but a 90 degree bend. Increasing the curve length means that the radius on which the exterior edges are placed around the circle is increased too. This is necessary to insert the longer curve while still satisfying the specified getCircleDistance().

 
The smoothness of the curve, i.e., the amount of bends inserted to model it, can be adjusted with the smoothness property.
Returns:
the non-negative preferred length of the curve part of the exterior edge
See Also:
setPreferredCurveLength(double)

setPreferredCurveLength

public void setPreferredCurveLength(double preferredCurveLength)
Specifies the preferred length of the curve part that connects the first or last segment with the outer arc.

An exterior edge consists of a straight part starting at the source node (or ending at the target node) and a main arc that runs around the exterior of the circle from source to target. A curve connects these two parts. Its length is configured by this setting.

When the preferred length is zero, there is no curve but a 90 degree bend. Increasing the curve length means that the radius on which the exterior edges are placed around the circle is increased too. This is necessary to insert the longer curve while still satisfying the specified getCircleDistance().

 
The smoothness of the curve, i.e., the amount of bends inserted to model it, can be adjusted with the smoothness property.
Default Value:
The default value is 20.
Parameters:
preferredCurveLength - the non-negative preferred length of the curve part of the exterior edge
Throws:
java.lang.IllegalArgumentException - if the given preferred length is negative
See Also:
setSmoothness(double)
Sample Graphs:

Preferred curve length 20

Preferred curve length 0

Preferred curve length 60

getCircleDistance

public double getCircleDistance()
Returns the minimum distance between the outer border of the circle partition and the arc path of exterior edges that run around the circle.

This property determines the distance that innermost arcs of exterior edges must keep to the circle border. The circle border in this case is the border enclosing all nodes of the circle.

Returns:
the non-negative minimum distance between the outer border of the circle and the exterior arcs
See Also:
setCircleDistance(double)

setCircleDistance

public void setCircleDistance(double circleDistance)
Specifies the minimum distance between the outer border of the circle partition and the arc path of exterior edges that run around the circle.

This property determines the distance that innermost arcs of exterior edges must keep to the circle border. The circle border in this case is the border enclosing all nodes of the circle.

Default Value:
The default value is 20.
Parameters:
circleDistance - the non-negative minimum distance between the outer border of the circle and the exterior arcs
Throws:
java.lang.IllegalArgumentException - if the given circle distance is negative
Sample Graphs:

Circle distance 20

Circle distance 50

getSmoothness

public double getSmoothness()
Returns the smoothness of the exterior edges which determines how many bend points are generated to approximate the curvature of the edge paths.

The smoothness is defined to be a value from the interval [0,1], where a higher value means smoother curves, and, thus, more bends.

Returns:
the smoothness of the curves of exterior edges from the interval [0,1]
See Also:
setSmoothness(double)

setSmoothness

public void setSmoothness(double smoothness)
Specifies the smoothness of the exterior edges which determines how many bend points are generated to approximate the curvature of the edge paths.

The smoothness is defined to be a value from the interval [0,1], where a higher value means smoother curves, and, thus, more bends.

Default Value:
The default value is 0.7.
Parameters:
smoothness - the smoothness of the curves of exterior edges from the interval [0,1]
Throws:
java.lang.IllegalArgumentException - if the smoothness is not in the interval [0,1]
Sample Graphs:

Smoothness 0.7

Smoothness 0.9

Smoothness 0.2

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