@SuppressWarnings("unchecked") public boolean insertNodeIntoModel(String name,CatalogTreeNode parent){
  if (!nameOK(parent,name)) {
    return false;
  }
  int index=0;
  Enumeration<CatalogTreeNode> e=parent.children();
  while (e.hasMoreElements()) {
    CatalogTreeNode n=e.nextElement();
    if (name.compareTo(n.toString()) < 0) {
      break;
    }
    index++;
  }
  CatalogTreeNode newChild=new CatalogTreeNode(name);
  _model.insertNodeInto(newChild,parent,index);
  CatalogTreeNode cParent=getCorrespondingNode(parent);
  CatalogTreeNode node=new CatalogTreeNode(name);
  AbstractCatalogTree tree=(AbstractCatalogTree)getCorespondingModel(parent);
  tree.insertNodeInto(node,cParent,index);
  ImageIndexEditor.indexChanged(true);
  return true;
}

@ SuppressWarnings ( "unchecked" ) public boolean insertNodeIntoModel ( String name , CatalogTreeNode parent ) { if ( ! nameOK ( parent , name ) ) { return false ; } int index = 0 ; Enumeration < CatalogTreeNode > e = parent . children ( ) ; while ( e . hasMoreElements ( ) ) { CatalogTreeNode n = e . nextElement ( ) ; if ( name . compareTo ( n . toString ( ) ) < 0 ) { break ; } index ++ ; } CatalogTreeNode newChild = new CatalogTreeNode ( name ) ; _model . insertNodeInto ( newChild , parent , index ) ; CatalogTreeNode cParent = getCorrespondingNode ( parent ) ; CatalogTreeNode node = new CatalogTreeNode ( name ) ; AbstractCatalogTree tree = ( AbstractCatalogTree ) getCorespondingModel ( parent ) ; tree . insertNodeInto ( node , cParent , index ) ; ImageIndexEditor . indexChanged ( true ) ; return true ; }
insert a new node into the displayed tree .
