private Collection<GraphNode> orderChildren(GraphNode root){
  List<GraphNode> leafs=Lists.newArrayList();
  List<GraphNode> inners=Lists.newArrayList();
  for (  GraphNode node : treeData.getSuccessorNodes(root)) {
    if (allreadyDone.contains(node)) {
      continue;
    }
    SuccessorEdges successors=treeData.getSuccessors(node);
    if (successors.hasSuccessors()) {
      inners.add(node);
    }
 else {
      leafs.add(node);
    }
  }
  leafs.addAll(inners);
  return leafs;
}

private Collection < GraphNode > orderChildren ( GraphNode root ) { List < GraphNode > leafs = Lists . newArrayList ( ) ; List < GraphNode > inners = Lists . newArrayList ( ) ; for ( GraphNode node : treeData . getSuccessorNodes ( root ) ) { if ( allreadyDone . contains ( node ) ) { continue ; } SuccessorEdges successors = treeData . getSuccessors ( node ) ; if ( successors . hasSuccessors ( ) ) { inners . add ( node ) ; } else { leafs . add ( node ) ; } } leafs . addAll ( inners ) ; return leafs ; }
provide the current nodes set of children in a principled order . < p > the organic ordering of treemodel . getsuccessors ( ) has little meaning , and can appear to be pretty random . various sorting strategies are feasible : alphabetic , length of label , etc . < p > in this implementation , all leaf children are grouped at the front of the list , with the remaining nodes at the end . this roughly approximates the view that many filers ( e . g . package explorer ) use , with leaf files and directories partitioned from each other .
