From: <mg...@us...> - 2006-10-18 14:05:51
|
Revision: 161 http://svn.sourceforge.net/obo/?rev=161&view=rev Author: mgibson Date: 2006-10-18 07:05:43 -0700 (Wed, 18 Oct 2006) Log Message: ----------- fixed bug where fields werent resetting on character selection in table on char selection comp list wasnt setting its (new) model as comp list now tracks model this has side effect that invalid text (non-term) is getting wiped out if go on to new field - this is something nicole requested so keep it for now - maybe its better that way but i noticed a new bug sometimes comp list not coming in on 1st char - but sometimes it is Modified Paths: -------------- phenote/trunk/src/java/phenote/config/OntologyConfig.java phenote/trunk/src/java/phenote/datamodel/OntologyManager.java phenote/trunk/src/java/phenote/gui/field/AbstractAutoCompList.java phenote/trunk/src/java/phenote/gui/field/CharFieldGui.java phenote/trunk/src/java/phenote/gui/field/RelationCompList.java phenote/trunk/src/java/phenote/gui/field/TermCompList.java Modified: phenote/trunk/src/java/phenote/config/OntologyConfig.java =================================================================== --- phenote/trunk/src/java/phenote/config/OntologyConfig.java 2006-10-17 13:09:04 UTC (rev 160) +++ phenote/trunk/src/java/phenote/config/OntologyConfig.java 2006-10-18 14:05:43 UTC (rev 161) @@ -5,11 +5,11 @@ public String name; public String ontologyFile; - public String nameSpace; + //public String nameSpace; // not used yet - or was this what filter out ended up public String filterOut; // public typeEnum? type?? eg Entity/GT/Pato...?? - static OntologyConfig defaultPato = new OntologyConfig("Pato","attribute_and_value.obo"); + //static OntologyConfig defaultPato = new OntologyConfig("Pato","attribute_and_value.obo"); OntologyConfig() {} // not sure this is actually needed/used OntologyConfig(String name) { this.name = name; } Modified: phenote/trunk/src/java/phenote/datamodel/OntologyManager.java =================================================================== --- phenote/trunk/src/java/phenote/datamodel/OntologyManager.java 2006-10-17 13:09:04 UTC (rev 160) +++ phenote/trunk/src/java/phenote/datamodel/OntologyManager.java 2006-10-18 14:05:43 UTC (rev 161) @@ -80,7 +80,7 @@ merge this with getOboClassWithEx? */ public OBOClass getOboClass(String id) throws TermNotFoundException { OBOClass oboClass; -// this seems to be the sole reason for ontology list - silly! +// this seems to be the sole reason for ontology list - silly! use char fields! Iterator<Ontology> iter = allOntologyList.iterator(); while (iter.hasNext()) { Ontology o = iter.next(); Modified: phenote/trunk/src/java/phenote/gui/field/AbstractAutoCompList.java =================================================================== --- phenote/trunk/src/java/phenote/gui/field/AbstractAutoCompList.java 2006-10-17 13:09:04 UTC (rev 160) +++ phenote/trunk/src/java/phenote/gui/field/AbstractAutoCompList.java 2006-10-18 14:05:43 UTC (rev 161) @@ -28,6 +28,7 @@ import org.geneontology.oboedit.datamodel.OBOProperty; import phenote.datamodel.CharField; +import phenote.datamodel.CharacterI; //import phenote.datamodel.CharFieldEnum; //import phenote.datamodel.CharacterI; //import phenote.datamodel.Ontology; @@ -110,6 +111,12 @@ protected boolean editModelEnabled() { return editModel; } + /** char in table changed - adjust - not needed for rel(at least not yet) + as post comp doesnt listen to table changes (does it? should it?), + just term */ + protected abstract void setValueFromChar(CharacterI chr); + // {charField.getCharFieldEnum().getValue(chr).getOboClass() } + ///** If true than the auto combo is for setting the differentia in a post comp term, // if false (default) than no post comp or genus in post comp */ //void setIsDifferentia(boolean isDiff) { isDifferentia = isDiff; } @@ -126,7 +133,7 @@ this.doCompletion = doCompletion; this.keyTyped = doCompletion; // key has to be typed for completion getEditor().setItem(text); - //log().debug("setting text "+text); + //if (charField!=null)log().debug(charField.getName()+" setting text ["+text+"]"); //new Throwable().printStackTrace(); this.doCompletion = true; // set back to default } @@ -198,7 +205,8 @@ // but this is needed from mouse release on selection set text // is called and will cause completion list to come up after sel // w/o it - //log().debug("AutoTextField.setText "+text); + //if (charField!=null) + //log().debug(charField.getName()+" AutoTextField.setText ["+text+"]"+getCurrentTermRelName()); //new Throwable().printStackTrace(); doCompletion = false; //this is problematic for syns & such where string is diff than term name @@ -441,7 +449,7 @@ //log().debug("configure editor called"+anItem); //new Throwable().printStackTrace(); // it appears to be ok to supress this entirely - // super.configureEditor(anEditor,anItem); // ??? supress + super.configureEditor(anEditor,anItem); // ??? supress } Modified: phenote/trunk/src/java/phenote/gui/field/CharFieldGui.java =================================================================== --- phenote/trunk/src/java/phenote/gui/field/CharFieldGui.java 2006-10-17 13:09:04 UTC (rev 160) +++ phenote/trunk/src/java/phenote/gui/field/CharFieldGui.java 2006-10-18 14:05:43 UTC (rev 161) @@ -93,11 +93,14 @@ EditManager.inst().addCharChangeListener(new FieldCharChangeListener()); } + // i think this was to receive edits from term info?? which no longer edits - + // but could imagine other things editing?? investigate this private class FieldCharChangeListener implements CharChangeListener { public void charChanged(CharChangeEvent e) { // check charField is this char field if (e.getSource() != CharFieldGui.this && e.isForCharField(charField)) // i think all we need to do is setText to synch with model + // for complist dont we also need to set its model (not just text??) setText(e.getValueString()); } } @@ -147,6 +150,9 @@ +" names in config "); return; } + // if its a comp list need to set its model/current term rel (for AACL.setText) + if (isCompList) + getCompList().setValueFromChar(character); String v = charField.getCharFieldEnum().getValue(character).getName(); setText(v); } Modified: phenote/trunk/src/java/phenote/gui/field/RelationCompList.java =================================================================== --- phenote/trunk/src/java/phenote/gui/field/RelationCompList.java 2006-10-17 13:09:04 UTC (rev 160) +++ phenote/trunk/src/java/phenote/gui/field/RelationCompList.java 2006-10-18 14:05:43 UTC (rev 161) @@ -6,6 +6,9 @@ import org.geneontology.oboedit.datamodel.OBOProperty; +import phenote.datamodel.CharacterI; + + class RelationCompList extends AbstractAutoCompList { private OBOProperty currentRel=null; @@ -89,6 +92,11 @@ /** no-op - relation list doesnt edit model (at least presently) */ protected void editModel() {} + /** char in table changed - adjust - not needed for rel(at least not yet) + as post comp doesnt listen to table changes (does it? should it?), + just term */ + protected void setValueFromChar(CharacterI chr) {} + /** Returns a vector of CompletionRelations for auto completion which contain input, using search params */ protected Vector getSearchItems(String input) { Modified: phenote/trunk/src/java/phenote/gui/field/TermCompList.java =================================================================== --- phenote/trunk/src/java/phenote/gui/field/TermCompList.java 2006-10-17 13:09:04 UTC (rev 160) +++ phenote/trunk/src/java/phenote/gui/field/TermCompList.java 2006-10-18 14:05:43 UTC (rev 161) @@ -27,6 +27,20 @@ } + /** char in table changed - setCurrentOboClass & text */ + protected void setValueFromChar(CharacterI chr) { + OBOClass selCharTerm = + getCharField().getCharFieldEnum().getValue(chr).getOboClass(); + // if null then user has made a new char or selected a char with no term + if (selCharTerm == null) { + currentOboClass = null; // makes getCurTermRelName "" + setText(""); // actually calls getCurTermRelNm which is "" + } + else { + setOboClass(selCharTerm); // doesnt allow null + } + } + protected Vector getSearchItems(String input) { return getCompListSearcher().getStringMatchTerms(input); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |