Search this API

y.layout.tree
Class AbstractRotatableNodePlacer.RootAlignment

java.lang.Object
  extended by y.layout.tree.AbstractRotatableNodePlacer.RootAlignment
Enclosing class:
AbstractRotatableNodePlacer

public abstract static class AbstractRotatableNodePlacer.RootAlignment
extends Object

This class represents the horizontal alignment of the root node. There are several implementation that may be used:


Field Summary
static AbstractRotatableNodePlacer.RootAlignment[] ALL
           
static AbstractRotatableNodePlacer.RootAlignment CENTER
          Horizontal alignment at the center.
static AbstractRotatableNodePlacer.RootAlignment CENTER_OVER_CHILDREN
          Horizontal alignment at the center.
static AbstractRotatableNodePlacer.RootAlignment LEADING
          Horizontal alignment at the left side of the children
static AbstractRotatableNodePlacer.RootAlignment LEFT
          Horizontal alignment at the left.
static AbstractRotatableNodePlacer.RootAlignment MEDIAN
          Horizontal alignment at the median.
static AbstractRotatableNodePlacer.RootAlignment RIGHT
          Horizontal alignment at the right.
static AbstractRotatableNodePlacer.RootAlignment TRAILING
          Horizontal alignment at the right side of the children.
 
Constructor Summary
AbstractRotatableNodePlacer.RootAlignment()
           
 
Method Summary
protected static Rectangle2D getBounds(List shapes)
          Calculates the bounds of a list of shapes.
protected abstract  void placeParentHorizontal(y.layout.tree.SubtreeShapeRotated rootShape, List shapes, Rectangle2D shapeBounds, double spacing)
          This method moves the rootShape to the right position relative to the children's shapes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CENTER

public static final AbstractRotatableNodePlacer.RootAlignment CENTER
Horizontal alignment at the center.


MEDIAN

public static final AbstractRotatableNodePlacer.RootAlignment MEDIAN
Horizontal alignment at the median.


LEADING

public static final AbstractRotatableNodePlacer.RootAlignment LEADING
Horizontal alignment at the left side of the children


TRAILING

public static final AbstractRotatableNodePlacer.RootAlignment TRAILING
Horizontal alignment at the right side of the children.


LEFT

public static final AbstractRotatableNodePlacer.RootAlignment LEFT
Horizontal alignment at the left.


RIGHT

public static final AbstractRotatableNodePlacer.RootAlignment RIGHT
Horizontal alignment at the right.


CENTER_OVER_CHILDREN

public static final AbstractRotatableNodePlacer.RootAlignment CENTER_OVER_CHILDREN
Horizontal alignment at the center. Only the shapes of the children are respected (not of the grandchildren).


ALL

public static final AbstractRotatableNodePlacer.RootAlignment[] ALL
Constructor Detail

AbstractRotatableNodePlacer.RootAlignment

public AbstractRotatableNodePlacer.RootAlignment()
Method Detail

placeParentHorizontal

protected abstract void placeParentHorizontal(y.layout.tree.SubtreeShapeRotated rootShape,
                                              List shapes,
                                              Rectangle2D shapeBounds,
                                              double spacing)
This method moves the rootShape to the right position relative to the children's shapes. The movement should only be done on the X-axis (horizontally).

Parameters:
rootShape - the shape of the root node that is moved
shapes - list of shapes of the children nodes
shapeBounds - accumulated shapes of all children's shapes
spacing - the spacing that should be used.

getBounds

protected static Rectangle2D getBounds(List shapes)
Calculates the bounds of a list of shapes.

Parameters:
shapes - the list of shapes the bounds shall be calculated of.
Returns:
the bounds around all shapes in the list.

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