Search this API

y.layout.hierarchic
Class TreeDrawer.HierarchicTreePlacer

java.lang.Object
  extended by y.layout.tree.AbstractNodePlacer
      extended by y.layout.hierarchic.TreeDrawer.HierarchicTreePlacer
All Implemented Interfaces:
java.lang.Cloneable, NodePlacer
Enclosing class:
TreeDrawer

public static class TreeDrawer.HierarchicTreePlacer
extends AbstractNodePlacer

This class places nodes on their given layers (does not change the y-coordinates) if the layout style of the hierarchic layout algorithm is set to HierarchicLayouter.TREE.

 

Field Summary
 
Fields inherited from class y.layout.tree.AbstractNodePlacer
graph
 
Fields inherited from interface y.layout.tree.NodePlacer
DIRECTION_ANY, DIRECTION_EAST, DIRECTION_NONE, DIRECTION_NORTH, DIRECTION_SOUTH, DIRECTION_WEST
 
Constructor Summary
TreeDrawer.HierarchicTreePlacer(double minimalNodeDistance)
          Creates a new TreeDrawer.HierarchicTreePlacer instance with the given minimum allowed distance between two nodes of the same layer.
 
Method Summary
protected  byte determineChildConnector(Node child)
          Determines a connector direction for the given child node.
protected  GenericTreeLayouter.SubtreeShape placeSubtree(Node localRoot, byte parentConnectorDirection)
          Arranges the local root relative to the GenericTreeLayouter.SubtreeShape of its children.
 
Methods inherited from class y.layout.tree.AbstractNodePlacer
clone, createProcessor, determineChildConnectors, getNodeShape, getSubtreeShape, placeSubtree
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeDrawer.HierarchicTreePlacer

public TreeDrawer.HierarchicTreePlacer(double minimalNodeDistance)
Creates a new TreeDrawer.HierarchicTreePlacer instance with the given minimum allowed distance between two nodes of the same layer.

Parameters:
minimalNodeDistance - the minimum allowed distance between two nodes of the same layer
Method Detail

determineChildConnector

protected byte determineChildConnector(Node child)
Description copied from class: AbstractNodePlacer
Determines a connector direction for the given child node.

This method is used in AbstractNodePlacer.determineChildConnectors(Node, DataMap) and must be implemented by subclasses.

Specified by:
determineChildConnector in class AbstractNodePlacer
Parameters:
child - the child node
Returns:
a direction specifier as defined in the NodePlacer interface

placeSubtree

protected GenericTreeLayouter.SubtreeShape placeSubtree(Node localRoot,
                                                        byte parentConnectorDirection)
Description copied from class: AbstractNodePlacer
Arranges the local root relative to the GenericTreeLayouter.SubtreeShape of its children.

This is the main method that must be implemented by subclasses. It is called by AbstractNodePlacer.placeSubtree(DataProvider, DataProvider, LayoutGraph, Node, byte).

Specified by:
placeSubtree in class AbstractNodePlacer
Parameters:
localRoot - the local root node
parentConnectorDirection - the direction of the connector
Returns:
a GenericTreeLayouter.SubtreeShape instance that describes the shape of the whole subtree rooted at the given local root

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