Search this API

y.layout.tree
Class FreePlacer

java.lang.Object
  extended by y.layout.tree.AbstractRotatableNodePlacer
      extended by y.layout.tree.FreePlacer
All Implemented Interfaces:
FromSketchNodePlacer, NodePlacer

public class FreePlacer
extends AbstractRotatableNodePlacer

A FreePlacer is a simple pseudo-placer. The children of local root nodes are not moved. The NodePlacer just merges their rotated shapes and routes the edges.

This NodePlacer may be useful if a local root node does not have any children or you want to place them manually.

 

Nested Class Summary
 
Nested classes/interfaces inherited from class y.layout.tree.AbstractRotatableNodePlacer
AbstractRotatableNodePlacer.Matrix, AbstractRotatableNodePlacer.RootAlignment
 
Field Summary
 
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
FreePlacer()
          Creates a new instance of FreePlacer with default settings.
 
Method Summary
 Processor createProcessor(GenericTreeLayouter layouter, LayoutGraph graph, Node currentRoot)
          Creates a Processor that will change all descending NodePlacers to FreePlacer.
protected  byte determineChildConnector(Node child)
          Determines a connector direction for the given child node.
protected  y.layout.tree.SubtreeShapeRotated placeSubtree(Node localRoot, byte parentConnectorDirection)
          Merges the rotated shapes of the given local root and its children and routes the edges between them.
 
Methods inherited from class y.layout.tree.AbstractRotatableNodePlacer
createComparator, createFromSketchComparator, 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
 

Constructor Detail

FreePlacer

public FreePlacer()
Creates a new instance of FreePlacer with default settings.

Method Detail

determineChildConnector

protected byte determineChildConnector(Node child)
Determines a connector direction for the given child node.

This implementation returns NodePlacer.DIRECTION_NONE for every node.

Specified by:
determineChildConnector in class AbstractRotatableNodePlacer
Parameters:
child - the child node
Returns:
NodePlacer.DIRECTION_NONE

placeSubtree

protected y.layout.tree.SubtreeShapeRotated placeSubtree(Node localRoot,
                                                         byte parentConnectorDirection)
Merges the rotated shapes of the given local root and its children and routes the edges between them.

Specified by:
placeSubtree in class AbstractRotatableNodePlacer
Parameters:
localRoot - the local root node
parentConnectorDirection - the direction specifier for the connector of the local root node to its parent node
Returns:
the merged subtree shape that contains the local root node and all its children

createProcessor

public Processor createProcessor(GenericTreeLayouter layouter,
                                 LayoutGraph graph,
                                 Node currentRoot)
Creates a Processor that will change all descending NodePlacers to FreePlacer.

Specified by:
createProcessor in interface NodePlacer
Overrides:
createProcessor in class AbstractRotatableNodePlacer
Parameters:
layouter - the current GenericTreeLayouter instance
graph - the input graph
currentRoot - the current root node handled by this NodePlacer
Returns:
the Processor suitable for FreePlacer

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.