org.graffiti.plugins.algorithms.reingoldtilford
Interface ParentPlacementStrategy


public interface ParentPlacementStrategy

Defines an interface for classes that know how to calculate the horizontal placement of Nodes above their children.

To provide a new parent placement, create a class implementing ParentPlacementStrategy

 public class MyParentPlacementStrategy implements ParentPlacementStrategy {
     public double calculateNodeLeft(Tree tree)
     {
         ...
         return ...;
     }
 }
 
and add a new member to the ParentPlacement enumeration.
 enum ParentPlacement
 {
     ...
     CENTER_ABOVE_SUBTREE(new CenterParentAboveSubtree(), "Center above the complete width of its subtree"),
     MY_PARENT_PLACEMENT(new MyParentPlacementStrategy(), "My parent placement"); //<-- Add this line.
     ...
 }
 

Version:
$Revision$ $Date$
Author:
Andreas Gleißner

Method Summary
 double calculateNodeLeft(Tree tree)
          Calculate the x-coordinate of the root node of tree in the coordinate system of tree.
 

Method Detail

calculateNodeLeft

double calculateNodeLeft(Tree tree)
Calculate the x-coordinate of the root node of tree in the coordinate system of tree.

Parameters:
tree - the subtree for whose root node the x-coordinate is to be calculated.
Returns:
the x-coordinate of the root node of tree in the coordinate system of tree.


Generated at 2012-05-30 11:01:25 PM CEST