org.graffiti.plugins.algorithms.reingoldtilford
Interface ChildOrderStrategy

All Known Implementing Classes:
AllPermutationsChildOrderStrategy, BestFitDecreaseChildOrderStrategy, BestInsertionChildOrderStrategy, BubbleSortChildOrderStrategy

public interface ChildOrderStrategy

Defines an interface for classes that know how to combine the tree layout of siblings.

To provide a new policy for child order, create a class implementing ChildOrderStrategy

 class MyChildOrderStrategy implements ChildOrderStrategy {
     public void combineChildren(Tree parent, ReingoldTilfordAlgorithm algorithm) {
         TreeCombinationStack stack = new TreeCombinationStack();
 
         // Insert children in the desired order here...
 
         stack.apply(parent);
     }
 }
 
and add a new member to this enumeration.
 enum ChildOrderPolicy
 {
      ...
      BUBBLE_SORT(new BubbleSortChildOrderStrategy(), "Bubble sort"),
      MY_POLICY(new MyChildOrderStrategy(), "My new child order"); // <-- Add this line.
      ...
 }
 

Version:
$Revision$ $Date$
Author:
Andreas Gleißner
See Also:
ChildOrderPolicy

Method Summary
 void combineChildren(Tree parent, ReingoldTilfordAlgorithm algorithm)
          Combines the tree layouts of the children of parent.
 

Method Detail

combineChildren

void combineChildren(Tree parent,
                     ReingoldTilfordAlgorithm algorithm)
Combines the tree layouts of the children of parent.

Preconditions:
parent.getChildren().size() > 1

Parameters:
parent - the Tree whose children are to be combined.
algorithm - the Reingold-Tilford-Algorithm.
See Also:
ChildOrderPolicy.combineChildren(Tree, ReingoldTilfordAlgorithm)


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