|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.layout.tree.DendrogramPlacer
public class DendrogramPlacer
This is an implementation of the NodePlacer
interface that
can be used to create dendrogram-like tree layouts.
This placer arranges nodes from top to bottom.
It arranges subtrees in such a way that all subtrees of a single local root align at their bottom border.
This implementation does not support PortConstraint
s.
Field Summary |
---|
Fields inherited from interface y.layout.tree.NodePlacer |
---|
DIRECTION_ANY, DIRECTION_EAST, DIRECTION_NONE, DIRECTION_NORTH, DIRECTION_SOUTH, DIRECTION_WEST |
Constructor Summary | |
---|---|
DendrogramPlacer()
|
Method Summary | |
---|---|
Comparator |
createComparator()
Creates a comparator that can be used to do a from sketch layout. |
Comparator |
createFromSketchComparator()
Creates a comparator for edges. |
Processor |
createProcessor(GenericTreeLayouter layouter,
LayoutGraph graph,
Node currentRoot)
Creates an optional Processor for pre- and post-processing. |
void |
determineChildConnectors(Node localRoot,
DataMap connectorMap)
This method is called by GenericTreeLayouter before the subtree shapes of this local root node's children are calculated. |
double |
getMinimumRootDistance()
Returns the distance between the root shape and the bus connecting all of its subtrees. |
double |
getMinimumSubtreeDistance()
Returns the distance between two adjacent subtree shapes. |
GenericTreeLayouter.SubtreeShape |
placeSubtree(DataProvider nodeShapeProvider,
DataProvider subtreeShapeProvider,
LayoutGraph graph,
Node localRoot,
byte parentConnectorDirection)
The main method of the tree layout algorithm. |
void |
setMinimumRootDistance(double minimumRootDistance)
Sets the distance between the root shape and the bus connecting all of its subtrees. |
void |
setMinimumSubtreeDistance(double minimumSubtreeDistance)
Sets the distance between two adjacent subtree shapes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DendrogramPlacer()
Method Detail |
---|
public double getMinimumRootDistance()
30
.
public void setMinimumRootDistance(double minimumRootDistance)
30
.
minimumRootDistance
- the distance between the root and the subtree bus.public double getMinimumSubtreeDistance()
30
.
public void setMinimumSubtreeDistance(double minimumSubtreeDistance)
30
.
minimumSubtreeDistance
- the horizontal distance between two subtree shapes.public void determineChildConnectors(Node localRoot, DataMap connectorMap)
NodePlacer
determineChildConnectors
in interface NodePlacer
localRoot
- the local root node whose child nodes will be provided with
a byte constant indicating the direction of the connectorconnectorMap
- the map that should be used for storing the byte constant
with the child nodes.public Comparator createComparator()
GenericTreeLayouter.CHILD_COMPARATOR_DPKEY
this implementation will do a from sketch layout.
public GenericTreeLayouter.SubtreeShape placeSubtree(DataProvider nodeShapeProvider, DataProvider subtreeShapeProvider, LayoutGraph graph, Node localRoot, byte parentConnectorDirection)
NodePlacer
placeSubtree
in interface NodePlacer
nodeShapeProvider
- this instance can be used to obtain an initial shape
of the root node. This shape can then be merged with all the subtrees' shapes
and finally be returned by this method.subtreeShapeProvider
- provides access to the pre-calculated shapes of
the subtrees. It is guaranteed that at the time of the invocation of this
method for every child node the subtree shape has already been calculatedgraph
- the graph which is to be laid outlocalRoot
- the root of the subtree that should be laid out by this methodparentConnectorDirection
- the direction byte constant as it is defined
in this interface, that must be used for initializing the connector of the
localRoot node to the parent node of the localRoot node
public Processor createProcessor(GenericTreeLayouter layouter, LayoutGraph graph, Node currentRoot)
NodePlacer
createProcessor
in interface NodePlacer
graph
- the actual graphcurrentRoot
- the actual root node for this node placer
public Comparator createFromSketchComparator()
FromSketchNodePlacer
createFromSketchComparator
in interface FromSketchNodePlacer
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |