You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(32) |
Jul
(20) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(6) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Jie B. <ba...@us...> - 2007-08-16 04:01:13
|
Update of /cvsroot/cob/COBEditor/src/edu/iastate/ato/po In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv25786/src/edu/iastate/ato/po Modified Files: DB2OBO.java Log Message: Index: DB2OBO.java =================================================================== RCS file: /cvsroot/cob/COBEditor/src/edu/iastate/ato/po/DB2OBO.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DB2OBO.java 6 Mar 2007 22:07:35 -0000 1.2 --- DB2OBO.java 16 Aug 2007 04:01:08 -0000 1.3 *************** *** 1,16 **** ! package edu.iastate.ato.po ; ! import java.io.BufferedWriter ; ! import java.io.FileWriter ; ! import java.io.IOException ; ! import java.sql.Connection ; ! import java.sql.ResultSet ; ! import java.sql.SQLException ; ! import java.sql.Statement ; ! import java.util.HashMap ; ! import java.util.Map ; ! import java.util.Vector ; - import edu.iastate.ato.shared.AtoConstent ; import edu.iastate.ato.shared.*; --- 1,17 ---- ! package edu.iastate.ato.po; ! import java.io.BufferedWriter; ! import java.io.FileWriter; ! import java.io.IOException; ! import java.sql.Connection; ! import java.sql.ResultSet; ! import java.sql.SQLException; ! import java.sql.Statement; ! import java.text.SimpleDateFormat; ! import java.util.Date; ! import java.util.HashMap; ! import java.util.Map; ! import java.util.Vector; import edu.iastate.ato.shared.*; *************** *** 23,56 **** public class DB2OBO extends LongTask { ! public static final String PROPERTY_LEADING = "![attribute]" ; ! public static final String SCHEMA_LEADING = "![schema]" ; ! String prefix ; String makeHeader(String user) { ! String header = "format-version: 1.0\n" + ! //"date: " + OntologyEdit.getTime() + "\n" + ! "saved-by: " + user + "\n" + ! "auto-generated-by: " + AtoConstent.APP_NAME + "\n" + ! "default-namespace: ato\n\n" ; ! return header ; } /* eg ! [Typedef] ! id: part_of ! name: part of */ String makeTypedef(String relation) { ! return "[Typedef]\n" + ! "id: " + relation + "\n" + ! "name: " + relation + "\n\n" ; } String makeComment(String comment) { ! return "comment: " + comment + "\n" ; } --- 24,64 ---- public class DB2OBO extends LongTask { ! public static final String PROPERTY_LEADING = "![attribute]"; ! public static final String SCHEMA_LEADING = "![schema]"; ! //date: 15:08:2007 22:12 ! final public static SimpleDateFormat dateFormat = new SimpleDateFormat( ! "dd:MM:yyyy HH:mm"); ! ! public static String getTime() ! { ! return dateFormat.format(new Date()); ! } ! ! String prefix; String makeHeader(String user) { ! String header = "format-version: 1.0\n" + "date: " ! + getTime() + "\n" + "saved-by: " + user + "\n" ! + "auto-generated-by: " + AtoConstent.APP_NAME + "\n" ! + "default-namespace: ato\n\n"; ! return header; } /* eg ! [Typedef] ! id: part_of ! name: part of */ String makeTypedef(String relation) { ! return "[Typedef]\n" + "id: " + relation + "\n" + "name: " + relation ! + "\n\n"; } String makeComment(String comment) { ! return "comment: " + comment + "\n"; } *************** *** 59,81 **** String makeTerm_Property(String prop, String value) { ! if(OntologySchema.isOBOProperty(prop)) { ! if ("def".equals(prop.trim())){ ! value = "\"" + value.replaceAll("\"","'") + "\""; ! return prop + ": " + value; ! } ! else if ("def_xref".equals(prop.trim())) ! { return "[" +value + "]"; // also see exportTerms ! } ! else if (OntologySchema.isSynonymProperty(prop)) ! { ! return prop + ": \"" + value + "\" []\n" ; ! } ! else ! return prop + ": " + value + "\n" ; } else { // treate it as comment ! return PROPERTY_LEADING + prop + ": " + value + "\n" ; } } --- 67,84 ---- String makeTerm_Property(String prop, String value) { ! if (OntologySchema.isOBOProperty(prop)) { ! if (prop.contains("synonym") || prop.equals("def")) ! { ! // e.g. related_synonym: "aa" [] ! value = value.replaceAll("\"", ""); ! return prop + ": \"" + value + "\" []\n"; ! } ! else ! return prop + ": " + value + "\n"; } else { // treate it as comment ! return PROPERTY_LEADING + prop + ": " + value + "\n"; } } *************** *** 84,94 **** public String addPrefix(String id) { ! if(prefix != null && prefix.trim().length() > 0) { ! return prefix + ":" + id ; } else { ! return id ; } } --- 87,97 ---- public String addPrefix(String id) { ! if (prefix != null && prefix.trim().length() > 0) { ! return prefix + ":" + id; } else { ! return id; } } *************** *** 98,107 **** String parent_name) { ! String str = "relationship: " + relation + " " + addPrefix(parent_id) ; ! if(parent_name != null) { ! str += " ! " + parent_name ; } ! return str + "\n" ; } --- 101,110 ---- String parent_name) { ! String str = "relationship: " + relation + " " + addPrefix(parent_id); ! if (parent_name != null) { ! str += " ! " + parent_name; } ! return str + "\n"; } *************** *** 110,119 **** String parent_name) { ! String str = "relationship: " + relation + " " + parent_id ; ! if(parent_name != null) { ! str += " ! " + parent_name ; } ! return str + "\n" ; } --- 113,122 ---- String parent_name) { ! String str = "relationship: " + relation + " " + parent_id; ! if (parent_name != null) { ! str += " ! " + parent_name; } ! return str + "\n"; } *************** *** 130,156 **** try { ! BufferedWriter out = new BufferedWriter(new FileWriter(fileName)) ; // prepare data structures ! this.prefix = withPrefix ? OntologySchema.getPrefix(db) : null ; ! packageNameCache.clear() ; // 1. make header ! out.write(makeHeader(user)) ; // 2. make schema ! exportSchema(db, out) ; // 3. export package ! exportPackages(db, out) ; // 4. write term by term ! exportTerms(db, out) ; ! out.close() ; ! } ! catch(IOException ex) ! { } } --- 133,158 ---- try { ! BufferedWriter out = new BufferedWriter(new FileWriter(fileName)); // prepare data structures ! this.prefix = withPrefix ? OntologySchema.getPrefix(db) : null; ! packageNameCache.clear(); // 1. make header ! out.write(makeHeader(user)); // 2. make schema ! exportSchema(db, out); // 3. export package ! exportPackages(db, out); // 4. write term by term ! exportTerms(db, out); ! out.close(); } + catch (IOException ex) + {} } *************** *** 162,348 **** * @since 2005-08-24 */ ! private void exportPackages(Connection db, BufferedWriter out) throws ! IOException { ! String sql = "SELECT oid, pid, comment, author, modified FROM package" ; try { ! Statement stmt = db.createStatement() ; ! ResultSet resultSet = stmt.executeQuery(sql) ; ! while(resultSet.next()) { ! String oid = resultSet.getString("oid") ; ! String pid = resultSet.getString("pid") ; ! String comment = resultSet.getString("comment") ; ! String author = resultSet.getString("author") ; ! String modified = resultSet.getString("modified") ; // don't export GlobalPackage ! if(pid.equals(Package.GlobalPkg)) { ! continue ; } ! out.write("[Package]\n") ; // write the comments ! String str = "id: " + pid + "\n" ; ! str += "name: " + (comment == null ? "" : comment) + "\n" ; ! out.write(str) ; ! str = makeTerm_Property("author", author) ; ! out.write(str) ; ! str = makeTerm_Property("modified", modified) ; ! out.write(str) ; //SELECT DISTINCT relation, package.pid AS parent, package.comment AS parent_name //FROM pkg_relation, package WHERE pkg_relation.p1 = '116329' AND pkg_relation.p2 = package.oid ! sql = ! "SELECT DISTINCT relation, package.pid AS parent, package.comment AS parent_name" + ! " FROM pkg_relation, package WHERE pkg_relation.p1 = '" + ! oid + "' AND pkg_relation.p2 = package.oid" ; //Debug.systrace(this,sql); ! Statement stmt2 = db.createStatement() ; ! ResultSet resultSet2 = stmt2.executeQuery(sql) ; ! while(resultSet2.next()) { ! String relation = resultSet2.getString("relation") ; ! String parent = resultSet2.getString("parent") ; ! String parent_name = resultSet2.getString("parent_name") ; ! str = makePackageRelation(relation, parent, parent_name) ; ! out.write(str) ; } ! out.write("\n") ; } // end of a package } ! catch(SQLException ex) { ! ex.printStackTrace() ; } } ! Map<String, String> packageNameCache = new HashMap() ; private String getPackageName(Connection db, String pkg_oid) { // read the cache ! String pkgName = packageNameCache.get(pkg_oid) ; ! if(pkgName == null) { // not yet in cache ! pkgName = DbPackage.read(db, pkg_oid).pid ; ! packageNameCache.put(pkg_oid, pkgName) ; } ! return pkgName ; } void exportTerms(Connection db, BufferedWriter out) { ! String sql = ! "SELECT oid, id, name, slm, package, author, modified, is_obsolete FROM term" ; try { ! System.out.println(sql) ; ! Statement stmt = db.createStatement() ; ! ResultSet resultSet = stmt.executeQuery(sql) ; ! while(resultSet.next()) { ! String oid = resultSet.getString("oid") ; ! String id = resultSet.getString("id") ; ! String name = resultSet.getString("name") ; ! String author = resultSet.getString("author") ; ! String modified = resultSet.getString("modified") ; ! String is_obsolete = resultSet.getString("is_obsolete") ; ! String package_oid = resultSet.getString("package") ; ! String slm = resultSet.getString("slm") ; ! out.write("[Term]\n") ; // write the basic information ! String str = "id: " + addPrefix(id) + "\n" ; ! str += "name: " + (name == null ? "" : name) + "\n" ; ! out.write(str) ; ! if(is_obsolete.equalsIgnoreCase("true")) { ! str = "is_obsolete: true\n" ; ! out.write(str) ; } ! str = makeTerm_Property("author", author) ; ! out.write(str) ; ! str = makeTerm_Property("modified", modified) ; ! out.write(str) ; // write package membership ! str = getPackageName(db, package_oid) ; // package id ! str = makeTerm_Property("package", str) ; ! out.write(str) ; ! str = makeTerm_Property("slm", slm) ; ! out.write(str) ; // write the property details ! sql = "SELECT attribute, value FROM details WHERE term = '" + ! oid + "'" ; ! Statement stmt1 = db.createStatement() ; ! ResultSet resultSet1 = stmt1.executeQuery(sql) ; ! ! String def = null, def_xref = null; ! ! while(resultSet1.next()) { ! String attribute = resultSet1.getString("attribute") ; ! String value = resultSet1.getString("value") ; ! if(value != null && value.trim().length() > 0) { ! str = makeTerm_Property(attribute, value) ; ! ! if ("def_xref".equals(attribute.trim())) ! def_xref = str; ! else if ("def".equals(attribute.trim())) ! def = str; ! else ! ! out.write(str) ; } } ! if (def != null) ! { ! if (def_xref != null) ! { ! out.write(def + " " + def_xref + "\n"); ! } ! else ! { ! out.write(def + "\n"); ! } ! //out.write("def is not null \n") ; ! } //SELECT DISTINCT relation, term.id AS parent, term.name AS parent_name ! //FROM relation WHERE id = '59056' AND relation.pid = term.oid ! sql = ! "SELECT DISTINCT relation, term.id AS parent, term.name AS parent_name FROM relation, term " + ! "WHERE relation.id = '" + oid + "' AND relation.pid = term.oid" ; ! Statement stmt2 = db.createStatement() ; ! ResultSet resultSet2 = stmt2.executeQuery(sql) ; ! ! while(resultSet2.next()) ! { ! String relation = resultSet2.getString("relation") ; ! String parent = resultSet2.getString("parent") ; ! String parent_name = resultSet2.getString("parent_name") ; ! str = makeTerm_Relation(relation, parent, parent_name) ; ! out.write( str) ; } ! ! out.write("\n") ; } } ! catch(Exception e) { ! e.printStackTrace() ; } --- 164,328 ---- * @since 2005-08-24 */ ! private void exportPackages(Connection db, BufferedWriter out) ! throws IOException { ! String sql = "SELECT oid, pid, comment, author, modified FROM package"; try { ! Statement stmt = db.createStatement(); ! ResultSet resultSet = stmt.executeQuery(sql); ! while (resultSet.next()) { ! String oid = resultSet.getString("oid"); ! String pid = resultSet.getString("pid"); ! String comment = resultSet.getString("comment"); ! String author = resultSet.getString("author"); ! String modified = resultSet.getString("modified"); // don't export GlobalPackage ! if (pid.equals(Package.GlobalPkg)) { ! continue; } ! out.write("[Package]\n"); // write the comments ! String str = "id: " + pid + "\n"; ! str += "name: " + (comment == null ? "" : comment) + "\n"; ! out.write(str); ! str = makeTerm_Property("author", author); ! out.write(str); ! str = makeTerm_Property("modified", modified); ! out.write(str); //SELECT DISTINCT relation, package.pid AS parent, package.comment AS parent_name //FROM pkg_relation, package WHERE pkg_relation.p1 = '116329' AND pkg_relation.p2 = package.oid ! sql = "SELECT DISTINCT relation, package.pid AS parent, package.comment AS parent_name" ! + " FROM pkg_relation, package WHERE pkg_relation.p1 = '" ! + oid + "' AND pkg_relation.p2 = package.oid"; //Debug.systrace(this,sql); ! Statement stmt2 = db.createStatement(); ! ResultSet resultSet2 = stmt2.executeQuery(sql); ! while (resultSet2.next()) { ! String relation = resultSet2.getString("relation"); ! String parent = resultSet2.getString("parent"); ! String parent_name = resultSet2.getString("parent_name"); ! str = makePackageRelation(relation, parent, parent_name); ! out.write(str); } ! out.write("\n"); } // end of a package } ! catch (SQLException ex) { ! ex.printStackTrace(); } } ! Map<String, String> packageNameCache = new HashMap(); ! private String getPackageName(Connection db, String pkg_oid) { // read the cache ! String pkgName = packageNameCache.get(pkg_oid); ! if (pkgName == null) { // not yet in cache ! pkgName = DbPackage.read(db, pkg_oid).pid; ! packageNameCache.put(pkg_oid, pkgName); } ! return pkgName; } void exportTerms(Connection db, BufferedWriter out) { ! String sql = ! "SELECT oid, id, name, slm, package, author, modified, is_obsolete FROM term"; try { ! System.out.println(sql); ! Statement stmt = db.createStatement(); ! ResultSet resultSet = stmt.executeQuery(sql); ! while (resultSet.next()) { ! String oid = resultSet.getString("oid"); ! String id = resultSet.getString("id"); ! String name = resultSet.getString("name"); ! String author = resultSet.getString("author"); ! String modified = resultSet.getString("modified"); ! String is_obsolete = resultSet.getString("is_obsolete"); ! String package_oid = resultSet.getString("package"); ! String slm = resultSet.getString("slm"); ! out.write("[Term]\n"); // write the basic information ! String str = "id: " + addPrefix(id) + "\n"; ! str += "name: " + (name == null ? "" : name) + "\n"; ! out.write(str); ! if (is_obsolete.equalsIgnoreCase("true")) { ! str = "is_obsolete: true\n"; ! out.write(str); } ! str = makeTerm_Property("author", author); ! out.write(str); ! str = makeTerm_Property("modified", modified); ! out.write(str); // write package membership ! str = getPackageName(db, package_oid); // package id ! str = makeTerm_Property("package", str); ! out.write(str); ! str = makeTerm_Property("slm", slm); ! out.write(str); // write the property details ! sql = "SELECT attribute, value FROM details WHERE term = '" ! + oid + "'"; ! Statement stmt1 = db.createStatement(); ! ResultSet resultSet1 = stmt1.executeQuery(sql); ! while (resultSet1.next()) { ! String attribute = resultSet1.getString("attribute"); ! String value = resultSet1.getString("value"); ! if (value != null && value.trim().length() > 0) { ! str = makeTerm_Property(attribute, value); ! out.write(str); } } ! //SELECT DISTINCT relation, term.id AS parent, term.name AS parent_name ! //FROM relation,term WHERE relation.id = '59056' AND relation.pid = term.oid ! sql = "SELECT DISTINCT relation, term.id AS parent, term.name AS parent_name FROM relation, term " ! + "WHERE relation.id = '" ! + oid ! + "' AND relation.pid = term.oid"; ! Statement stmt2 = db.createStatement(); ! ResultSet resultSet2 = stmt2.executeQuery(sql); ! while (resultSet2.next()) ! { ! String relation = resultSet2.getString("relation"); ! String parent = resultSet2.getString("parent"); ! String parent_name = resultSet2.getString("parent_name"); ! str = makeTerm_Relation(relation, parent, parent_name); ! out.write(str); } ! out.write("\n"); } } ! catch (Exception e) { ! e.printStackTrace(); } *************** *** 350,394 **** // 2005-08-23 ! private void exportSchema(Connection db, BufferedWriter out) throws ! IOException { // 1. write properties - if not obo property ! Vector<String> props = OntologySchema.getTermProperties(db) ; ! for(String attr : props) { // ![schema]term-property:unit ! String str = SCHEMA_LEADING + ! OntologySchema.TERM_PROPERTY + ":" + attr + "\n" ; ! out.write(str) ; } // 2. naming policy ! String value = OntologySchema.getNamingPolicy(db) ; ! if(value != null) { ! String str = SCHEMA_LEADING + OntologySchema.NAMING_POLICY + ":" + ! value + "\n" ; ! out.write(str) ; } // 3. prefix ! value = OntologySchema.getPrefix(db) ; ! if(value != null) { ! String str = SCHEMA_LEADING + OntologySchema.PREFIX + ":" + ! value + "\n" ; ! out.write(str) ; } // 4. a blank line ! out.write("\n") ; // 5. write partial orders // write typedef like [Typedef]\n id: part_of \n name: part of ! Vector<String> relations = OntologySchema.getPartialOrders(db) ; ! for(String relation : relations) { ! String str = makeTypedef(relation) ; ! out.write(str) ; } --- 330,374 ---- // 2005-08-23 ! private void exportSchema(Connection db, BufferedWriter out) ! throws IOException { // 1. write properties - if not obo property ! Vector<String> props = OntologySchema.getTermProperties(db); ! for (String attr : props) { // ![schema]term-property:unit ! String str = SCHEMA_LEADING + OntologySchema.TERM_PROPERTY + ":" ! + attr + "\n"; ! out.write(str); } // 2. naming policy ! String value = OntologySchema.getNamingPolicy(db); ! if (value != null) { ! String str = SCHEMA_LEADING + OntologySchema.NAMING_POLICY + ":" ! + value + "\n"; ! out.write(str); } // 3. prefix ! value = OntologySchema.getPrefix(db); ! if (value != null) { ! String str = SCHEMA_LEADING + OntologySchema.PREFIX + ":" + value ! + "\n"; ! out.write(str); } // 4. a blank line ! out.write("\n"); // 5. write partial orders // write typedef like [Typedef]\n id: part_of \n name: part of ! Vector<String> relations = OntologySchema.getPartialOrders(db); ! for (String relation : relations) { ! String str = makeTypedef(relation); ! out.write(str); } |
From: Jie B. <ba...@us...> - 2007-08-16 03:50:27
|
Update of /cvsroot/cob/COBEditor/src/edu/iastate/ato/po In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv21525/src/edu/iastate/ato/po Modified Files: DB2OWL.java Log Message: Index: DB2OWL.java =================================================================== RCS file: /cvsroot/cob/COBEditor/src/edu/iastate/ato/po/DB2OWL.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DB2OWL.java 13 Jun 2006 21:55:24 -0000 1.1 --- DB2OWL.java 16 Aug 2007 03:50:20 -0000 1.2 *************** *** 157,160 **** --- 157,161 ---- String is_obsolete = resultSet.getString("is_obsolete") ; + id = id.replace(" ", "_"); out.write("<Term rdf:ID=\"" + id + "\">\n") ; *************** *** 190,205 **** out.write(str) ; } ! ! // SELECT DISTINCT relation, term.id AS parent FROM relation ! // WHERE id = '59056' AND relation.pid = term.oid sql = ! "SELECT DISTINCT relation, term.id AS parent FROM relation " + ! "WHERE id = '" + oid + "' AND relation.pid = term.oid" ; Statement stmt2 = db.createStatement() ; ResultSet resultSet2 = stmt2.executeQuery(sql) ; while(resultSet2.next()) { ! String relation = resultSet2.getString("relation") ; String parent = resultSet2.getString("parent") ; str = makeTerm_Relation(relation, parent) ; --- 191,210 ---- out.write(str) ; } ! ! // write parents ! //SELECT DISTINCT relation, term.id AS parent FROM relation,term ! //WHERE relation.id = '27291' AND relation.pid = term.oid ! sql = ! "SELECT DISTINCT relation, term.id AS parent FROM relation,term " + ! "WHERE relation.id = '" + oid + "' AND relation.pid = term.oid" ; Statement stmt2 = db.createStatement() ; ResultSet resultSet2 = stmt2.executeQuery(sql) ; while(resultSet2.next()) { ! String relation = resultSet2.getString("relation"); String parent = resultSet2.getString("parent") ; + parent = parent.replace(" ", "_"); + str = makeTerm_Relation(relation, parent) ; |
From: Jie B. <ba...@us...> - 2007-08-15 20:08:31
|
Update of /cvsroot/cob/COBEditor/src/edu/iastate/ato/gui/details In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv12164/src/edu/iastate/ato/gui/details Modified Files: TermPropertyPanel.java Log Message: Index: TermPropertyPanel.java =================================================================== RCS file: /cvsroot/cob/COBEditor/src/edu/iastate/ato/gui/details/TermPropertyPanel.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TermPropertyPanel.java 27 Jul 2006 12:02:30 -0000 1.4 --- TermPropertyPanel.java 15 Aug 2007 20:08:24 -0000 1.5 *************** *** 139,143 **** p.add(createDeleteButton(v)); JComboBox cb = makeComboBox(); ! cb.setEnabled(false); p.add(cb); --- 139,144 ---- p.add(createDeleteButton(v)); JComboBox cb = makeComboBox(); ! cb.setEnabled(true); ! cb.setSelectedItem(attr); p.add(cb); |
From: Jie B. <ba...@us...> - 2007-08-15 20:08:31
|
Update of /cvsroot/cob/COBEditor/database In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv12164/database Added Files: er-diagramatodb.doc Log Message: --- NEW FILE: er-diagramatodb.doc --- (This appears to be a binary file; contents omitted.) |
From: Jie B. <ba...@us...> - 2007-08-15 20:08:31
|
Update of /cvsroot/cob/COBEditor/src/edu/iastate/ato/gui/packageview In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv12164/src/edu/iastate/ato/gui/packageview Modified Files: PackageTreeEditor.java Log Message: Index: PackageTreeEditor.java =================================================================== RCS file: /cvsroot/cob/COBEditor/src/edu/iastate/ato/gui/packageview/PackageTreeEditor.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PackageTreeEditor.java 31 Jul 2006 07:40:47 -0000 1.8 --- PackageTreeEditor.java 15 Aug 2007 20:08:24 -0000 1.9 *************** *** 1023,1027 **** public void actionPerformed(ActionEvent e) { ! // same as expand expandPackage(theNode) ; } --- 1023,1027 ---- public void actionPerformed(ActionEvent e) { ! // same as expand expandPackage(theNode) ; } |
From: Jie B. <ba...@us...> - 2007-08-15 20:08:31
|
Update of /cvsroot/cob/COBEditor/document/log In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv12164/document/log Modified Files: baojie-log2005.doc Log Message: Index: baojie-log2005.doc =================================================================== RCS file: /cvsroot/cob/COBEditor/document/log/baojie-log2005.doc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsZed91Q and /tmp/cvsUQ15mB differ |
From: Peter W. <pw...@us...> - 2006-08-09 19:45:55
|
Update of /cvsroot/cob/COBEditor/src/edu/iastate/ato/gui In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv13356/src/edu/iastate/ato/gui Modified Files: MOEditorBasis.java Log Message: Both naming policies will update the auto_id table Index: MOEditorBasis.java =================================================================== RCS file: /cvsroot/cob/COBEditor/src/edu/iastate/ato/gui/MOEditorBasis.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MOEditorBasis.java 13 Jun 2006 21:55:24 -0000 1.1 --- MOEditorBasis.java 9 Aug 2006 19:45:50 -0000 1.2 *************** *** 39,43 **** ds.setUrl(info.url) ; ds.setUser(info.user) ; ! ds.setPassword(info.password) ; ds.setDriver(info.driver) ; --- 39,43 ---- ds.setUrl(info.url) ; ds.setUser(info.user) ; ! ds.setPassword(info.password); ds.setDriver(info.driver) ; *************** *** 56,60 **** { // naming policy ! selectedNamingPolicy = new BasicNamingPolicy() ; // load the system selected policy --- 56,60 ---- { // naming policy ! selectedNamingPolicy = new BasicNamingPolicy(db) ; // load the system selected policy |
From: Peter W. <pw...@us...> - 2006-08-09 19:45:54
|
Update of /cvsroot/cob/COBEditor/src/edu/iastate/ato/po/naming In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv13356/src/edu/iastate/ato/po/naming Modified Files: NamingPolicyFactory.java BasicNamingPolicy.java Log Message: Both naming policies will update the auto_id table Index: BasicNamingPolicy.java =================================================================== RCS file: /cvsroot/cob/COBEditor/src/edu/iastate/ato/po/naming/BasicNamingPolicy.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** BasicNamingPolicy.java 18 Jul 2006 21:32:41 -0000 1.3 --- BasicNamingPolicy.java 9 Aug 2006 19:45:51 -0000 1.4 *************** *** 1,4 **** --- 1,8 ---- package edu.iastate.ato.po.naming ; + import java.sql.Connection; + + import edu.iastate.ato.po.OntologyEdit; + /** * <p>@author Jie Bao</p> *************** *** 9,14 **** public static String policyName = "Basic Naming Policy" ; ! public BasicNamingPolicy() { enableRename = true ; uniqueRequired = true ; --- 13,22 ---- public static String policyName = "Basic Naming Policy" ; ! Connection db ; ! ! ! public BasicNamingPolicy(Connection db) { + this.db = db; enableRename = true ; uniqueRequired = true ; *************** *** 36,39 **** --- 44,48 ---- public String makeNameWhenSaving(String baseName) { + OntologyEdit.applyID(db, baseName); return baseName ; } Index: NamingPolicyFactory.java =================================================================== RCS file: /cvsroot/cob/COBEditor/src/edu/iastate/ato/po/naming/NamingPolicyFactory.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NamingPolicyFactory.java 13 Jun 2006 21:55:24 -0000 1.1 --- NamingPolicyFactory.java 9 Aug 2006 19:45:50 -0000 1.2 *************** *** 14,18 **** { Vector<NamingPolicy> allNamingPolicy = new Vector() ; ! allNamingPolicy.add(new BasicNamingPolicy()) ; allNamingPolicy.add(new AutomaticNamingPolicy(db)) ; --- 14,18 ---- { Vector<NamingPolicy> allNamingPolicy = new Vector() ; ! allNamingPolicy.add(new BasicNamingPolicy(db)) ; allNamingPolicy.add(new AutomaticNamingPolicy(db)) ; *************** *** 25,29 **** if(name.equals(BasicNamingPolicy.policyName)) { ! return new BasicNamingPolicy() ; } else if(name.equals(AutomaticNamingPolicy.policyName)) --- 25,29 ---- if(name.equals(BasicNamingPolicy.policyName)) { ! return new BasicNamingPolicy(db) ; } else if(name.equals(AutomaticNamingPolicy.policyName)) |
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); |
From: Peter W. <pw...@us...> - 2006-07-29 09:44:25
|
Update of /cvsroot/cob/COBEditor/src/edu/iastate/ato/gui In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv23279/src/edu/iastate/ato/gui Modified Files: MOEditor.java Log Message: Fixed reload bug: editing packages stay being edited after reload. Index: MOEditor.java =================================================================== RCS file: /cvsroot/cob/COBEditor/src/edu/iastate/ato/gui/MOEditor.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** MOEditor.java 18 Jul 2006 21:32:29 -0000 1.7 --- MOEditor.java 29 Jul 2006 09:41:06 -0000 1.8 *************** *** 3,6 **** --- 3,7 ---- import java.io.IOException ; import java.util.Enumeration ; + import java.util.HashSet; import java.util.Vector ; *************** *** 654,659 **** public void onReload(ActionEvent e) { ! paneMain.rebuild(conn.db) ; this.paneDetails.rebuild(conn.db) ; } --- 655,664 ---- public void onReload(ActionEvent e) { ! //HashSet<PackageNode> ! HashSet<String> eps = paneMain.packageView.treeEditor.getEditingPackageOIDs(); ! paneMain.packageView.treeEditor.quitEditingAll(); ! paneMain.rebuild(conn.db) ; this.paneDetails.rebuild(conn.db) ; + paneMain.packageView.treeEditor.beginEditing(eps); } |
From: Peter W. <pw...@us...> - 2006-07-29 09:44:24
|
Update of /cvsroot/cob/COBEditor/src/edu/iastate/ato/gui/packageview In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv23279/src/edu/iastate/ato/gui/packageview Modified Files: PackageTreeEditor.java PackageTree.java Log Message: Fixed reload bug: editing packages stay being edited after reload. Index: PackageTreeEditor.java =================================================================== RCS file: /cvsroot/cob/COBEditor/src/edu/iastate/ato/gui/packageview/PackageTreeEditor.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PackageTreeEditor.java 27 Jul 2006 12:02:30 -0000 1.6 --- PackageTreeEditor.java 29 Jul 2006 09:41:06 -0000 1.7 *************** *** 2,5 **** --- 2,6 ---- import java.sql.Connection ; + import java.util.HashSet; import java.util.Vector ; *************** *** 41,45 **** { PackageTree thisTree ; ! public PackageTreeEditor(PackageTree tree, Connection db) { --- 42,48 ---- { PackageTree thisTree ; ! HashSet<String> editingPkg_OIDs = new HashSet<String>(); ! HashSet<PackageNode> editingPkgs = new HashSet<PackageNode>(); ! public PackageTreeEditor(PackageTree tree, Connection db) { *************** *** 49,52 **** --- 52,63 ---- } + public HashSet<String> getEditingPackageOIDs(){ + HashSet<String> rtnVal = new HashSet<String>(); + for(String s:editingPkg_OIDs){ + rtnVal.add(s); + } + return rtnVal; + } + protected void buildContextMenu(TypedNode selectedNode) { *************** *** 551,554 **** --- 562,571 ---- } + public void quitEditingAll(){ + for(PackageNode n:this.editingPkgs){ + quitEditing(n); + } + } + public void quitEditing(PackageNode thePackageNode) { *************** *** 565,568 **** --- 582,589 ---- thePackageNode.editing = false; thePackageNode.expanded = false; + + editingPkg_OIDs.remove(thePackageNode.getOid()); + editingPkgs.remove(thePackageNode); + UserManager.cancelEditing(db, thePackageNode.getOid(), MOEditor.user.name) ; *************** *** 591,594 **** --- 612,633 ---- } + /** + * Begin editing for a set of packages + * @param packages Vector - set of package oid + * @since 2005-07-25 + */ + public void beginEditing(HashSet<String> pkg_oids) + { + // search packages + Vector<PackageNode> e = thisTree.getAllPackage(); + for(PackageNode n : e) + { + if(pkg_oids.contains(n.getOid())){ + editPackage(n); + } + } + } + + public void editPackage(PackageNode node) { *************** *** 610,613 **** --- 649,655 ---- { node.editing = true; + editingPkg_OIDs.add(node.getOid()); + editingPkgs.add(node); + Debug.trace("You can edit terms in package '" + node.getLocalName() + "'") ; Index: PackageTree.java =================================================================== RCS file: /cvsroot/cob/COBEditor/src/edu/iastate/ato/gui/packageview/PackageTree.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PackageTree.java 18 Jul 2006 21:32:29 -0000 1.5 --- PackageTree.java 29 Jul 2006 09:41:06 -0000 1.6 *************** *** 3,7 **** import java.sql.Connection ; import java.util.Enumeration ; ! import java.util.Vector ; import edu.iastate.ato.gui.MOEditor ; --- 3,8 ---- import java.sql.Connection ; import java.util.Enumeration ; ! import java.util.HashSet; ! import java.util.Vector; import edu.iastate.ato.gui.MOEditor ; *************** *** 27,32 **** { this.db = db ; } ! /** * AddTerm --- 28,36 ---- { this.db = db ; + } ! ! ! /** * AddTerm *************** *** 105,108 **** --- 109,116 ---- return null ; } + + + + /** |
From: Peter W. <pw...@us...> - 2006-07-27 12:02:35
|
Update of /cvsroot/cob/COBEditor/src/edu/iastate/ato/gui/details In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv19644/src/edu/iastate/ato/gui/details Modified Files: TermPropertyPanel.java Log Message: Allows for branch delete of term relations and packages Index: TermPropertyPanel.java =================================================================== RCS file: /cvsroot/cob/COBEditor/src/edu/iastate/ato/gui/details/TermPropertyPanel.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TermPropertyPanel.java 26 Jul 2006 09:37:30 -0000 1.3 --- TermPropertyPanel.java 27 Jul 2006 12:02:30 -0000 1.4 *************** *** 28,31 **** --- 28,32 ---- import edu.iastate.ato.po.OntologySchema ; import edu.iastate.ato.po.TagValuePair ; + import edu.iastate.ato.po.naming.AutomaticNamingPolicy; import edu.iastate.ato.shared.IconLib ; import edu.iastate.ato.tree.DbTermNode ; |
From: Peter W. <pw...@us...> - 2006-07-27 12:02:34
|
Update of /cvsroot/cob/COBEditor/src/edu/iastate/ato/gui/packageview In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv19644/src/edu/iastate/ato/gui/packageview Modified Files: PackageTreeEditor.java PackageView2Db.java Log Message: Allows for branch delete of term relations and packages Index: PackageTreeEditor.java =================================================================== RCS file: /cvsroot/cob/COBEditor/src/edu/iastate/ato/gui/packageview/PackageTreeEditor.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PackageTreeEditor.java 20 Jul 2006 20:51:12 -0000 1.5 --- PackageTreeEditor.java 27 Jul 2006 12:02:30 -0000 1.6 *************** *** 240,257 **** new DeleteTermRelationAction(theTerm)) ; } ! if(isLeaf && !isMerged) ! { ! if(!isCloned) ! { ! addMenuItem("Delete Term", IconLib.iconDelete, ! new DeleteTermAction(theTerm)) ; ! ! String info = ! "Drag the term and drop it on the term to be merged" ; ! addMenuItem("Merge Term with...", ! IconLib.iconMergeTerm, ! new DoNothingAction(theTerm, info)) ; ! } } } } // end of if (!isObsolete) --- 240,262 ---- new DeleteTermRelationAction(theTerm)) ; } ! if( !isMerged && !isCloned){ ! if(isLeaf) ! { ! addMenuItem("Delete Term", IconLib.iconDelete, ! new DeleteTermAction(theTerm)) ; ! ! String info = ! "Drag the term and drop it on the term to be merged" ; ! addMenuItem("Merge Term with...", ! IconLib.iconMergeTerm, ! new DoNothingAction(theTerm, info)) ; ! ! // Add Branch Relation Delete ! }else{ ! addMenuItem("Delete Branch Relations", IconLib.iconDelete, ! new DeleteRelationBranchAction(theTerm)) ; ! } } + } } // end of if (!isObsolete) *************** *** 667,670 **** --- 672,708 ---- } } + + class DeleteRelationBranchAction extends DefaultDeleteAction + { + DbTermNode theNode ; + + public DeleteRelationBranchAction(DbTermNode theNode) + { + this.theNode = theNode ; + } + + private void deleteRelationRec(DbTermNode tn){ + tn.status = ATOTreeNode.DELETED_UPEDGE ; + for(int i=0; i<tn.getChildCount(); ++i){ + if( tn.getChildAt(i) instanceof DbTermNode){ + deleteRelationRec((DbTermNode)tn.getChildAt(i)); + } + } + } + + /* (non-Javadoc) + * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) + */ + public void actionPerformed(ActionEvent e) + { + theNode.status = ATOTreeNode.DELETED_UPEDGE ; + theNode.getHomePackageNode().status = PackageNode.MODIFIED; + + deleteRelationRec(theNode); + + tree.getModel().reload(theNode) ; + ((PackageTree)tree).modified = true; + } + } class DeletePackageAction extends DefaultDeleteAction *************** *** 676,680 **** this.theNode = theNode ; } ! public void actionPerformed(ActionEvent e) { --- 714,728 ---- this.theNode = theNode ; } ! ! ! private void deletePackageRec(PackageNode tn){ ! tn.markDeleted(); ! for(int i=0; i<tn.getChildCount(); ++i){ ! if( tn.getChildAt(i) instanceof PackageNode){ ! deletePackageRec((PackageNode)tn.getChildAt(i)); ! } ! } ! } ! public void actionPerformed(ActionEvent e) { *************** *** 682,699 **** if(theNode.hasSubPackage()) { ! Debug.trace("Cannot delete a package with sub packages. \n" + "Please delete all sub packages and try again") ; return ; ! } ! ! int answer = JOptionPane.showConfirmDialog(null, ! "Are you sure to delete (obsolete) all terms(inclued unexpanded) in the package? \n" + ! "The package itself will be deleted only if it has no term (including obsoleted terms)") ; ! if(answer == JOptionPane.YES_OPTION) ! { ! theNode.markDeleted() ; ! ((PackageNode)theNode.getParent()).status = PackageNode.MODIFIED; ! tree.getModel().reload(theNode.getParent()) ; ! ((PackageTree)tree).modified = true; } } --- 730,761 ---- if(theNode.hasSubPackage()) { ! /*Debug.trace("Cannot delete a package with sub packages. \n" + "Please delete all sub packages and try again") ; + */ + + int answer = JOptionPane.showConfirmDialog(null, + "Are you sure to delete (obsolete) all terms(inclued unexpanded) in the package and subpackages? \n" + + "The package and subpackges themselves will be deleted only if it has no term (including obsoleted terms)") ; + if(answer == JOptionPane.YES_OPTION) + { + theNode.markDeleted() ; + ((PackageNode)theNode.getParent()).status = PackageNode.MODIFIED; + deletePackageRec(theNode); + tree.getModel().reload(theNode.getParent()) ; + ((PackageTree)tree).modified = true; + } return ; ! ! }else{ ! int answer = JOptionPane.showConfirmDialog(null, ! "Are you sure to delete (obsolete) all terms(inclued unexpanded) in the package? \n" + ! "The package itself will be deleted only if it has no term (including obsoleted terms)") ; ! if(answer == JOptionPane.YES_OPTION) ! { ! theNode.markDeleted() ; ! ((PackageNode)theNode.getParent()).status = PackageNode.MODIFIED; ! tree.getModel().reload(theNode.getParent()) ; ! ((PackageTree)tree).modified = true; ! } } } Index: PackageView2Db.java =================================================================== RCS file: /cvsroot/cob/COBEditor/src/edu/iastate/ato/gui/packageview/PackageView2Db.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PackageView2Db.java 15 Jul 2006 22:10:53 -0000 1.5 --- PackageView2Db.java 27 Jul 2006 12:02:31 -0000 1.6 *************** *** 125,128 **** --- 125,130 ---- if(atoNode instanceof PackageNode) { + PackageNode pn = ((PackageNode)atoNode); + //System.out.println("\nDeleting Package: "+pn.getLocalName()); // delete package (don't delete the terms in it) // (the terms should have individual deleted marks) *************** *** 319,322 **** --- 321,325 ---- for(PackageNode pkg : allPackages) { + //System.out.println("Saving: "+pkg.getLocalName()); savePackageNode(pkg); } |
From: Peter W. <pw...@us...> - 2006-07-27 12:02:34
|
Update of /cvsroot/cob/COBEditor/src/edu/iastate/ato/tree In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv19644/src/edu/iastate/ato/tree Modified Files: PackageNode.java Log Message: Allows for branch delete of term relations and packages Index: PackageNode.java =================================================================== RCS file: /cvsroot/cob/COBEditor/src/edu/iastate/ato/tree/PackageNode.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PackageNode.java 26 Jul 2006 09:37:30 -0000 1.3 --- PackageNode.java 27 Jul 2006 12:02:31 -0000 1.4 *************** *** 43,47 **** //move all its subpackages to its super package ! PackageNode superPkg = (PackageNode)this.getParent() ; for(int i = 0 ; i < this.getChildCount() ; i++) { --- 43,47 ---- //move all its subpackages to its super package ! /*PackageNode superPkg = (PackageNode)this.getParent() ; for(int i = 0 ; i < this.getChildCount() ; i++) { *************** *** 52,56 **** ((PackageNode)n).status = PackageNode.MODIFIED ; } ! } } --- 52,56 ---- ((PackageNode)n).status = PackageNode.MODIFIED ; } ! }*/ } |
From: Peter W. <pw...@us...> - 2006-07-26 11:46:35
|
Update of /cvsroot/cob/COBEditor/src/edu/iastate/ato/po In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv31183/src/edu/iastate/ato/po Modified Files: OntologyEdit.java Log Message: Allows term properties to be deleted. Index: OntologyEdit.java =================================================================== RCS file: /cvsroot/cob/COBEditor/src/edu/iastate/ato/po/OntologyEdit.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OntologyEdit.java 13 Jun 2006 21:55:24 -0000 1.1 --- OntologyEdit.java 26 Jul 2006 09:37:30 -0000 1.2 *************** *** 67,70 **** --- 67,97 ---- } + + public static boolean deleteTermProperty(Connection db, String term_oid, + String property) + { + if(property == null) + { + return false ; + } + /* e.g. + UPDATE details SET value = 'inch', author = 'user', modified = '...' + WHERE term = '000' AND attribute = 'ScaleUnit' or + + INSERT INTO details ( term, attribute, value, author, modified) + VALUES ('000', 'ScaleUnit' , 'inch', 'user', '....'); + */ + Map field_value = new HashMap<String, String>() ; + field_value.put("term", term_oid) ; + field_value.put("attribute", property) ; + + Vector pks = new Vector<String>() ; + pks.add("term") ; + pks.add("attribute") ; + + return JDBCUtils.delete(db,"details",field_value); + //return JDBCUtils.insertOrUpdateDatabase(db, "details", field_value, pks) ; + } + final public static SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z") ; |
From: Peter W. <pw...@us...> - 2006-07-26 11:13:04
|
Update of /cvsroot/cob/COBEditor/src/edu/iastate/ato/shared In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv31183/src/edu/iastate/ato/shared Modified Files: IconLib.java Log Message: Allows term properties to be deleted. Index: IconLib.java =================================================================== RCS file: /cvsroot/cob/COBEditor/src/edu/iastate/ato/shared/IconLib.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IconLib.java 13 Jun 2006 21:55:24 -0000 1.1 --- IconLib.java 26 Jul 2006 09:37:30 -0000 1.2 *************** *** 37,40 **** --- 37,41 ---- public static ImageIcon iconAddSub = loadImageIcon("addsub.gif") ; public static ImageIcon iconDelete = loadImageIcon("delete.gif") ; + public static ImageIcon iconDelete_sm = loadImageIcon("delete_sm.gif") ; public static ImageIcon iconDeleteSub = loadImageIcon("deletesub.gif") ; public static ImageIcon iconDeleteSup = loadImageIcon("deletesup.gif") ; |
From: Peter W. <pw...@us...> - 2006-07-26 10:45:03
|
Update of /cvsroot/cob/COBEditor/src/edu/iastate/utils/gui In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv31183/src/edu/iastate/utils/gui Modified Files: LabelledItemPanel.java Log Message: Allows term properties to be deleted. Index: LabelledItemPanel.java =================================================================== RCS file: /cvsroot/cob/COBEditor/src/edu/iastate/utils/gui/LabelledItemPanel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LabelledItemPanel.java 13 Jun 2006 21:55:23 -0000 1.1 --- LabelledItemPanel.java 26 Jul 2006 09:37:29 -0000 1.2 *************** *** 5,8 **** --- 5,9 ---- import java.awt.Insets; import javax.swing.BorderFactory; + import javax.swing.JButton; import javax.swing.JComponent; import javax.swing.JFrame; *************** *** 24,27 **** --- 25,29 ---- /** The row to add the next labelled item to */ private int myNextItemRow = 0; + public int itemInterval = 10; // 2005-07-23 *************** *** 40,44 **** init(); } ! /** * This method initialises the panel and layout manager. --- 42,52 ---- init(); } ! ! public void setEditable(boolean tog){ ! for(int i=0; i<this.getComponentCount(); ++i){ ! this.getComponent(i).setEnabled(tog); ! } ! } ! /** * This method initialises the panel and layout manager. *************** *** 84,88 **** public void addItem(JComponent labelItem, JComponent item) { ! GridBagConstraints labelConstraints = new GridBagConstraints(); labelConstraints.gridx = 0; --- 92,96 ---- public void addItem(JComponent labelItem, JComponent item) { ! GridBagConstraints labelConstraints = new GridBagConstraints(); labelConstraints.gridx = 0; |
From: Peter W. <pw...@us...> - 2006-07-26 09:37:40
|
Update of /cvsroot/cob/COBEditor/src/edu/iastate/ato/tree In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv31183/src/edu/iastate/ato/tree Modified Files: ATOTreeNode.java PackageNode.java Log Message: Allows term properties to be deleted. Index: ATOTreeNode.java =================================================================== RCS file: /cvsroot/cob/COBEditor/src/edu/iastate/ato/tree/ATOTreeNode.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ATOTreeNode.java 24 Jun 2006 12:19:25 -0000 1.2 --- ATOTreeNode.java 26 Jul 2006 09:37:30 -0000 1.3 *************** *** 38,41 **** --- 38,42 ---- static public final short DELETED_UPEDGE = 3 ; static public final short MERGED = 4 ; + //static public final short NEW_NODE = 5 ; public String status2string() Index: PackageNode.java =================================================================== RCS file: /cvsroot/cob/COBEditor/src/edu/iastate/ato/tree/PackageNode.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PackageNode.java 29 Jun 2006 22:15:54 -0000 1.2 --- PackageNode.java 26 Jul 2006 09:37:30 -0000 1.3 *************** *** 26,32 **** public class PackageNode extends ATOTreeNode { ! private DbPackage thisPackage ; ! public boolean expanded = false ; public MetaTreeNode obsoleteNodes ; public void markDeleted() --- 26,34 ---- public class PackageNode extends ATOTreeNode { ! private DbPackage thisPackage; ! public boolean expanded = false; public MetaTreeNode obsoleteNodes ; + public boolean editing = false; + public boolean wasEdited = false; public void markDeleted() *************** *** 90,94 **** int max = 200 ; ! public void expand(Connection db, JProgressBar progress) { if(this.status == ATOTreeNode.DELETED_NODE) --- 92,101 ---- int max = 200 ; ! ! public void expand(Connection db, JProgressBar progress){ ! expand(db, progress, true); ! } ! ! public void expand(Connection db, JProgressBar progress, boolean reload) { if(this.status == ATOTreeNode.DELETED_NODE) *************** *** 118,122 **** //}} //String packageName = packageNode.getLocalName(); ! clearPackage() ; updateTermNumber(db) ; --- 125,132 ---- //}} //String packageName = packageNode.getLocalName(); ! if( reload == true ){ ! clearPackage(); ! } ! updateTermNumber(db) ; *************** *** 124,138 **** treeLoader.setProgress(progress) ; ! StopWatch w = new StopWatch() ; ! w.start() ; ! treeLoader.makeDagFromRootsQuick(this, cutoff, true, this) ; ! //treeLoader.makeDagFromRoots(this, cutoff, true, this) ; ! w.stop(); ! System.out.println(w.print()); // make the Obsolete meta node ! int n = OntologyQuerier.getObsoleteTermCount(db, this) ; ! obsoleteNodes = new MetaTreeNode("Obsolete(" + n + ")", null) ; ! this.add(obsoleteNodes) ; // load all obsoleteNodes //treeLoader.addObsoleteTerms(obsoleteNodes, this) ; --- 134,154 ---- treeLoader.setProgress(progress) ; ! if( reload == true ){ ! StopWatch w = new StopWatch() ; ! w.start() ; ! treeLoader.makeDagFromRootsQuick(this, cutoff, true, this) ; ! ! //treeLoader.makeDagFromRoots(this, cutoff, true, this) ; ! w.stop(); ! System.out.println(w.print()); ! } // make the Obsolete meta node ! ! if( reload == true ){ ! int n = OntologyQuerier.getObsoleteTermCount(db, this) ; ! obsoleteNodes = new MetaTreeNode("Obsolete(" + n + ")", null) ; ! this.add(obsoleteNodes) ; ! } // load all obsoleteNodes //treeLoader.addObsoleteTerms(obsoleteNodes, this) ; |
From: Peter W. <pw...@us...> - 2006-07-26 09:37:39
|
Update of /cvsroot/cob/COBEditor/src/edu/iastate/ato/gui/details In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv31183/src/edu/iastate/ato/gui/details Modified Files: TermPropertyPanel.java Log Message: Allows term properties to be deleted. Index: TermPropertyPanel.java =================================================================== RCS file: /cvsroot/cob/COBEditor/src/edu/iastate/ato/gui/details/TermPropertyPanel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TermPropertyPanel.java 20 Jul 2006 20:51:12 -0000 1.2 --- TermPropertyPanel.java 26 Jul 2006 09:37:30 -0000 1.3 *************** *** 3,11 **** --- 3,16 ---- import java.sql.Connection ; import java.util.HashMap ; + import java.util.HashSet; import java.util.Map ; import java.util.Vector ; import java.awt.BorderLayout ; + import java.awt.Color; + import java.awt.Insets; import java.awt.event.ActionEvent ; + + import javax.swing.BorderFactory; import javax.swing.JButton ; import javax.swing.JComboBox ; *************** *** 48,52 **** JButton btnAdd = new JButton("Add") ; ! LabelledItemPanel mainPane = new LabelledItemPanel(3) ; JScrollPane jScrollPane1 = new JScrollPane() ; --- 53,57 ---- JButton btnAdd = new JButton("Add") ; ! LabelledItemPanel mainPane = new LabelledItemPanel(0) ; JScrollPane jScrollPane1 = new JScrollPane() ; *************** *** 56,59 **** --- 61,67 ---- new HashMap<JTextArea, JComponent>() ; + HashSet<JTextArea> newItems = new HashSet<JTextArea>() ; + HashSet<JTextArea> deletedItems = new HashSet<JTextArea>() ; + // map from the property name to its JTextField //Map<String, JTextField> attributeEditors = new HashMap(); *************** *** 78,91 **** } JTextArea v = new JTextArea() ; ! mainPane.addItem(cb, v) ; ! allItem.put(v, cb) ; return v ; } public JTextArea addProperty(String attr, String value) { JLabel label = new JLabel(attr) ; JTextArea v = new JTextArea(value) ; ! mainPane.addItem(label, v) ; allItem.put(v, label) ; return v ; --- 86,146 ---- } JTextArea v = new JTextArea() ; ! ! JPanel p = new JPanel(); ! p.add(createDeleteButton(v)); ! p.add(cb); ! ! mainPane.addItem(p, v) ; ! allItem.put(v, cb); ! newItems.add(v); return v ; } + public class OnDeletionHandler implements MessageHandler{ + public JTextArea vref; + public OnDeletionHandler(JTextArea v){ + vref = v; + } + + public void onDelete(ActionEvent e){ + vref.setEnabled(false); + deletedItems.add(vref); + } + + public void messageMap(){ + + } + } + + private JButton createDeleteButton(JTextArea vref){ + JButton deleteButton = new JButton(); + deleteButton.setMargin(new Insets(0,0,0,0)); + deleteButton.setIcon(IconLib.iconDelete_sm); + deleteButton.setSelectedIcon(IconLib.iconAddSubPackage); + deleteButton.setBorder(BorderFactory.createEtchedBorder()); + deleteButton.setBackground(new Color(238,238,238)); + deleteButton.setToolTipText("Delete"); + + try{ + MessageMap.mapAction(deleteButton, new OnDeletionHandler(vref), "onDelete") ; + } + catch(Exception ex){} + + return deleteButton; + } + public JTextArea addProperty(String attr, String value) { JLabel label = new JLabel(attr) ; JTextArea v = new JTextArea(value) ; ! ! JPanel p = new JPanel(); ! p.add(createDeleteButton(v)); ! JComboBox cb = makeComboBox(); ! cb.setEnabled(false); ! p.add(cb); ! ! ! mainPane.addItem(p, v) ; allItem.put(v, label) ; return v ; *************** *** 190,194 **** try { ! MessageMap.mapAction(this.btnConfirm, this, "onConfirm") ; MessageMap.mapAction(this.btnCancel, this, "onCancel") ; MessageMap.mapAction(this.btnAdd, this, "onAdd") ; --- 245,249 ---- try { ! MessageMap.mapAction(this.btnConfirm, this, "onConfirm") ; MessageMap.mapAction(this.btnCancel, this, "onCancel") ; MessageMap.mapAction(this.btnAdd, this, "onAdd") ; *************** *** 231,242 **** { // JDBCUtils:insertOrUpdateDatabase() - insert with null primary key ! ! String attr = getLabel(item) ; ! OntologyEdit.addTermProperty(db, term_oid, attr, value, ! MOEditor.user.name) ; ! allItem.get(item).setEnabled(false) ; } } ! } --- 286,307 ---- { // JDBCUtils:insertOrUpdateDatabase() - insert with null primary key ! if(deletedItems.contains(item)){ ! if(!newItems.contains(item)){ ! // Delete Item ! OntologyEdit.deleteTermProperty(db,term_oid,getLabel(item)); ! } ! ! }else{ ! String attr = getLabel(item) ; ! OntologyEdit.addTermProperty(db, term_oid, attr, value, ! MOEditor.user.name) ; ! allItem.get(item).setEnabled(false) ; ! } } } ! } ! ! public void deleteTermProperty(){ ! } |
From: Peter W. <pw...@us...> - 2006-07-26 09:37:38
|
Update of /cvsroot/cob/COBEditor/bin In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv31176/bin Log Message: Directory /cvsroot/cob/COBEditor/bin added to the repository |
From: Peter W. <pw...@us...> - 2006-07-20 20:51:15
|
Update of /cvsroot/cob/COBEditor/src/edu/iastate/ato/gui/details In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv12202/src/edu/iastate/ato/gui/details Modified Files: TermPropertyPanel.java Log Message: Package View is synched up with properties view. Property View's Buttons (add, confirm, cancel) are only available when a term, whos package is being edited, is selected. Index: TermPropertyPanel.java =================================================================== RCS file: /cvsroot/cob/COBEditor/src/edu/iastate/ato/gui/details/TermPropertyPanel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TermPropertyPanel.java 13 Jun 2006 21:55:25 -0000 1.1 --- TermPropertyPanel.java 20 Jul 2006 20:51:12 -0000 1.2 *************** *** 25,28 **** --- 25,29 ---- import edu.iastate.ato.shared.IconLib ; import edu.iastate.ato.tree.DbTermNode ; + import edu.iastate.ato.tree.PackageNode; import edu.iastate.utils.Debug ; *************** *** 162,166 **** addProperty(pair.tag, pair.value) ; } ! enableEditing(!readonly) ; } mainPane.validate() ; --- 163,170 ---- addProperty(pair.tag, pair.value) ; } ! ! enableEditing(!readonly && ((PackageNode)selectedNode.getHomePackageNode()).editing ) ; ! }else{ ! enableEditing(false) ; } mainPane.validate() ; *************** *** 168,172 **** mainPane.repaint() ; } ! public void enableEditing(boolean enabled) { --- 172,176 ---- mainPane.repaint() ; } ! public void enableEditing(boolean enabled) { *************** *** 175,179 **** item.setEditable(enabled) ; } ! btnConfirm.setEnabled(enabled) ; } --- 179,187 ---- item.setEditable(enabled) ; } ! // Added these 2 ! btnAdd.setEnabled(enabled); ! btnCancel.setEnabled(enabled); ! ! btnConfirm.setEnabled(enabled); } |
From: Peter W. <pw...@us...> - 2006-07-20 20:51:15
|
Update of /cvsroot/cob/COBEditor/src/edu/iastate/ato/gui/packageview In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv12202/src/edu/iastate/ato/gui/packageview Modified Files: PackageTreeEditor.java Log Message: Package View is synched up with properties view. Property View's Buttons (add, confirm, cancel) are only available when a term, whos package is being edited, is selected. Index: PackageTreeEditor.java =================================================================== RCS file: /cvsroot/cob/COBEditor/src/edu/iastate/ato/gui/packageview/PackageTreeEditor.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PackageTreeEditor.java 15 Jul 2006 22:10:53 -0000 1.4 --- PackageTreeEditor.java 20 Jul 2006 20:51:12 -0000 1.5 *************** *** 558,562 **** } if(answer != JOptionPane.CANCEL_OPTION || answer == -1){ ! thePackageNode.expanded = false; UserManager.cancelEditing(db, thePackageNode.getOid(), MOEditor.user.name) ; --- 558,563 ---- } if(answer != JOptionPane.CANCEL_OPTION || answer == -1){ ! thePackageNode.editing = false; ! thePackageNode.expanded = false; UserManager.cancelEditing(db, thePackageNode.getOid(), MOEditor.user.name) ; *************** *** 603,607 **** if(suc) { ! Debug.trace("You can edit terms in package '" + node.getLocalName() + "'") ; //System.out.println("EditPackageAction: " + suc); --- 604,609 ---- if(suc) { ! node.editing = true; ! Debug.trace("You can edit terms in package '" + node.getLocalName() + "'") ; //System.out.println("EditPackageAction: " + suc); |
From: Peter W. <pw...@us...> - 2006-07-18 21:32:44
|
Update of /cvsroot/cob/COBEditor/src/edu/iastate/ato/po/naming In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv12578/src/edu/iastate/ato/po/naming Modified Files: BasicNamingPolicy.java Log Message: Index: BasicNamingPolicy.java =================================================================== RCS file: /cvsroot/cob/COBEditor/src/edu/iastate/ato/po/naming/BasicNamingPolicy.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BasicNamingPolicy.java 29 Jun 2006 22:09:47 -0000 1.2 --- BasicNamingPolicy.java 18 Jul 2006 21:32:41 -0000 1.3 *************** *** 63,67 **** return false ; } ! else if(!name.matches("[a-zA-Z0-9][\\s\\w\\-._]*")) { return false ; --- 63,67 ---- return false ; } ! else if(!name.matches("[a-zA-Z0-9][\\s\\w\\-._\\(\\)]*")) { return false ; |
From: Peter W. <pw...@us...> - 2006-07-18 21:32:33
|
Update of /cvsroot/cob/COBEditor/src/edu/iastate/ato/gui In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv12556/src/edu/iastate/ato/gui Modified Files: MOEditor.java Log Message: Index: MOEditor.java =================================================================== RCS file: /cvsroot/cob/COBEditor/src/edu/iastate/ato/gui/MOEditor.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** MOEditor.java 29 Jun 2006 22:15:54 -0000 1.6 --- MOEditor.java 18 Jul 2006 21:32:29 -0000 1.7 *************** *** 119,122 **** --- 119,123 ---- public void updateUser(User newUser) { + if(this.user == newUser) { *************** *** 397,401 **** mainFrame.setJMenuBar(makeFullMenuBar()) ; jToolBar1.setVisible(true) ; ! // update the selected ontology information this.selectedServer = info ; --- 398,409 ---- mainFrame.setJMenuBar(makeFullMenuBar()) ; jToolBar1.setVisible(true) ; ! ! // Enable Ontology Schema Menu Item, if user is an admin ! /*if( newUser.role.equals(User.ADMIN)){ ! this.menuOntologySchema.setEnabled(true); ! }else{ ! this.menuOntologySchema.setEnabled(false); ! }*/ ! // update the selected ontology information this.selectedServer = info ; *************** *** 410,413 **** --- 418,432 ---- { SchemaPanel p = new SchemaPanel(conn.db) ; + + // Enable Ontology Schema Menu Item, if user is an admin + if(user != null){ + if(user.role.equals(User.ADMIN)){ + p.setEditable(true); + }else{ + p.setEditable(false); + } + } + + JDialog dlg = new JDialog(GUIUtils.getRootFrame(this)) ; dlg.getContentPane().add(p) ; *************** *** 736,740 **** logout() ; updateUser(newUser) ; ! updateTitle() ; } } --- 755,760 ---- logout() ; updateUser(newUser) ; ! ! updateTitle() ; } } |