| 
 | 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
public abstract class AbstractRotatableNodePlacer
This is an abstract base class for NodePlacers that supports rotations.
 "Supporting rotation" means that the NodePlacers only implement the default direction (e.g. bottom-down).
 The other directions are calculated using the modification matrix within the constructor.
 But take care! Using rotatable NodePlacers contains some pitfalls. Especially calculations must be aware of
 that. Especially operations on BorderLines should not be called directly (e.g. mergeWithMin, mergeWithMax).
 Use the corresponding methods on AbstractRotatableNodePlacer instead.
| Nested Class Summary | |
|---|---|
| static class | AbstractRotatableNodePlacer.MatrixInstances of this class may be used to configure the AbstractRotatableNodePlacer. | 
| static class | AbstractRotatableNodePlacer.RootAlignmentThis class represents the horizontal alignment of the root node. | 
| Field Summary | |
|---|---|
| protected  List | createdChildrenList containing the created children | 
| protected  LayoutGraph | graphThe graph instance this class is working on | 
| protected  AbstractRotatableNodePlacer.Matrix | modificationMatrixThe active modification matrix. | 
| protected  DataProvider | nodeShapeProviderThe actual node shape provider | 
| protected  double | spacingThis is the "default" spacing for the different move operations. | 
| protected  DataProvider | subtreeShapeProviderThe actual subtree shape provider | 
| Fields inherited from interface y.layout.tree.NodePlacer | 
|---|
| DIRECTION_ANY, DIRECTION_EAST, DIRECTION_NONE, DIRECTION_NORTH, DIRECTION_SOUTH, DIRECTION_WEST | 
| Constructor Summary | |
|---|---|
| protected  | AbstractRotatableNodePlacer(AbstractRotatableNodePlacer.Matrix modificationMatrix)Default constructor. | 
| Method Summary | |
|---|---|
|  Comparator | createComparator() | 
|  Comparator | createFromSketchComparator()Creates a comparator for edges. | 
|  Processor | createProcessor(GenericTreeLayouter layouter,
                LayoutGraph graph,
                Node currentRoot)Creates an optional Processor for pre- and post-processing. | 
| protected  y.layout.tree.SubtreeShapeRotated | createRootNodeShape(Node node)Convenience method that queries the DataProvider for the shape of a single node as a SubtreeShape instance. | 
| protected  y.layout.tree.SubtreeShapeRotated | createSubtreeShape(Node node)Convenience method that queries the DataProvider for a SubtreeShape. | 
| 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, then uses the abstract method determineChildConnector(y.base.Node)to determine the child node connector directions. | 
|  AbstractRotatableNodePlacer.Matrix | getModificationMatrix()The actual modification matrix | 
| protected  PortConstraint | getPortConstraint(Node localRoot)Lookup method to get the PortConstraint for the local root translated. | 
| protected  YPoint | getSourcePointAbs(Edge edge)Translates the absolute source point of the given edge to the "view coordinates" (translated by the modification matrix) | 
|  double | getSpacing()Returns the spacing between subtrees this NodePlaceris
 arranging. | 
|  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  y.layout.tree.SubtreeShapeRotated | placeSubtree(Node localRoot,
             byte parentConnectorDirection)This method must be implemented by subclasses. | 
|  void | setSpacing(double spacing)Specifies the spacing between subtrees this NodePlaceris
 arranging. | 
| protected  byte | translateDirectionToModel(byte realDirection)Translates a "real" direction into a directionModel direction | 
| protected  byte | translateDirectionToReal(byte modelDirection)Translates a modelDirectionModel into the "real" directionModel | 
| static YPoint | translatePoint(AbstractRotatableNodePlacer.Matrix modificationMatrix,
               YPoint realWorldPoint)Translates a "real world point" to a "model point" | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
protected double spacing
protected LayoutGraph graph
protected final AbstractRotatableNodePlacer.Matrix modificationMatrix
protected DataProvider subtreeShapeProvider
protected DataProvider nodeShapeProvider
protected List createdChildren
| Constructor Detail | 
|---|
protected AbstractRotatableNodePlacer(AbstractRotatableNodePlacer.Matrix modificationMatrix)
modificationMatrix - the translation for the NodePlacer| Method Detail | 
|---|
public Processor createProcessor(GenericTreeLayouter layouter,
                                 LayoutGraph graph,
                                 Node currentRoot)
createProcessor in interface NodePlacerlayouter - graph - the actual graphcurrentRoot - the actual root node for this node placer
protected YPoint getSourcePointAbs(Edge edge)
edge - the source point for is returned
protected abstract y.layout.tree.SubtreeShapeRotated placeSubtree(Node localRoot,
                                                                  byte parentConnectorDirection)
localRoot - the local root nodeparentConnectorDirection - the direction of the connector shape
protected y.layout.tree.SubtreeShapeRotated createRootNodeShape(Node node)
placeSubtree(Node, byte)
node - the node whose shape will be returned in the form of a SubtreeShape instance
protected y.layout.tree.SubtreeShapeRotated createSubtreeShape(Node node)
placeSubtree(y.base.Node, byte)
node - the root node whose subtree shape will be returned in the form of a SubtreeShape instance
public void determineChildConnectors(Node localRoot,
                                     DataMap connectorMap)
determineChildConnector(y.base.Node)
 to determine the child node connector directions.
determineChildConnectors in interface NodePlacerlocalRoot - the local root nodeconnectorMap - the map that will be used to store the valuesdetermineChildConnector(Node)protected PortConstraint getPortConstraint(Node localRoot)
localRoot - the local root
protected byte translateDirectionToReal(byte modelDirection)
modelDirection - the model direction
protected byte translateDirectionToModel(byte realDirection)
realDirection - the "real" direction
protected abstract byte determineChildConnector(Node child)
child - the child node
NodePlacer interface
public GenericTreeLayouter.SubtreeShape placeSubtree(DataProvider nodeShapeProvider,
                                                     DataProvider subtreeShapeProvider,
                                                     LayoutGraph graph,
                                                     Node localRoot,
                                                     byte parentConnectorDirection)
placeSubtree in interface NodePlacernodeShapeProvider - 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 AbstractRotatableNodePlacer.Matrix getModificationMatrix()
public Comparator createComparator()
public static YPoint translatePoint(AbstractRotatableNodePlacer.Matrix modificationMatrix,
                                    YPoint realWorldPoint)
modificationMatrix - the matrix to applyrealWorldPoint - the point with the coordinates from the real world
public double getSpacing()
NodePlacer is
 arranging.
NodePlacer.public void setSpacing(double spacing)
NodePlacer is
 arranging.
public Comparator createFromSketchComparator()
FromSketchNodePlacer
createFromSketchComparator in interface FromSketchNodePlacer| 
 | © Copyright 2000-2013, yWorks GmbH. All rights reserved. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||