protected void layout(TreeNode node){
  if (node != null) {
    TreeNode child=node.child;
    while (child != null) {
      layout(child);
      child=child.next;
    }
    if (node.child != null) {
      attachParent(node,join(node));
    }
 else {
      layoutLeaf(node);
    }
  }
}

protected void layout ( TreeNode node ) { if ( node != null ) { TreeNode child = node . child ; while ( child != null ) { layout ( child ) ; child = child . next ; } if ( node . child != null ) { attachParent ( node , join ( node ) ) ; } else { layoutLeaf ( node ) ; } } }
starts the actual compact tree layout algorithm at the given node .
