|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.layout.hierarchic.incremental.DefaultDrawingDistanceCalculator
public class DefaultDrawingDistanceCalculator
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)
Called to dispose internal data structures. |
double |
getEdge2EdgeDistance()
Returns the minimum distance between two edges. |
double |
getMinDistance(LayoutGraph graph,
Layer layer,
LayoutDataProvider ldp,
Node left,
Node right)
Main interface method. |
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)
Called to initialize internal data structures. |
boolean |
isAdaptiveMinEdgeDistanceEnabled()
Returns whether or not an adaptive minimum edge distance should be used. |
boolean |
isSwimLaneDistanceOptimizationEnabled()
Returns whether the optimized minimum distance calculation for swim lane layouts is enabled. |
void |
setAdaptiveMinEdgeDistanceEnabled(boolean adaptiveMinEdgeDistanceEnabled)
Specifies whether or not an adaptive minimum edge distance should be used. |
void |
setEdge2EdgeDistance(double edge2EdgeDistance)
Sets the minimum distance between two edges. |
void |
setNode2EdgeDistance(double node2EdgeDistance)
Sets the minimum distance between a node and an (non-adjacent) edge. |
void |
setNode2NodeDistance(double node2NodeDistance)
Sets the minimum distance between two nodes. |
void |
setSwimLaneDistanceOptimizationEnabled(boolean enabled)
Specifies whether or not to use an optimized minimum distance calculation for swim lane layouts. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultDrawingDistanceCalculator()
Method Detail |
---|
public void initialize(LayoutGraph graph, Layers layers, LayoutDataProvider ldp)
DrawingDistanceCalculator
DrawingDistanceCalculator.getMinDistance(LayoutGraph, Layer, LayoutDataProvider, Node, Node)
.
initialize
in interface DrawingDistanceCalculator
graph
- the graph that contains all elements that are used during
the node placementlayers
- the Layers object that will be used during subsequent callsldp
- the LayoutDataProvider that can be used to query informationDrawingDistanceCalculator.dispose(LayoutGraph, Layers, LayoutDataProvider)
public void dispose(LayoutGraph graph, Layers layers, LayoutDataProvider ldp)
DrawingDistanceCalculator
dispose
in interface DrawingDistanceCalculator
graph
- the graph that contains all elements that are used during
the node placementlayers
- the Layers object that was usedldp
- the LayoutDataProvider that was used to query informationDrawingDistanceCalculator.initialize(LayoutGraph, Layers, LayoutDataProvider)
public boolean isAdaptiveMinEdgeDistanceEnabled()
setAdaptiveMinEdgeDistanceEnabled(boolean)
public void setAdaptiveMinEdgeDistanceEnabled(boolean adaptiveMinEdgeDistanceEnabled)
adaptiveMinEdgeDistanceEnabled
- whether or not an adaptive minimum edge distance should be used.public double getMinDistance(LayoutGraph graph, Layer layer, LayoutDataProvider ldp, Node left, Node right)
DrawingDistanceCalculator
NodePlacer
instances to determine
the minimum distances between elements in one layer. Note that either of the Node
arguments may be null
. In that case only the border of the non-null
node should be considered.
getMinDistance
in interface DrawingDistanceCalculator
graph
- the graph that contains the nodeslayer
- the layer object that contains the nodesldp
- the LayoutDataProvider that can be used to query informationleft
- the left one of the two nodes whose
minimum distance is to be determined or null
if only the left border of the right node is
of interest.right
- the right one 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.public double getNode2NodeDistance()
30.0d
.
public void setNode2NodeDistance(double node2NodeDistance)
node2NodeDistance
- the new minimum distance.public double getNode2EdgeDistance()
15.0d
.
public void setNode2EdgeDistance(double node2EdgeDistance)
node2EdgeDistance
- the new minimum distancepublic double getEdge2EdgeDistance()
20.0d
.
public void setEdge2EdgeDistance(double edge2EdgeDistance)
edge2EdgeDistance
- the new minimum distancepublic void setSwimLaneDistanceOptimizationEnabled(boolean enabled)
true
this instance will report 0.0d
as the minimum distance between two nodes if they belong to different swim
lanes. This avoids unwanted feedback between different swim lanes during
node placement.
enabled
- whether to enable the modified distance calculation for swim
lane layouts.public boolean isSwimLaneDistanceOptimizationEnabled()
true
this instance will report 0.0d
as the minimum distance between two nodes if they belong to different swim
lanes. This avoids unwanted feedback between different swim lanes during
node placement.
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |