public void trimTree(){
  boolean needsTrim=m_root != null;
  while (needsTrim) {
    needsTrim=false;
    Enumeration en=m_root.preorderEnumeration();
    while (m_root.getChildCount() > 0 && en.hasMoreElements()) {
      MTreeNode nd=(MTreeNode)en.nextElement();
      if (nd.isSummary() && nd.getChildCount() == 0) {
        nd.removeFromParent();
        needsTrim=true;
      }
    }
  }
}

public void trimTree ( ) { boolean needsTrim = m_root != null ; while ( needsTrim ) { needsTrim = false ; Enumeration en = m_root . preorderEnumeration ( ) ; while ( m_root . getChildCount ( ) > 0 && en . hasMoreElements ( ) ) { MTreeNode nd = ( MTreeNode ) en . nextElement ( ) ; if ( nd . isSummary ( ) && nd . getChildCount ( ) == 0 ) { nd . removeFromParent ( ) ; needsTrim = true ; } } } }
trim tree of empty summary nodes
