Search this API

y.layout.hierarchic.incremental
Class EdgeLayoutDescriptor

java.lang.Object
  extended by y.layout.hierarchic.incremental.EdgeLayoutDescriptor

public class EdgeLayoutDescriptor
extends Object

This class is used by HierarchicLayouter during the various phases to determine the routing details of the graph's edges.
Note: not all of these values will be used for all kinds of edges and any kind of algorithm.
This class is designed as a class to allow for future additions of new getter methods.

See Also:
HierarchicLayouter.EDGE_LAYOUT_DESCRIPTOR_DPKEY, NodeLayoutDescriptor

Constructor Summary
EdgeLayoutDescriptor()
          Creates a new instance of an EdgeLayoutDescriptor using the default values.
 
Method Summary
 double getMinimumDistance()
          Returns the preferred minimum distance of the edge to obstacles.
 double getMinimumFirstSegmentLength()
          Returns the minimum length of the first segment (at the source).
 double getMinimumLastSegmentLength()
          Returns the minimum length of the last segment (at the target).
 double getMinimumLength()
          Returns the minimum length of the edge if the edge does not contain any This is used for polyline routing.
 double getMinimumSlope()
          Returns the minimum slope this edge's mid-segments should have if the edge is routed polygonal in vertical layouts.
 double getMinOctilinearSegmentLength()
          Returns the minimum length of octilinear segments for this edge.
 RoutingStyle getRoutingStyle()
          Returns the routing style for this edge.
 boolean isOrthogonallyRouted()
          Deprecated. Replaced by getRoutingStyle().
 boolean isSourcePortOptimizationEnabled()
          Returns whether source port optimization is enabled, i.e. whether the algorithm should try to find a better source PortConstraint if the current constraint is null or PortConstraint.ANY_SIDE.
 boolean isTargetPortOptimizationEnabled()
          Returns whether target port optimization is enabled, i.e. whether the algorithm should try to find a better target PortConstraint if the current constraint is null or PortConstraint.ANY_SIDE.
 void setMinimumDistance(double distance)
          Sets the preferred minimum distance to obstacles.
 void setMinimumFirstSegmentLength(double length)
          Sets the minimum length of the first segment (at the source).
 void setMinimumLastSegmentLength(double length)
          Sets the minimum length of the last segment (at the target).
 void setMinimumLength(double length)
          Sets the minimum length of the edge.
 void setMinimumSlope(double slope)
          Sets the minimum slope this edge's mid-segments should have if the edge is routed polygonal in vertical layouts.
 void setMinOctilinearSegmentLength(double minOctilinearSegmentLength)
          Specifies the minimum length of octilinear segments for this edge.
 void setOrthogonallyRouted(boolean orthogonal)
          Deprecated. Replaced by setRoutingStyle(RoutingStyle).
 void setRoutingStyle(RoutingStyle routingStyle)
          Specifies the routing style for this edge.
 void setSourcePortOptimizationEnabled(boolean enable)
          Determines whether source port optimization is enabled, i.e. whether the algorithm should try to find a better source PortConstraint if the current constraint is null or PortConstraint.ANY_SIDE.
 void setTargetPortOptimizationEnabled(boolean enable)
          Determines whether target port optimization is enabled, i.e. whether the algorithm should try to find a better target PortConstraint if the current constraint is null or PortConstraint.ANY_SIDE.
 
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 an EdgeLayoutDescriptor using the default values.

Method Detail

setMinimumFirstSegmentLength

public void setMinimumFirstSegmentLength(double length)
Sets the minimum length of the first segment (at the source). If the value is 0.0d the first segment does not need to be orthogonal.

Parameters:
length - the minimum length of the first orthogonally routed segment

getMinimumFirstSegmentLength

public double getMinimumFirstSegmentLength()
Returns the minimum length of the first segment (at the source). If the value is 0.0d the first segment does not need to be orthogonal. Default is 10.0d.

Returns:
the length of the first orthogonally routed segment

setMinimumLastSegmentLength

public void setMinimumLastSegmentLength(double length)
Sets the minimum length of the last segment (at the target). If the value is 0.0d the last segment does not need to be orthogonal.

Parameters:
length - the minimum length of the last orthogonally routed segment

getMinimumLastSegmentLength

public double getMinimumLastSegmentLength()
Returns the minimum length of the last segment (at the target). If the value is 0.0d the last segment does not need to be orthogonal. Default is 15.0d.

Returns:
the length of the last orthogonally routed segment

setMinimumLength

