|
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.GridNodePlacer
public class GridNodePlacer
This NodePlacer arranges nodes into a grid. The grid consists of a number of columns. Rows are filled automatically by the placer. Each row is filled from left to right. When all columns in a row are filled, the next row is created.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class y.layout.tree.AbstractRotatableNodePlacer |
---|
AbstractRotatableNodePlacer.Matrix, AbstractRotatableNodePlacer.RootAlignment |
Field Summary | |
---|---|
static Object |
GRID_DPKEY
Key which can be used to register a data provider that tells the placer in which row a given node should be put into. |
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 | |
---|---|
GridNodePlacer()
Creates a grid placer with the modification matrix AbstractRotatableNodePlacer.Matrix.DEFAULT |
|
GridNodePlacer(AbstractRotatableNodePlacer.Matrix modificationMatrix)
Creates grid placer with a given modification matrix. |
|
GridNodePlacer(AbstractRotatableNodePlacer.Matrix modificationMatrix,
AbstractRotatableNodePlacer.RootAlignment rootAlignment)
Creates grid placer with a given modification matrix and the horizontal alignment of the root. |
Method Summary | |
---|---|
Comparator |
createFromSketchComparator()
Creates a comparator that uses the positions of the target nodes to order edges. |
protected byte |
determineChildConnector(Node child)
Returns NodePlacer.DIRECTION_NORTH . |
AbstractRotatableNodePlacer.RootAlignment |
getRootAlignment()
Returns the horizontal alignment of the root node. |
protected y.layout.tree.SubtreeShapeRotated |
placeSubtree(Node localRoot,
byte parentConnectorDirection)
Places the children in a grid. |
void |
setRootAlignment(AbstractRotatableNodePlacer.RootAlignment rootAlignment)
Sets the horizontal alignment of the root node. |
Methods inherited from class y.layout.tree.AbstractRotatableNodePlacer |
---|
createComparator, createProcessor, createRootNodeShape, createSubtreeShape, determineChildConnectors, getModificationMatrix, getPortConstraint, getSourcePointAbs, getSpacing, placeSubtree, 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 Object GRID_DPKEY
getInt
method.
If no provider is specified, all nodes will be placed in one row.
Constructor Detail |
---|
public GridNodePlacer()
AbstractRotatableNodePlacer.Matrix.DEFAULT
public GridNodePlacer(AbstractRotatableNodePlacer.Matrix modificationMatrix)
public GridNodePlacer(AbstractRotatableNodePlacer.Matrix modificationMatrix, AbstractRotatableNodePlacer.RootAlignment rootAlignment)
Method Detail |
---|
protected byte determineChildConnector(Node child)
NodePlacer.DIRECTION_NORTH
.
determineChildConnector
in class AbstractRotatableNodePlacer
child
- the child node
NodePlacer.DIRECTION_NORTH
.protected y.layout.tree.SubtreeShapeRotated placeSubtree(Node localRoot, byte parentConnectorDirection)
placeSubtree
in class AbstractRotatableNodePlacer
localRoot
- the local root nodeparentConnectorDirection
- the direction of the connector shape
public Comparator createFromSketchComparator()
e1=(s,t1)
and e2=(s,t2)
,
e1
is considered to be less than e2
, if
t1
's row is less than t2
's row. If both
t1
and t2
lie in the same row, then the nodes'
x
-coordinates are compared.
createFromSketchComparator
in interface FromSketchNodePlacer
createFromSketchComparator
in class AbstractRotatableNodePlacer
x
-coordinate of their target nodes.GRID_DPKEY
public AbstractRotatableNodePlacer.RootAlignment getRootAlignment()
public void setRootAlignment(AbstractRotatableNodePlacer.RootAlignment rootAlignment)
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |