|
Search this API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.layout.hierarchic.incremental.DefaultDrawingDistanceCalculator
public class DefaultDrawingDistanceCalculator
This class is a default DrawingDistanceCalculator implementation that is used
by HierarchicLayouter to configure the NodePlacer.
![]() |
![]() |
| Constructor Summary | |
|---|---|
DefaultDrawingDistanceCalculator()
Creates a new instance of DefaultDrawingDistanceCalculator
with default settings. |
|
| Method Summary | |
|---|---|
void |
dispose(LayoutGraph graph,
Layers layers,
LayoutDataProvider ldp)
Disposes of internal data structures. |
double |
getEdge2EdgeDistance()
Returns the minimum distance between two edges. |
double |
getMinDistance(LayoutGraph graph,
Layer layer,
LayoutDataProvider ldp,
Node left,
Node right)
Determines the minimum distance between two Nodes of the same layer. |
double |
getNode2EdgeDistance()
Returns the minimum distance between a Node and an (non-adjacent) Edge. |
double |
getNode2NodeDistance()
Returns the minimum distance between two Nodes. |
void |
initialize(LayoutGraph graph,
Layers layers,
LayoutDataProvider ldp)
Initializes internal data structures. |
boolean |
isAdaptiveMinEdgeDistanceEnabled()
Returns whether or not an adaptive minimum edge distance is used. |
boolean |
isCompactionEnabled()
Returns whether or not the compaction option is enabled. |
boolean |
isSwimLaneDistanceOptimizationEnabled()
Returns whether or not to use an optimized minimum distance calculation for swimlane layouts. |
void |
setAdaptiveMinEdgeDistanceEnabled(boolean adaptiveMinEdgeDistanceEnabled)
Specifies whether or not an adaptive minimum edge distance is used. |
void |
setCompactionEnabled(boolean compactionEnabled)
Specifies whether or not the compaction option is enabled. |
void |
setEdge2EdgeDistance(double edge2EdgeDistance)
Specifies the minimum distance between two edges. |
void |
setNode2EdgeDistance(double node2EdgeDistance)
Specifies the minimum distance between a Node and an (non-adjacent) Edge. |
void |
setNode2NodeDistance(double node2NodeDistance)
Specifies the minimum distance between two Nodes. |
void |
setSwimLaneDistanceOptimizationEnabled(boolean enabled)
Specifies whether or not to use an optimized minimum distance calculation for swimlane layouts. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultDrawingDistanceCalculator()
DefaultDrawingDistanceCalculator
with default settings.
| Method Detail |
|---|
public void initialize(LayoutGraph graph,
Layers layers,
LayoutDataProvider ldp)
DrawingDistanceCalculatorImplementations may cache lengthy calculations in the initialization phase.
initialize in interface DrawingDistanceCalculatorgraph - the input graph that contains all elements that are used during the node placementlayers - the Layers object that will be used during subsequent callsldp - the LayoutDataProvider implementation which provides access to the NodeData and
EdgeData instancesDrawingDistanceCalculator.dispose(LayoutGraph, Layers, LayoutDataProvider)
public void dispose(LayoutGraph graph,
Layers layers,
LayoutDataProvider ldp)
DrawingDistanceCalculatorImplementations should release internally held data structures when they are not needed any more.
dispose in interface DrawingDistanceCalculatorgraph - the input graph that contains all elements that are used during the node placementlayers - the Layers object that will be used during subsequent callsldp - the LayoutDataProvider implementation which provides access to the NodeData and
EdgeData instancesDrawingDistanceCalculator.initialize(LayoutGraph, Layers, LayoutDataProvider)public boolean isAdaptiveMinEdgeDistanceEnabled()
If this option is enabled the minimum distance between two adjacent edges is the minimum of the current minimum edge distance and the distance of the edges' source/target points.
true if an adaptive minimum distance should be used, false otherwisesetAdaptiveMinEdgeDistanceEnabled(boolean)public void setAdaptiveMinEdgeDistanceEnabled(boolean adaptiveMinEdgeDistanceEnabled)
If this option is enabled the minimum distance between two adjacent edges is the minimum of the current minimum edge distance and the distance of the edges' source/target points.
adaptiveMinEdgeDistanceEnabled - true if an adaptive minimum distance should be used,
false otherwisepublic boolean isCompactionEnabled()
true if compaction is enabled, false otherwisesetCompactionEnabled(boolean)public void setCompactionEnabled(boolean compactionEnabled)
SimplexNodePlacer.setNodeCompactionEnabled(boolean) or
SimplexNodePlacer.setLabelCompactionEnabled(boolean) is enabled.compactionEnabled - true if compaction is enabled, false otherwise
public double getMinDistance(LayoutGraph graph,
Layer layer,
LayoutDataProvider ldp,
Node left,
Node right)
Nodes of the same layer.
getMinDistance in interface DrawingDistanceCalculatorgraph - the input graphlayer - the Layer object that will be used during subsequent callsldp - the LayoutDataProvider used for querying informationleft - the left of the two Nodes whose minimum distance is to be determined or
null if only the left border of the right Node is of interestright - the right of the two Nodes whose minimum distance is to be determined or
null if only the right border of the left Node is of interest
Nodes of same layerpublic double getNode2NodeDistance()
Nodes.
Minimum distance should be greater than 0.
setNode2NodeDistance(double)public void setNode2NodeDistance(double node2NodeDistance)
Nodes.
Minimum distance should be greater than 0.
public double getNode2EdgeDistance()
Node and an (non-adjacent) Edge.
Minimum distance should be greater than 0.
setNode2EdgeDistance(double)public void setNode2EdgeDistance(double node2EdgeDistance)
Node and an (non-adjacent) Edge.
Minimum distance should be greater than 0.
public double getEdge2EdgeDistance()
Minimum distance should be greater than 0.
public void setEdge2EdgeDistance(double edge2EdgeDistance)
Minimum distance should be greater than 0.
public void setSwimLaneDistanceOptimizationEnabled(boolean enabled)
If set to true this instance will report 0.0d as the minimum distance between two
nodes if they belong to different swimlanes. This avoids unwanted feedback between different swimlanes during
node placement.
enabled - true if modified distance calculation for swimlane layouts should be used,
false otherwisepublic boolean isSwimLaneDistanceOptimizationEnabled()
If set to true this instance will report 0.0d as the minimum distance between two
nodes if they belong to different swimlanes. This avoids unwanted feedback between different swimlanes during
node placement.
true if modified distance calculation for swimlane layouts should be used,
false otherwisesetSwimLaneDistanceOptimizationEnabled(boolean)
|
© Copyright 2000-2025, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||