package bk;

import javax.swing.JTree;

import animation.AlgorithmStage;
import animation.AnimatedAlgorithm;
import animation.CodeLine;
import animation.ControlFlow;
import animation.Memory;
import animation.PseudoCodeNode;
import graph.LayeredGraphNode;
import lib.TextLayoutHelper;

/**
 * The stage of the combination of the four extremal layouts.
 * @author kolja
 *
 */
public class Combine implements AlgorithmStage {

    private LayeredGraphNode graph;
    private AnimatedAlgorithm alg;

    public Combine( LayeredGraphNode graph, AnimatedAlgorithm alg )
    {
        this.graph = graph;
        this.alg = alg;
    }

    @Override
    public PseudoCodeNode createPseudocodeTree( JTree tree ) {
        PseudoCodeNode root = new PseudoCodeNode( TextLayoutHelper.setupPseudoCodeStage("Balancing"), tree, new CodeLine() {

			@Override
			public ControlFlow runForward(Memory m) {
				// TODO Auto-generated method stub
				return null;
			}
        	
        }, alg );
        return root;
    }
    
    @Override
    public String getDebugString()
    {
        String info = "| Node |  x  | x LU | x RU | x LL | x RL |\n";
        info +=       "|------|-----|------|------|------|------|\n";
        return info;
    }
}
