Search this API

y.layout.hierarchic
Class TreeDrawer

java.lang.Object
  extended by y.layout.hierarchic.AbstractDrawer
      extended by y.layout.hierarchic.TreeDrawer
All Implemented Interfaces:
Drawer

public class TreeDrawer
extends AbstractDrawer

This class implements the third phase of the hierarchic layout algorithm for trees. If the input graph is not a tree, an alternative drawer is invoked.


Nested Class Summary
static class TreeDrawer.HierarchicTreePlacer
          places nodes in their given layers (does not change the y coordinates) for the TREE layout style of a HierarchicLayouter.
 
Field Summary
 
Fields inherited from class y.layout.hierarchic.AbstractDrawer
distanceToNextNode, dummyMap, edgeLengthKey, graph, minimalEdgeDistance, minimalLayerDistance, minimalMultiEdgeDistance, minimalNodeDistance
 
Fields inherited from interface y.layout.hierarchic.Drawer
NODE_BORDER_BOTTOM, NODE_BORDER_LEFT, NODE_BORDER_RIGHT, NODE_BORDER_TOP, NODE_DISTANCE
 
Constructor Summary
TreeDrawer()
           
 
Method Summary
protected  void assignCoordinates(NodeList[] layerLists, DataProvider layerID)
          Overwrite this method to assign the final coordinates to the objects of he graph.
 void setAlternativeDrawer(Drawer altDrawer)
          Sets the drawer, which is called when graph is not a tree.
 void setMinimalEdgeDistance(double d)
          Sets the minimal distance between two edges in the same layer.
 void setMinimalLayerDistance(double d)
          Sets the minimal distance between two layers.
 void setMinimalMultiEdgeDistance(double d)
          Sets the minimal distance between two edges sharing source/target in the same layer.
 void setMinimalNodeDistance(double d)
          Sets the minimal distance between two nodes in the same layer.
 
Methods inherited from class y.layout.hierarchic.AbstractDrawer
assignCoordinates, assignYCoords, assignYCoords, dispose, getBottomBorder, getBottomHalf, getBottomY, getDistanceToNextNode, getFullHeight, getFullWidth, getLeftBorder, getLeftHalf, getLeftX, getMinimalEdgeDistance, getMinimalLayerDistance, getMinimalMultiEdgeDistance, getMinimalNodeDistance, getRightBorder, getRightHalf, getRightX, getTopBorder, getTopHalf, getTopY, initializeDistancesToNextNode, setDummyMap, setEdgeLengthKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeDrawer

public TreeDrawer()
Method Detail

setMinimalEdgeDistance

public void setMinimalEdgeDistance(double d)
Description copied from class: AbstractDrawer
Sets the minimal distance between two edges in the same layer.

Specified by:
setMinimalEdgeDistance in interface Drawer
Overrides:
setMinimalEdgeDistance in class AbstractDrawer

setMinimalMultiEdgeDistance

public void setMinimalMultiEdgeDistance(double d)
Description copied from class: AbstractDrawer
Sets the minimal distance between two edges sharing source/target in the same layer.

Specified by:
setMinimalMultiEdgeDistance in interface Drawer
Overrides:
setMinimalMultiEdgeDistance in class AbstractDrawer

setMinimalNodeDistance

public void setMinimalNodeDistance(double d)
Description copied from class: AbstractDrawer
Sets the minimal distance between two nodes in the same layer.

Specified by:
setMinimalNodeDistance in interface Drawer
Overrides:
setMinimalNodeDistance in class AbstractDrawer

setMinimalLayerDistance

public void setMinimalLayerDistance(double d)
Description copied from class: AbstractDrawer
Sets the minimal distance between two layers.

Specified by:
setMinimalLayerDistance in interface Drawer
Overrides:
setMinimalLayerDistance in class AbstractDrawer

setAlternativeDrawer

public void setAlternativeDrawer(Drawer altDrawer)
Sets the drawer, which is called when graph is not a tree.


assignCoordinates

protected void assignCoordinates(NodeList[] layerLists,
                                 DataProvider layerID)
Description copied from class: AbstractDrawer
Overwrite this method to assign the final coordinates to the objects of he graph.

Specified by:
assignCoordinates in class AbstractDrawer

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