|
Search this API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.layout.tree.AbstractRotatableNodePlacer
y.layout.tree.AssistantPlacer
public class AssistantPlacer
The assistant placer is a NodePlacer that delegates the node placement to two different node placers depending
on the type of the children.
The type of a child is recognized using a DataProvider providing boolean values. The data provider is registered
using the key ASSISTANT_DPKEY.
Assistant placer uses a LeftRightPlacer for those nodes the DataProvider returns true (they are
understood as "assistants").
Below the assistants the other children are arranged using the childNodePlacer (settable
using setChildNodePlacer(NodePlacer)).
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class y.layout.tree.AbstractRotatableNodePlacer |
|---|
AbstractRotatableNodePlacer.Matrix, AbstractRotatableNodePlacer.RootAlignment |
| Field Summary | |
|---|---|
static Object |
ASSISTANT_DPKEY
Contains a boolean for each node whether it is an assistant or not. |
| 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 | |
|---|---|
AssistantPlacer()
Creates a default instance with horizontal orientation. |
|
AssistantPlacer(AbstractRotatableNodePlacer.Matrix modificationMatrix)
Creates an AssistantPlacer for the given modification matrix. |
|
| Method Summary | |
|---|---|
Comparator |
createComparator()
Creates a comparator that compares edges of two assistant nodes with the comparator created by LeftRightPlacer and all other edges with
the sketch comparator created by this placer's childNodePlacer. |
static Comparator |
createCompoundComparator(Comparator assistantComparator,
Comparator childComparator)
Creates a comparator that compares edges connecting to assistant nodes with the given assistantComparator and all other edges with
the given childComparator. |
Processor |
createProcessor(GenericTreeLayouter layouter,
LayoutGraph graph,
Node currentRoot)
Creates a processor that creates a dummy node and changes the edges for the non-assistant children. |
protected byte |
determineChildConnector(Node child)
This method must be implemented by subclasses. |
void |
determineChildConnectors(Node localRoot,
DataMap connectorMap)
Delegates to the the left right placer. |
NodePlacer |
getChildNodePlacer()
Returns the child node placer for the non-assistant children. |
protected GenericTreeLayouter.SubtreeShape |
getNodeShape(Node node)
Returns the subtree shape for the given child node. |
GenericTreeLayouter.SubtreeShape |
placeSubtree(DataProvider nodeShapeProvider,
DataProvider subtreeShapeProvider,
LayoutGraph graph,
Node localRoot,
byte parentConnectorDirection)
Places the shapes. |
protected y.layout.tree.SubtreeShapeRotated |
placeSubtree(Node localRoot,
byte parentConnectorDirection)
This method must be implemented by subclasses. |
void |
setChildNodePlacer(NodePlacer childNodePlacer)
Sets the child node placer. |
void |
setSpacing(double spacing)
Specifies the spacing between subtrees this NodePlacer is
arranging. |
| Methods inherited from class y.layout.tree.AbstractRotatableNodePlacer |
|---|
createFromSketchComparator, createRootNodeShape, createSubtreeShape, getModificationMatrix, getPortConstraint, getSourcePointAbs, getSpacing, 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 Object ASSISTANT_DPKEY
| Constructor Detail |
|---|
public AssistantPlacer()
public AssistantPlacer(AbstractRotatableNodePlacer.Matrix modificationMatrix)
modificationMatrix - the modification matrix that is used as translation matrix.| Method Detail |
|---|
protected byte determineChildConnector(Node child)
AbstractRotatableNodePlacer
determineChildConnector in class AbstractRotatableNodePlacerchild - the child node
public void determineChildConnectors(Node localRoot,
DataMap connectorMap)
determineChildConnectors in interface NodePlacerdetermineChildConnectors in class AbstractRotatableNodePlacerlocalRoot - connectorMap - AbstractRotatableNodePlacer.determineChildConnector(Node)protected GenericTreeLayouter.SubtreeShape getNodeShape(Node node)
node - the child node the subtree shape is returned for.
public Processor createProcessor(GenericTreeLayouter layouter,
LayoutGraph graph,
Node currentRoot)
createProcessor in interface NodePlacercreateProcessor in class AbstractRotatableNodePlacerlayouter - graph - currentRoot -
public void setSpacing(double spacing)
AbstractRotatableNodePlacerNodePlacer is
arranging.
setSpacing in class AbstractRotatableNodePlacer
public GenericTreeLayouter.SubtreeShape placeSubtree(DataProvider nodeShapeProvider,
DataProvider subtreeShapeProvider,
LayoutGraph graph,
Node localRoot,
byte parentConnectorDirection)
placeSubtree in interface NodePlacerplaceSubtree in class AbstractRotatableNodePlacernodeShapeProvider - subtreeShapeProvider - graph - localRoot - parentConnectorDirection -
AbstractRotatableNodePlacer.placeSubtree(Node, byte)
protected y.layout.tree.SubtreeShapeRotated placeSubtree(Node localRoot,
byte parentConnectorDirection)
AbstractRotatableNodePlacer
placeSubtree in class AbstractRotatableNodePlacerlocalRoot - the local root nodeparentConnectorDirection - the direction of the connector shape
public void setChildNodePlacer(NodePlacer childNodePlacer)
ASSISTANT_DPKEY
childNodePlacer - the node placer that will be used for laying out the non-assistant children.public NodePlacer getChildNodePlacer()
public Comparator createComparator()
LeftRightPlacer and all other edges with
the sketch comparator created by this placer's childNodePlacer.
createComparator in class AbstractRotatableNodePlacersetChildNodePlacer(NodePlacer),
FromSketchNodePlacer.createFromSketchComparator()
public static Comparator createCompoundComparator(Comparator assistantComparator,
Comparator childComparator)
assistantComparator and all other edges with
the given childComparator.
assistantComparator - the comparator for assistant edgeschildComparator - the comparator for non-assistants edges
assistantComparator and all other edges
with the given childComparator.
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||