public void setMinimumLength(double length)
Sets the minimum length of the edge. This is used for polyline routing. It describes the minimum vertical length of the mid segment (the one that may be routed non-orthogonally).

Parameters:
length - the minimum height of the mid segment

getMinimumLength

public double getMinimumLength()
Returns the minimum length of the edge if the edge does not contain any This is used for polyline routing. It describes the minimum vertical length of the mid segment (the one that may be routed non-orthogonally). Default is 20.0d.

Returns:
the minimum length of the edge

setMinimumDistance

public void setMinimumDistance(double distance)
Sets the preferred minimum distance to obstacles.

Parameters:
distance - the minimum distance to obstacles

getMinimumDistance

public double getMinimumDistance()
Returns the preferred minimum distance of the edge to obstacles. Default is 10.0d.

Returns:
the preferred minimum distance to obstacles

setMinimumSlope

public void setMinimumSlope(double slope)
Sets the minimum slope this edge's mid-segments should have if the edge is routed polygonal in vertical layouts.

Default is 0.3d.

Parameters:
slope - the minimum slope of the mid-segments.

getMinimumSlope

public double getMinimumSlope()
Returns the minimum slope this edge's mid-segments should have if the edge is routed polygonal in vertical layouts.

Default is 0.3d.

Returns:
the minimum preferred slope.

isSourcePortOptimizationEnabled

public boolean isSourcePortOptimizationEnabled()
Returns whether source port optimization is enabled, i.e. whether the algorithm should try to find a better source PortConstraint if the current constraint is null or PortConstraint.ANY_SIDE. Default is false, which will result in ports being placed at the side of the node which lies closest to the target of the edge in terms of layering.

Returns:
whether to allow port constraint optimization for the source port

setSourcePortOptimizationEnabled

public void setSourcePortOptimizationEnabled(boolean enable)
Determines whether source port optimization is enabled, i.e. whether the algorithm should try to find a better source PortConstraint if the current constraint is null or PortConstraint.ANY_SIDE.

Parameters:
enable - whether to enable port constraint optimization for the source port

isTargetPortOptimizationEnabled

public boolean isTargetPortOptimizationEnabled()
Returns whether target port optimization is enabled, i.e. whether the algorithm should try to find a better target PortConstraint if the current constraint is null or PortConstraint.ANY_SIDE. Default is false, which will result in ports being placed at the side of the node which lies closest to the source of the edge in terms of layering.

Returns:
whether to allow port constraint optimization for the target port

setTargetPortOptimizationEnabled

public void setTargetPortOptimizationEnabled(boolean enable)
Determines whether target port optimization is enabled, i.e. whether the algorithm should try to find a better target PortConstraint if the current constraint is null or PortConstraint.ANY_SIDE.

Parameters:
enable - whether to enable port constraint optimization for the source port

setOrthogonallyRouted

public void setOrthogonallyRouted(boolean orthogonal)
Deprecated. Replaced by setRoutingStyle(RoutingStyle).

Determines whether this edge should be routed orthogonally. Default is false. This does not affect the routing of bus-like structures.

Parameters:
orthogonal - whether to route this edge orthogonally

isOrthogonallyRouted

public boolean isOrthogonallyRouted()
Deprecated. Replaced by getRoutingStyle().

Determines whether this edge should be routed orthogonally. Default is false. This does not affect the routing of bus-like structures.

Returns:
whether to route this edge orthogonally.

getRoutingStyle

public RoutingStyle getRoutingStyle()
Returns the routing style for this edge.

Returns:
the routing style for this edge.
See Also:
RoutingStyle

setRoutingStyle

public void setRoutingStyle(RoutingStyle routingStyle)
Specifies the routing style for this edge.

Parameters:
routingStyle - the routing style for this edge.
See Also:
RoutingStyle

getMinOctilinearSegmentLength

public double getMinOctilinearSegmentLength()
Returns the minimum length of octilinear segments for this edge. Note: the layout algorithm cannot always maintain the specified minimum length.

Default is 20.0d.

Returns:
the minimum length of octilinear segment.
See Also:
getRoutingStyle()

setMinOctilinearSegmentLength

public void setMinOctilinearSegmentLength(double minOctilinearSegmentLength)
Specifies the minimum length of octilinear segments for this edge. Note: the layout algorithm cannot always maintain the specified minimum length.

Default is 20.0d.

Parameters:
minOctilinearSegmentLength - the minimum length of octilinear segment.
See Also:
setRoutingStyle(RoutingStyle)

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