From: Peter W. <pw...@us...> - 2006-07-31 07:40:52
|
Update of /cvsroot/cob/COBEditor/src/edu/iastate/ato/gui/packageview In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv15488/src/edu/iastate/ato/gui/packageview Modified Files: PackageTreeEditor.java Log Message: Fixed: Reloading an ontology with multiple packages being edited. Index: PackageTreeEditor.java =================================================================== RCS file: /cvsroot/cob/COBEditor/src/edu/iastate/ato/gui/packageview/PackageTreeEditor.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PackageTreeEditor.java 29 Jul 2006 09:41:06 -0000 1.7 --- PackageTreeEditor.java 31 Jul 2006 07:40:47 -0000 1.8 *************** *** 3,6 **** --- 3,7 ---- import java.sql.Connection ; import java.util.HashSet; + import java.util.Iterator; import java.util.Vector ; *************** *** 44,47 **** --- 45,50 ---- HashSet<String> editingPkg_OIDs = new HashSet<String>(); HashSet<PackageNode> editingPkgs = new HashSet<PackageNode>(); + boolean isQuitEditingAll = false; + boolean isBeginEditing =true; public PackageTreeEditor(PackageTree tree, Connection db) *************** *** 563,569 **** public void quitEditingAll(){ ! for(PackageNode n:this.editingPkgs){ ! quitEditing(n); } } --- 566,576 ---- public void quitEditingAll(){ ! Iterator<PackageNode> it = this.editingPkgs.iterator(); ! isQuitEditingAll = true; ! while(it.hasNext()){ ! quitEditing(it.next()); } + editingPkgs.clear(); + isQuitEditingAll = false; } *************** *** 584,588 **** editingPkg_OIDs.remove(thePackageNode.getOid()); ! editingPkgs.remove(thePackageNode); UserManager.cancelEditing(db, thePackageNode.getOid(), --- 591,597 ---- editingPkg_OIDs.remove(thePackageNode.getOid()); ! if(!isQuitEditingAll){ ! editingPkgs.remove(thePackageNode); ! } UserManager.cancelEditing(db, thePackageNode.getOid(), *************** *** 621,624 **** --- 630,634 ---- // search packages Vector<PackageNode> e = thisTree.getAllPackage(); + isBeginEditing = true; for(PackageNode n : e) { *************** *** 627,630 **** --- 637,641 ---- } } + isBeginEditing = false; } *************** *** 652,656 **** editingPkgs.add(node); ! Debug.trace("You can edit terms in package '" + node.getLocalName() + "'") ; //System.out.println("EditPackageAction: " + suc); --- 663,668 ---- editingPkgs.add(node); ! if( !isBeginEditing ) ! Debug.trace("You can edit terms in package '" + node.getLocalName() + "'") ; //System.out.println("EditPackageAction: " + suc); |