From: <ba...@us...> - 2009-10-30 15:12:35
|
Revision: 2901 http://obo.svn.sourceforge.net/obo/?rev=2901&view=rev Author: balhoff Date: 2009-10-30 15:12:25 +0000 (Fri, 30 Oct 2009) Log Message: ----------- Added some documentation. Modified Paths: -------------- phenex/trunk/src/org/phenoscape/io/URLProxy.java phenex/trunk/src/org/phenoscape/model/OntologyConfiguration.java phenex/trunk/src/org/phenoscape/model/OntologySource.java phenex/trunk/src/org/phenoscape/model/UserOntologyConfiguration.java phenex/trunk/src/org/phenoscape/view/OntologyPreferencesComponent.java Modified: phenex/trunk/src/org/phenoscape/io/URLProxy.java =================================================================== --- phenex/trunk/src/org/phenoscape/io/URLProxy.java 2009-10-29 23:27:38 UTC (rev 2900) +++ phenex/trunk/src/org/phenoscape/io/URLProxy.java 2009-10-30 15:12:25 UTC (rev 2901) @@ -151,14 +151,11 @@ // haven't serialized a map before return new HashMap<String, Object>(); } catch (FileNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); + log().error("Unable to read download cache metadata", e); } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); + log().error("Unable to read download cache metadata", e); } catch (ClassNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); + log().error("Unable to read download cache metadata", e); } return null; } @@ -194,11 +191,9 @@ output.writeObject(metadata); output.close(); } catch (FileNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); + log().error("Unable to write download cache metadata", e); } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); + log().error("Unable to write download cache metadata", e); } } Modified: phenex/trunk/src/org/phenoscape/model/OntologyConfiguration.java =================================================================== --- phenex/trunk/src/org/phenoscape/model/OntologyConfiguration.java 2009-10-29 23:27:38 UTC (rev 2900) +++ phenex/trunk/src/org/phenoscape/model/OntologyConfiguration.java 2009-10-30 15:12:25 UTC (rev 2901) @@ -2,6 +2,10 @@ import java.util.List; +/** + * An object which provides a list of ontology sources for the OntologyController to download. + * @author Jim Balhoff + */ public interface OntologyConfiguration { public List<OntologySource> getSources(); Modified: phenex/trunk/src/org/phenoscape/model/OntologySource.java =================================================================== --- phenex/trunk/src/org/phenoscape/model/OntologySource.java 2009-10-29 23:27:38 UTC (rev 2900) +++ phenex/trunk/src/org/phenoscape/model/OntologySource.java 2009-10-30 15:12:25 UTC (rev 2901) @@ -5,6 +5,10 @@ import org.apache.log4j.Logger; +/** + * A location from which to download a document containing ontology terms. The OntologySource can also be given a user-friendly label. + * @author Jim Balhoff + */ public class OntologySource implements Cloneable, Serializable { private String label; @@ -36,6 +40,9 @@ this.url = newURL; } + /** + * @return a new OntologySource object with the same label and URL as this one. + */ public OntologySource copy() { try { return (OntologySource)(this.clone()); Modified: phenex/trunk/src/org/phenoscape/model/UserOntologyConfiguration.java =================================================================== --- phenex/trunk/src/org/phenoscape/model/UserOntologyConfiguration.java 2009-10-29 23:27:38 UTC (rev 2900) +++ phenex/trunk/src/org/phenoscape/model/UserOntologyConfiguration.java 2009-10-30 15:12:25 UTC (rev 2901) @@ -11,6 +11,11 @@ import org.apache.log4j.Logger; import org.phenoscape.app.PrefObj; +/** + * An implementation of OntologyConfiguration which contains default ontology sources, and can also read and write a persistent + * list of ontology sources to the user's preferences. + * @author Jim Balhoff + */ public class UserOntologyConfiguration implements OntologyConfiguration { public static final String SOURCES_STORAGE_KEY = "sources"; @@ -45,6 +50,9 @@ return this.getStoredSources(); } + /** + * Retrieve the list of ontology sources from the user's preferences. + */ @SuppressWarnings("unchecked") public List<OntologySource> getStoredSources() { try { @@ -66,6 +74,9 @@ return null; } + /** + * Store a given list of ontology sources to the user's preferences. + */ public void storeSources(List<OntologySource> theSources) { //TODO would be nice to communicate these errors to the user try { Modified: phenex/trunk/src/org/phenoscape/view/OntologyPreferencesComponent.java =================================================================== --- phenex/trunk/src/org/phenoscape/view/OntologyPreferencesComponent.java 2009-10-29 23:27:38 UTC (rev 2900) +++ phenex/trunk/src/org/phenoscape/view/OntologyPreferencesComponent.java 2009-10-30 15:12:25 UTC (rev 2901) @@ -42,7 +42,6 @@ private final EventList<OntologySource> sources = new BasicEventList<OntologySource>(); private final EventSelectionModel<OntologySource> sourcesSelectionModel = new EventSelectionModel<OntologySource>(sources); private final List<OntologySource> oldSources = new ArrayList<OntologySource>(); - public static final String SOURCES_STORAGE_KEY = "sources"; private final UserOntologyConfiguration config; //TODO enable/disable apply & revert buttons @@ -74,7 +73,7 @@ private void applyChanges() { this.config.storeSources(this.sources); this.cloneContents(this.sources, this.oldSources); - //TODO tell user they will need to restart to see changes + //TODO tell user they will need to relaunch to see changes } private void revertChanges() { @@ -164,7 +163,6 @@ try { source.setURL(new URL(editedValue.toString())); } catch (MalformedURLException e) { - //TODO check correctness of URL in a cell editor instead log().error("User entered bad URL"); } break; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |