Search this API

y.layout
Class EdgeBundleDescriptor

java.lang.Object
  extended by y.layout.EdgeBundleDescriptor

public class EdgeBundleDescriptor
extends java.lang.Object

An EdgeBundleDescriptor defines the bundling settings of an edge.

The defined settings will be considered by layout algorithms which support edge bundling.

Each EdgeBundleDescriptor can either be specified for a single edge or shared by several edges. It is assigned to an edge by registering a DataProvider with key EdgeBundling.EDGE_BUNDLE_DESCRIPTOR_DPKEY to the input graph.

 
This descriptor does not represent an ID to define different bundles; two edges associated with different descriptor instances might still be bundled. The descriptor's purpose is to control the basic bundling property of an edge, e.g., whether it should be bundled at all and if the edge is directed or undirected.
See Also:
EdgeBundling, EdgeBundling.EDGE_BUNDLE_DESCRIPTOR_DPKEY
 
Your browser does not support SVG content.

Constructor Summary
EdgeBundleDescriptor()
          Creates a new EdgeBundleDescriptor with default settings.
EdgeBundleDescriptor(EdgeBundleDescriptor descriptor)
          Creates a new EdgeBundleDescriptor representing a copy of the given other descriptor instance.
 
Method Summary
 boolean isBezierFittingEnabled()
          Returns whether or not a bezier curve should be fit to an edge associated to this descriptor.
 boolean isBundled()
          Returns whether or not an edge associated to this descriptor should be bundled.
 boolean isDirectionConsiderationEnabled()
          Returns whether or not the direction of the edge associated to this descriptor should be considered.
 void setBezierFittingEnabled(boolean bezierFittingEnabled)
          Specifies whether or not a bezier curve should be fit to an edge associated to this descriptor.
 void setBundled(boolean bundled)
          Specifies whether or not an edge associated to this descriptor should be bundled.
 void setDirectionConsiderationEnabled(boolean directionConsiderationEnabled)
          Specifies whether or not the direction of the edge associated to this descriptor should be considered.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EdgeBundleDescriptor

public EdgeBundleDescriptor()
Creates a new EdgeBundleDescriptor with default settings.


EdgeBundleDescriptor

public EdgeBundleDescriptor(EdgeBundleDescriptor descriptor)
Creates a new EdgeBundleDescriptor representing a copy of the given other descriptor instance.

Parameters:
descriptor - the descriptor to copy
Method Detail

isDirectionConsiderationEnabled

public boolean isDirectionConsiderationEnabled()
Returns whether or not the direction of the edge associated to this descriptor should be considered.

During the bundling procedure, the edges are bundled based on their direction such that the incoming edges of a node are bundled separately from its outgoing edges. If the direction of edges adjacent to a node is not considered, then they are not bundled separately.

If the direction of some edges is taken into consideration while the direction of some others (adjacent to the same node) is ignored, the undirected edges are also bundled separately. This is done to distinguish them from the incoming and outgoing edges of the particular node.

 
For EdgeBundlingStage, this property does not affect the result because all edges are always considered to be undirected.
Returns:
true if the direction of the edge is considered, false otherwise
See Also:
setDirectionConsiderationEnabled(boolean)

setDirectionConsiderationEnabled

public void setDirectionConsiderationEnabled(boolean directionConsiderationEnabled)
Specifies whether or not the direction of the edge associated to this descriptor should be considered.

During the bundling procedure, the edges are bundled based on their direction such that the incoming edges of a node are bundled separately from its outgoing edges. If the direction of edges adjacent to a node is not considered, then they are not bundled separately.

If the direction of some edges is taken into consideration while the direction of some others (adjacent to the same node) is ignored, the undirected edges are also bundled separately. This is done to distinguish them from the incoming and outgoing edges of the particular node.

 
For EdgeBundlingStage, this property does not affect the result because all edges are always considered to be undirected.
Default Value:
The default value is true. The direction of the edge is considered.
Parameters:
directionConsiderationEnabled - true if the direction of the edge should be considered, false otherwise
Sample Graphs:

false

true

isBundled

public boolean isBundled()
Returns whether or not an edge associated to this descriptor should be bundled.

 
If an edge should not be bundled, the other settings of this descriptor will be ignored.
Default Value:
The default value is false. Bundling is disabled.
Returns:
true if an edge associated to this descriptor is bundled, false otherwise
See Also:
setBundled(boolean)

setBundled

public void setBundled(boolean bundled)
Specifies whether or not an edge associated to this descriptor should be bundled.

 
If an edge should not be bundled, the other settings of this descriptor will be ignored.
Parameters:
bundled - true if an edge associated to this descriptor should be bundled, false otherwise

isBezierFittingEnabled

public boolean isBezierFittingEnabled()
Returns whether or not a bezier curve should be fit to an edge associated to this descriptor.

If disabled, the edges resemble B-splines where points of the path are actually curve points. Therefore, this representation requires a high number of bends to model curves.

If this feature is enabled, a bezier curve is fitted to the start and end point as well as the intermediate control points of the edge. After the fitting, the points of the edge can be interpreted as cubic bezier control points. Each four consecutive points form a bezier curve, where the first and last of the four points represent the start and end of the curve and the second and third point are the control points defining how the curve looks. The second and third point do not necessarily lie on the actual curve.

 
Enabling bezier fitting will likely reduce the number of bend points necessary to model the curved edge path significantly.
 
When visualizing a fitted edge, the control points should not simply be connected by straight-line segments. This may lead to bad results, i.e., wrong paths. The points need to be interpreted as cubic bezier control points as described above.
Returns:
true if a bezier curve is fitted to an edge associated with this descriptor, false otherwise
See Also:
setBezierFittingEnabled(boolean)

setBezierFittingEnabled

public void setBezierFittingEnabled(boolean bezierFittingEnabled)
Specifies whether or not a bezier curve should be fit to an edge associated to this descriptor.

If disabled, the edges resemble B-splines where points of the path are actually curve points. Therefore, this representation requires a high number of bends to model curves.

If this feature is enabled, a bezier curve is fitted to the start and end point as well as the intermediate control points of the edge. After the fitting, the points of the edge can be interpreted as cubic bezier control points. Each four consecutive points form a bezier curve, where the first and last of the four points represent the start and end of the curve and the second and third point are the control points defining how the curve looks. The second and third point do not necessarily lie on the actual curve.

 
Enabling bezier fitting will likely reduce the number of bend points necessary to model the curved edge path significantly.
 
When visualizing a fitted edge, the control points should not simply be connected by straight-line segments. This may lead to bad results, i.e., wrong paths. The points need to be interpreted as cubic bezier control points as described above.
Default Value:
The default value is false. Edges resemble B-splines.
Parameters:
bezierFittingEnabled - true if a bezier curve should be fitted to an edge associated with this descriptor, false otherwise

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