|
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.AbstractRotatableNodePlacer y.layout.tree.DelegatingNodePlacer
public class DelegatingNodePlacer
The DelegatingNodePlacer may be used to layout the children of the actual
node with two different NodePlacer
s.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class y.layout.tree.AbstractRotatableNodePlacer |
---|
AbstractRotatableNodePlacer.Matrix, AbstractRotatableNodePlacer.RootAlignment |
Field Summary | |
---|---|
static byte |
HORIZONTAL
Orientation specifier. |
static byte |
VERTICAL
Orientation specifier. |
Fields inherited from class y.layout.tree.AbstractRotatableNodePlacer |
---|
createdChildren, graph, modificationMatrix, nodeShapeProvider, spacing, subtreeShapeProvider |
Fields inherited from interface y.layout.tree.NodePlacer |
---|
DIRECTION_ANY, DIRECTION_EAST, DIRECTION_NONE, DIRECTION_NORTH, DIRECTION_SOUTH, DIRECTION_WEST |
Constructor Summary | |
---|---|
DelegatingNodePlacer(AbstractRotatableNodePlacer.Matrix modificationMatrix,
NodePlacer placerUpperLeft,
NodePlacer placerLowerRight)
Creates a new instance using the given modification matrix an the node placers "this" delegates to. |
Method Summary | |
---|---|
Processor |
createProcessor(GenericTreeLayouter layouter,
LayoutGraph graph,
Node currentRoot)
Creates a processor that partitions child nodes of the specified root node into two subsets, one to be arranged by the "upper left" NodePlacer and one to be arranged by the "lower right"
NodePlacer . |
protected byte |
determineChildConnector(Node child)
This method must be implemented by subclasses. |
void |
determineChildConnectors(Node localRoot,
DataMap connectorMap)
This method initializes internal data structures, then uses the abstract method AbstractRotatableNodePlacer.determineChildConnector(y.base.Node)
to determine the child node connector directions. |
protected NodeList |
getLowerRightChildren(Node localRoot)
Determines the lower right children of the specified root node. |
byte |
getOrientation()
Returns the orientation according to which node shapes are aligned by this placer. |
NodePlacer |
getPlacerLowerRight()
Returns the NodePlacer that is used to layout the nodes on
the "lower right" |
NodePlacer |
getPlacerUpperLeft()
Returns the NodePlacer that is used to layout the nodes on
the "upper left" |
protected NodeList |
getUpperLeftChildren(Node localRoot)
Determines the upper left children of the specified root node. |
GenericTreeLayouter.SubtreeShape |
placeSubtree(DataProvider nodeShapeProvider,
DataProvider subtreeShapeProvider,
LayoutGraph graph,
Node localRoot,
byte parentConnectorDirection)
Places the shapes of the children using the two node placers getUpperLeftChildren(y.base.Node) and
getLowerRightChildren(y.base.Node) . |
protected y.layout.tree.SubtreeShapeRotated |
placeSubtree(Node localRoot,
byte parentConnectorDirection)
This method must be implemented by subclasses. |
void |
setOrientation(byte orientation)
Specifies the orientation according to which node shapes are aligned by this placer. |
Methods inherited from class y.layout.tree.AbstractRotatableNodePlacer |
---|
createComparator, createFromSketchComparator, createRootNodeShape, createSubtreeShape, getModificationMatrix, getPortConstraint, getSourcePointAbs, getSpacing, setSpacing, translateDirectionToModel, translateDirectionToReal, translatePoint |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final byte HORIZONTAL
setOrientation(byte)
,
getOrientation()
,
Constant Field Valuespublic static final byte VERTICAL
setOrientation(byte)
,
getOrientation()
,
Constant Field ValuesConstructor Detail |
---|
public DelegatingNodePlacer(AbstractRotatableNodePlacer.Matrix modificationMatrix, NodePlacer placerUpperLeft, NodePlacer placerLowerRight)
Method Detail |
---|
public Processor createProcessor(GenericTreeLayouter layouter, LayoutGraph graph, Node currentRoot)
NodePlacer
and one to be arranged by the "lower right"
NodePlacer
.
createProcessor
in interface NodePlacer
createProcessor
in class AbstractRotatableNodePlacer
graph
- the actual graphcurrentRoot
- the actual root node for this node placer
getPlacerLowerRight()
,
getPlacerUpperLeft()
public void determineChildConnectors(Node localRoot, DataMap connectorMap)
AbstractRotatableNodePlacer
AbstractRotatableNodePlacer.determineChildConnector(y.base.Node)
to determine the child node connector directions.
determineChildConnectors
in interface NodePlacer
determineChildConnectors
in class AbstractRotatableNodePlacer
localRoot
- the local root nodeconnectorMap
- the map that will be used to store the valuesAbstractRotatableNodePlacer.determineChildConnector(Node)
public GenericTreeLayouter.SubtreeShape placeSubtree(DataProvider nodeShapeProvider, DataProvider subtreeShapeProvider, LayoutGraph graph, Node localRoot, byte parentConnectorDirection)
getUpperLeftChildren(y.base.Node)
and
getLowerRightChildren(y.base.Node)
.
placeSubtree
in interface NodePlacer
placeSubtree
in class AbstractRotatableNodePlacer
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
AbstractRotatableNodePlacer.placeSubtree(Node, byte)
protected NodeList getLowerRightChildren(Node localRoot)
NodePlacer
returned by
getPlacerLowerRight()
.
protected NodeList getUpperLeftChildren(Node localRoot)
NodePlacer
returned by
getPlacerUpperLeft()
.
protected byte determineChildConnector(Node child)
AbstractRotatableNodePlacer
determineChildConnector
in class AbstractRotatableNodePlacer
child
- the child node
NodePlacer
interfaceprotected y.layout.tree.SubtreeShapeRotated placeSubtree(Node localRoot, byte parentConnectorDirection)
AbstractRotatableNodePlacer
placeSubtree
in class AbstractRotatableNodePlacer
localRoot
- the local root nodeparentConnectorDirection
- the direction of the connector shape
public void setOrientation(byte orientation)
orientation
- one of
getOrientation()
public byte getOrientation()
setOrientation(byte)
public NodePlacer getPlacerLowerRight()
NodePlacer
that is used to layout the nodes on
the "lower right"
NodePlacer
that is used to layout the nodes on
the "lower right".public NodePlacer getPlacerUpperLeft()
NodePlacer
that is used to layout the nodes on
the "upper left"
NodePlacer
that is used to layout the nodes on
the "upper left"
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |