ExtremalLayoutCalc.java 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package bk;
  2. import javax.swing.JTree;
  3. import animation.AlgorithmStage;
  4. import animation.CodeLine;
  5. import animation.ControlFlow;
  6. import animation.Memory;
  7. import animation.PseudoCodeNode;
  8. import lib.TextLayoutHelper;
  9. /**
  10. * The stage where the for extremal layouts are computed.
  11. * @author kolja
  12. *
  13. */
  14. public class ExtremalLayoutCalc implements AlgorithmStage {
  15. /**
  16. * There are four types of layouts, based on iteration order and median alignment.
  17. * Additionally there is one layout for the combined coordinates.
  18. * @author kolja
  19. *
  20. */
  21. public enum LayoutType{
  22. TOP_BOTTOM_LEFT,
  23. TOP_BOTTOM_RIGHT,
  24. BOTTOM_TOP_LEFT,
  25. BOTTOM_TOP_RIGHT,
  26. COMBINED
  27. }
  28. @Override
  29. public PseudoCodeNode createPseudocodeTree( JTree tree ) {
  30. PseudoCodeNode root = new PseudoCodeNode( TextLayoutHelper.setupPseudoCode( "function calcLaout( layout, graph )", new String[0] ), tree, new CodeLine() {
  31. @Override
  32. public ControlFlow runForward(Memory m) {
  33. // TODO Auto-generated method stub
  34. return null;
  35. }
  36. } );
  37. return root;
  38. }
  39. }