|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecty.layout.tree.AbstractNodePlacer
public abstract class AbstractNodePlacer
Utility class that serves as a basis for implementations of the
NodePlacer
interface. It provides convenience methods for
often used sub tasks during a layout.
Subclasses need to override the two abstract methods only.
Field Summary | |
---|---|
protected LayoutGraph |
graph
The graph instance this class is working on |
Fields inherited from interface y.layout.tree.NodePlacer |
---|
DIRECTION_ANY, DIRECTION_EAST, DIRECTION_NONE, DIRECTION_NORTH, DIRECTION_SOUTH, DIRECTION_WEST |
Constructor Summary | |
---|---|
AbstractNodePlacer()
Creates a new instance of AbstractNodePlacer |
Method Summary | |
---|---|
Object |
clone()
Overwritten to support cloning. |
Processor |
createProcessor(GenericTreeLayouter layouter,
LayoutGraph graph,
Node currentRoot)
Creates an optional Processor for pre- and post-processing. |
protected abstract byte |
determineChildConnector(Node child)
This method must be implemented by subclasses. |
void |
determineChildConnectors(Node localRoot,
DataMap connectorMap)
This method initializes internal data structures and then uses the abstract method to determine the child node connector directions. |
protected GenericTreeLayouter.SubtreeShape |
getNodeShape(Node node)
Convenience method that queries the DataProvider for the shape of a single node as a SubtreeShape instance. |
protected GenericTreeLayouter.SubtreeShape |
getSubtreeShape(Node node)
Convenience method that queries the DataProvider for a SubtreeShape. |
GenericTreeLayouter.SubtreeShape |
placeSubtree(DataProvider nodeShapeProvider,
DataProvider subtreeShapeProvider,
LayoutGraph graph,
Node localRoot,
byte parentConnectorDirection)
This method initializes the local data structures and then delegates the work to the abstract variant. |
protected abstract GenericTreeLayouter.SubtreeShape |
placeSubtree(Node localRoot,
byte parentConnectorDirection)
The main placeSubtree method that must be implemented by subclasses. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected LayoutGraph graph
Constructor Detail |
---|
public AbstractNodePlacer()
Method Detail |
---|
public Processor createProcessor(GenericTreeLayouter layouter, LayoutGraph graph, Node currentRoot)
createProcessor
in interface NodePlacer
layouter
- graph
- the actual graphcurrentRoot
- the actual root node for this node placer
protected GenericTreeLayouter.SubtreeShape getSubtreeShape(Node node)
placeSubtree(Node, byte)
node
- the root node whose subtree shape will be returned in the form of a SubtreeShape instance
protected GenericTreeLayouter.SubtreeShape getNodeShape(Node node)
placeSubtree(Node, byte)
node
- the node whose shape will be returned in the form of a SubtreeShape instance
public void determineChildConnectors(Node localRoot, DataMap connectorMap)
determineChildConnectors
in interface NodePlacer
localRoot
- the local root nodeconnectorMap
- the map that will be used to store the valuesdetermineChildConnector(Node)
protected abstract byte determineChildConnector(Node child)
child
- the child node
NodePlacer
interfaceprotected abstract GenericTreeLayouter.SubtreeShape placeSubtree(Node localRoot, byte parentConnectorDirection)
localRoot
- the local root nodeparentConnectorDirection
- the direction of the connector shape
public GenericTreeLayouter.SubtreeShape placeSubtree(DataProvider nodeShapeProvider, DataProvider subtreeShapeProvider, LayoutGraph graph, Node localRoot, byte parentConnectorDirection)
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
placeSubtree(Node, byte)
public Object clone()
clone
in class Object
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |