|
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
DelegatingNodePlacer
delegates the arrangement of the children to two different NodePlacer
s.
This NodePlacer
can, for example, be used for creating mind maps or a playing schedule of a sports competition.
There are two subtrees that are placed above and below the root; Both subtrees consist of two subtrees that are placed left and right of their local root
Nested Class Summary |
---|
Nested classes/interfaces inherited from class y.layout.tree.AbstractRotatableNodePlacer |
---|
AbstractRotatableNodePlacer.Matrix, AbstractRotatableNodePlacer.RootAlignment |
Field Summary | |
---|---|
static byte |
HORIZONTAL
Deprecated. |
static java.lang.Object |
LEFT_RIGHT_DPKEY
A DataProvider key for dividing the children into two sets
If there is no DataProvider registered with this key, half of the nodes are placed left of the root and
the remaining nodes are placed right of the root. |
static byte |
VERTICAL
Deprecated. |
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 DefaultNodePlacer instance with default settings using the given modification matrix and the
given node placers as delegates. |
Method Summary | |
---|---|
Processor |
createProcessor(GenericTreeLayouter layouter,
LayoutGraph graph,
Node currentRoot)
Creates a Processor that partitions child nodes of the current root node into two subsets. |
protected byte |
determineChildConnector(Node child)
Determines a connector direction for the given child node. |
void |
determineChildConnectors(Node localRoot,
DataMap connectorMap)
Does nothing. |
protected NodeList |
getLowerRightChildren(Node localRoot,
LayoutGraph graph)
Returns all lower-right children of the local root node. |
byte |
getOrientation()
Deprecated. |
NodePlacer |
getPlacerLowerRight()
Returns the NodePlacer instance that will arrange the lower-right part of the graph. |
NodePlacer |
getPlacerUpperLeft()
Returns the NodePlacer instance that will arrange the upper-left part of the graph. |
protected NodeList |
getUpperLeftChildren(Node localRoot,
LayoutGraph graph)
Returns all upper-left children of the local root node. |
GenericTreeLayouter.SubtreeShape |
placeSubtree(DataProvider nodeShapeProvider,
DataProvider subtreeShapeProvider,
LayoutGraph graph,
Node localRoot,
byte parentConnectorDirection)
Places the GenericTreeLayouter.SubtreeShape s of the child nodes using the two delegate node placers retrieved with
getPlacerUpperLeft() and getPlacerLowerRight() . |
protected y.layout.tree.SubtreeShapeRotated |
placeSubtree(Node localRoot,
byte parentConnectorDirection)
Arranges the local root relative to the subtree shape of its children. |
void |
setOrientation(byte orientation)
Deprecated. |
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)
,
Constant Field Valuespublic static final byte VERTICAL
setOrientation(byte)
,
Constant Field Valuespublic static final java.lang.Object LEFT_RIGHT_DPKEY
DataProvider
key for dividing the children into two sets
If there is no DataProvider
registered with this key, half of the nodes are placed left of the root and
the remaining nodes are placed right of the root.
Constructor Detail |
---|
public DelegatingNodePlacer(AbstractRotatableNodePlacer.Matrix modificationMatrix, NodePlacer placerUpperLeft, NodePlacer placerLowerRight)
DefaultNodePlacer
instance with default settings using the given modification matrix and the
given node placers as delegates.
modificationMatrix
- the transformation matrixplacerUpperLeft
- the first delegate NodePlacer
which places the left subtreesplacerLowerRight
- the second delegate NodePlacer
which places the right subtrees
java.lang.IllegalArgumentException
- if the given transformation matrix is null
LEFT_RIGHT_DPKEY
Method Detail |
---|
public Processor createProcessor(GenericTreeLayouter layouter, LayoutGraph graph, Node currentRoot)
Processor
that partitions child nodes of the current root node into two subsets.
In a pre-processing step the child nodes are divided into an upper-left and a lower-right subset. The first set
is arranged using the first delegate
, the second set is arranged using
the second delegate
. To be able to delegate to different NodePlacer
s this
Processor
adds dummy nodes to which it assigns the according NodePlacer
s.
The changes to the graph are restored in the post-processing step.
createProcessor
in interface NodePlacer
createProcessor
in class AbstractRotatableNodePlacer
layouter
- the current GenericTreeLayouter
instancegraph
- the input graphcurrentRoot
- the root node handled by this NodePlacer
null
getPlacerLowerRight()
,
getPlacerUpperLeft()
public void determineChildConnectors(Node localRoot, DataMap connectorMap)
DelegatingNodePlacer
always places one part of the tree on one side and the
remaining tree on the opposite side, it doesn't need to calculate the directions of the connectors.
determineChildConnectors
in interface NodePlacer
determineChildConnectors
in class AbstractRotatableNodePlacer
localRoot
- the local root nodeconnectorMap
- the map that must be used for storing the direction specifiers of the child nodesAbstractRotatableNodePlacer.determineChildConnector(Node)
public GenericTreeLayouter.SubtreeShape placeSubtree(DataProvider nodeShapeProvider, DataProvider subtreeShapeProvider, LayoutGraph graph, Node localRoot, byte parentConnectorDirection)
GenericTreeLayouter.SubtreeShape
s of the child nodes using the two delegate node placers retrieved with
getPlacerUpperLeft()
and getPlacerLowerRight()
.
placeSubtree
in interface NodePlacer
placeSubtree
in class AbstractRotatableNodePlacer
nodeShapeProvider
- the DataProvider
for obtaining an initial shape of the root nodesubtreeShapeProvider
- the DataProvider
for accessing the pre-calculated shapes of the subtreesgraph
- the input graphlocalRoot
- the root of the subtree that should be arranged by this methodparentConnectorDirection
- the direction specifier for the connector of the local root node to its parent node
GenericTreeLayouter.SubtreeShape
for the subtree rooted at the local root nodeAbstractRotatableNodePlacer.placeSubtree(Node, byte)
protected NodeList getLowerRightChildren(Node localRoot, LayoutGraph graph)
Which children belong to this list is determined using the DataProvider
registered with
LEFT_RIGHT_DPKEY
. If no such DataProvider
is registered, the second half of the children is
returned.
These children are placed using the NodePlacer
returned by getPlacerLowerRight()
.
localRoot
- the local root nodegraph
- the input graph
Node
sLEFT_RIGHT_DPKEY
protected NodeList getUpperLeftChildren(Node localRoot, LayoutGraph graph)
Which children belong to this list is determined using the DataProvider
registered with
LEFT_RIGHT_DPKEY
. If no such DataProvider
is registered, the first half of the children is
returned.
These children are placed using the NodePlacer
returned by getPlacerUpperLeft()
.
localRoot
- the local root nodegraph
- the input graph
Node
sLEFT_RIGHT_DPKEY
protected byte determineChildConnector(Node child)
determineChildConnector
in class AbstractRotatableNodePlacer
determineChildConnectors(Node, DataMap)
,
it does not call this method.child
- the child node
NodePlacer
interface
java.lang.IllegalStateException
- if this method is calledprotected y.layout.tree.SubtreeShapeRotated placeSubtree(Node localRoot, byte parentConnectorDirection)
placeSubtree
in class AbstractRotatableNodePlacer
upper-left
and the
lower-right node placer
placeSubtree(DataProvider, DataProvider, LayoutGraph, Node, byte)
.localRoot
- the local root nodeparentConnectorDirection
- the direction specifier for the connector of the local root node to its parent node
java.lang.IllegalStateException
- if this method is calledpublic void setOrientation(byte orientation)
HORIZONTAL
orientation
- one of the valid orientation specifiers
java.lang.IllegalArgumentException
- if the orientation specifier is unknownpublic byte getOrientation()
setOrientation(byte)
public NodePlacer getPlacerLowerRight()
NodePlacer
instance that will arrange the lower-right part of the graph.
NodePlacer
getPlacerUpperLeft()
,
getLowerRightChildren(Node, LayoutGraph)
public NodePlacer getPlacerUpperLeft()
NodePlacer
instance that will arrange the upper-left part of the graph.
NodePlacer
getPlacerLowerRight()
,
getUpperLeftChildren(Node, LayoutGraph)
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |