Search this API

y.layout.router.polyline
Class EdgeLayoutDescriptor

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

public class EdgeLayoutDescriptor
extends Object

This class is used by EdgeRouter to determine the routing details of the graph's edges.

See Also:
EdgeRouter.EDGE_LAYOUT_DESCRIPTOR_DPKEY

Field Summary
static byte MONOTONIC_BOTH
          Constant that specifies monotonic path restrictions for edges.
static byte MONOTONIC_HORIZONTAL
          Constant that specifies monotonic path restrictions for edges.
static byte MONOTONIC_NONE
          Constant that specifies monotonic path restrictions for edges.
static byte MONOTONIC_VERTICAL
          Constant that specifies monotonic path restrictions for edges.
 
Constructor Summary
EdgeLayoutDescriptor()
          Creates a new instance of an EdgeLayoutDescriptor using the default values.
 
Method Summary
 EdgeLayoutDescriptor createCopy()
          Creates a copy of this instance.
 double getMinimalEdgeToEdgeDistance()
          Returns the minimal distance between a pair of edges.
 double getMinimalFirstSegmentLength()
          Returns the minimal length of the first segment (at the source).
 double getMinimalLastSegmentLength()
          Returns the minimal length of the last segment (at the target).
 double getMinimalNodeCornerDistance()
          Returns the minimal distance the edge shall keep from node corners when entering or leaving the node.
 byte getMonotonicPathRestriction()
          Returns the monotonic path restrictions for this edge.
 PenaltySettings getPenaltySettings()
          Returns the penalty settings that should be used for this edge.
 void setMinimalEdgeToEdgeDistance(double distance)
          Sets the minimal distance between a pair of edges.
 void setMinimalFirstSegmentLength(double length)
          Sets the minimal length of the first segment (at the source).
 void setMinimalLastSegmentLength(double length)
          Sets the minimal length of the last segment (at the target).
 void setMinimalNodeCornerDistance(double distance)
          Sets the minimal distance the edge shall keep from node corners when entering or leaving the node.
 void setMonotonicPathRestriction(byte restriction)
          Sets the monotonic path restrictions for this edge.
 void setPenaltySettings(PenaltySettings penaltySettings)
          Sets the penalty settings that should be used for this edge.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MONOTONIC_NONE

public static final byte MONOTONIC_NONE
Constant that specifies monotonic path restrictions for edges. This constant specifies that there are no restrictions.

See Also:
setMonotonicPathRestriction(byte), getMonotonicPathRestriction(), Constant Field Values

MONOTONIC_VERTICAL

public static final byte MONOTONIC_VERTICAL
Constant that specifies monotonic path restrictions for edges. This constant specifies restrictions for the vertical direction, i.e., each vertical edge segment is directed from the source to the target.

See Also:
setMonotonicPathRestriction(byte), getMonotonicPathRestriction(), Constant Field Values

MONOTONIC_HORIZONTAL

public static final byte MONOTONIC_HORIZONTAL
Constant that specifies monotonic path restrictions for edges. This constant specifies restrictions for the horizontal direction, i.e., each horizontal edge segment is directed from the source to the target.

See Also:
setMonotonicPathRestriction(byte), getMonotonicPathRestriction(), Constant Field Values

MONOTONIC_BOTH

public static final byte MONOTONIC_BOTH
Constant that specifies monotonic path restrictions for edges. This constant specifies restrictions for the horizontal and vertical direction, i.e., each horizontal as well as each vertical edge segment is directed from the source to the target.

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

EdgeLayoutDescriptor

public EdgeLayoutDescriptor()
Creates a new instance of an EdgeLayoutDescriptor using the default values.

Method Detail

setMinimalFirstSegmentLength

public void setMinimalFirstSegmentLength(double length)
Sets the minimal length of the first segment (at the source). By default this value is set to 5.0. The value must be >= 0, otherwise the default value will be assigned. Note: the resulting segment length also depends on the given grid spacing, i.e., segment length >= (int) Math.ceil(length / grid spacing).

Parameters:
length - The minimal length of the first segment
See Also:
setMinimalLastSegmentLength(double)

getMinimalFirstSegmentLength

public double getMinimalFirstSegmentLength()
Returns the minimal length of the first segment (at the source). Default is 5.0.

Returns:
The length of the first segment
See Also:
getMinimalLastSegmentLength()

setMinimalLastSegmentLength

public void setMinimalLastSegmentLength(double length)
Sets the minimal length of the last segment (at the target). By default this value is set to 10.0. The value must be >= 0, otherwise the default value will be assigned. Note: the resulting segment length also depends on the given grid spacing, i.e., segment length >= (int) Math.ceil(length / grid spacing).

Parameters:
length - The minimal length of the last segment
See Also:
setMinimalFirstSegmentLength(double)

getMinimalLastSegmentLength

public double getMinimalLastSegmentLength()
Returns the minimal length of the last segment (at the target). Default is 10.0.

Returns:
The length of the last segment
See Also:
getMinimalFirstSegmentLength()

getMinimalEdgeToEdgeDistance

public double getMinimalEdgeToEdgeDistance()
Returns the minimal distance between a pair of edges. Default is 3.0.

Returns:
The minimal distance between a pair of edges.

setMinimalEdgeToEdgeDistance

public void setMinimalEdgeToEdgeDistance(double distance)
Sets the minimal distance between a pair of edges. By default this value is set to 3.0.The value must be >= 0, otherwise the default value will be assigned.

Parameters:
distance - The minimal distance between a pair of edges.

getMinimalNodeCornerDistance

public double getMinimalNodeCornerDistance()
Returns the minimal distance the edge shall keep from node corners when entering or leaving the node. Default is 3.0.

Returns:
The minimal distance the edge shall keep from node corners when entering or leaving the node

setMinimalNodeCornerDistance

public void setMinimalNodeCornerDistance(double distance)
Sets the minimal distance the edge shall keep from node corners when entering or leaving the node. By default this value is set to 3.0. The value must be >= 0, otherwise the default value will be assigned.

Parameters:
distance - The minimal distance the edge shall keep from node corners when entering or leaving the node.

getMonotonicPathRestriction

public byte getMonotonicPathRestriction()
Returns the monotonic path restrictions for this edge. The edge can be used with one of the following values: MONOTONIC_HORIZONTAL, MONOTONIC_VERTICAL, MONOTONIC_BOTH, or MONOTONIC_NONE. Default is MONOTONIC_NONE.

Returns:
The monotonic path restrictions for this edge.

setMonotonicPathRestriction

public void setMonotonicPathRestriction(byte restriction)
Sets the monotonic path restrictions for this edge. The edge can be used with one of the following values: MONOTONIC_HORIZONTAL, MONOTONIC_VERTICAL, MONOTONIC_BOTH, or MONOTONIC_NONE.

Parameters:
restriction - The monotonic path restrictions for this edge.

getPenaltySettings

public PenaltySettings getPenaltySettings()
Returns the penalty settings that should be used for this edge.


setPenaltySettings

public void setPenaltySettings(PenaltySettings penaltySettings)
Sets the penalty settings that should be used for this edge.

Parameters:
penaltySettings - The penalty settings that should be used for this edge.

createCopy

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

Returns:
the copy.

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