Search this API

y.layout.orthogonal
Class EdgeLayoutDescriptor

java.lang.Object
  extended by y.layout.orthogonal.EdgeLayoutDescriptor

public class EdgeLayoutDescriptor
extends java.lang.Object

This class provides layout information for the edges of the graph.

EdgeLayoutDescriptor is used by OrthogonalLayouter, DirectedOrthogonalLayouter and OrthogonalGroupLayouter to determine the routing details for the edges (e.g. the segment length).

An EdgeLayoutDescriptor can be specified individually for each edge by using a DataProvider which maps from an Edge to an EdgeLayoutDescriptor instance. The DataProvider is registered with the graph with keys OrthogonalLayouter.EDGE_LAYOUT_DESCRIPTOR_DPKEY for OrthogonalLayouter, DirectedOrthogonalLayouter.EDGE_LAYOUT_DESCRIPTOR_DPKEY for DirectedOrthogonalLayouter and OrthogonalGroupLayouter.EDGE_LAYOUT_DESCRIPTOR_DPKEY for OrthogonalGroupLayouter.

See Also:
OrthogonalLayouter.EDGE_LAYOUT_DESCRIPTOR_DPKEY, DirectedOrthogonalLayouter.EDGE_LAYOUT_DESCRIPTOR_DPKEY, OrthogonalGroupLayouter.EDGE_LAYOUT_DESCRIPTOR_DPKEY
 

Constructor Summary
EdgeLayoutDescriptor()
          Creates a new instance of EdgeLayoutDescriptor with the default settings.
 
Method Summary
 EdgeLayoutDescriptor createCopy()
          Creates a copy of this EdgeLayoutDescriptor instance.
 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 getMinimumSegmentLength()
          Returns the minimum segment length of an edge.
 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 setMinimumSegmentLength(double length)
          Specifies the minimum segment length of an edge.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EdgeLayoutDescriptor

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

Method Detail

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 final segment length also depends on the used grid size (see OrthogonalLayouter.setGrid(int)). If the grid is larger than the specified minimum length, then the grid size defines the actual minimum.
Default Value:
The default value is 15.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 15

Minimum first segment length 30

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 final segment length also depends on the used grid size (see OrthogonalLayouter.setGrid(int)). If the grid is larger than the specified minimum length, then the grid size defines the actual minimum.
Returns:
the minimum length of the first segment
See Also:
setMinimumFirstSegmentLength(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.

 
The final segment length also depends on the used grid size (see OrthogonalLayouter.setGrid(int)). If the grid is larger than the specified minimum length, then the grid size defines the actual minimum.
Default Value:
The default value is 15.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 15

Minimum last 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.

 
The final segment length also depends on the used grid size (see OrthogonalLayouter.setGrid(int)). If the grid is larger than the specified minimum length, then the grid size defines the actual minimum.
Returns:
the minimum length of the last segment
See Also:
setMinimumLastSegmentLength(double)

setMinimumSegmentLength

public void setMinimumSegmentLength(double length)
Specifies the minimum segment length of an edge.

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

 
The final segment length also depends on the used grid size (see OrthogonalLayouter.setGrid(int)). If the grid is larger than the specified minimum length, then the grid size defines the actual minimum.
Default Value:
The default value is 15.0.
Parameters:
length - the minimum segment length.
Throws:
java.lang.IllegalArgumentException - if the minimum length is negative
Sample Graphs:

Minimum segment length 15

Minimum segment length 30

getMinimumSegmentLength

public double getMinimumSegmentLength()
Returns the minimum segment length of an edge.

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

 
The final segment length also depends on the used grid size (see OrthogonalLayouter.setGrid(int)). If the grid is larger than the specified minimum length, then the grid size defines the actual minimum.
Returns:
the minimum segment length
See Also:
setMinimumSegmentLength(double)

createCopy

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

Returns:
a copy of this EdgeLayoutDescriptor instance

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