From: <mg...@us...> - 2007-08-28 19:57:33
|
Revision: 837 http://obo.svn.sourceforge.net/obo/?rev=837&view=rev Author: mgibson Date: 2007-08-28 12:57:33 -0700 (Tue, 28 Aug 2007) Log Message: ----------- if min comp chars is not 0 then dont preload the completion field this seems sensible and it makes post comp gui come up much faster as that preloading was bogging it down pre loading is really for fields without that many terms should have a config for it - but non zero min-comp-chars serves as such for the moment - and maybe is sufficient though i think eventually if a user does hit down arrow on empty (or less than min) it should do completion - override min Modified Paths: -------------- 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/FieldPanel.java phenote/trunk/src/java/phenote/gui/field/PostCompGui.java phenote/trunk/src/java/phenote/gui/field/TermCompList.java Modified: phenote/trunk/src/java/phenote/gui/field/AbstractAutoCompList.java =================================================================== --- phenote/trunk/src/java/phenote/gui/field/AbstractAutoCompList.java 2007-08-28 19:36:48 UTC (rev 836) +++ phenote/trunk/src/java/phenote/gui/field/AbstractAutoCompList.java 2007-08-28 19:57:33 UTC (rev 837) @@ -48,7 +48,12 @@ private int minCompChars = 0; protected AbstractAutoCompList(CharField cf) { + this(cf,0); // minCompChars = 0 + } + + protected AbstractAutoCompList(CharField cf,int minCompChars) { super(cf); + setMinCompChars(minCompChars); init(); } @@ -60,7 +65,10 @@ jComboBox.addActionListener(new ComboBoxActionListener()); compListSearcher = new CompListSearcher(getCharField().getOntologyList()); // init with all terms if config.showAllOnEmptyInput... - doCompletion(false); // dont show popup - we dont have a gui yet, just populating + if (getMinCompChars() == 0) { + boolean showPopupWithComp = false; // dont show popup - + doCompletion(showPopupWithComp); //we dont have a gui yet, just populating + } } public void setMinCompChars(int minChars) { minCompChars = minChars; } Modified: phenote/trunk/src/java/phenote/gui/field/CharFieldGui.java =================================================================== --- phenote/trunk/src/java/phenote/gui/field/CharFieldGui.java 2007-08-28 19:36:48 UTC (rev 836) +++ phenote/trunk/src/java/phenote/gui/field/CharFieldGui.java 2007-08-28 19:57:33 UTC (rev 837) @@ -63,10 +63,10 @@ /** CharFieldGui for main window not post comp box - factory method */ - static CharFieldGui makeCharFieldGui(CharField charField) { + static CharFieldGui makeCharFieldGui(CharField charField,int minCompChars) { if (charField.isTerm()) { //hasOntologies()) { //return new TermCompList(charField,sp,true); // enable listeners - TermCompList t = new TermCompList(charField); + TermCompList t = new TermCompList(charField,minCompChars); //t.setSearchParams(sp); t.allowPostCompButton(true); return t; @@ -93,11 +93,12 @@ /** make term completion lists for post comp window (genus & diff), they dont listen to selection nor edit model - isolated */ - static CharFieldGui makePostCompTermList(CharField cf,String label) { + static CharFieldGui makePostCompTermList(CharField cf,String label, + int minCompChars) { // false - no listeners(dont edit model), false - dont add comp button // eventually adding comp button come from config for recursive comp //boolean allowPostCompBut = false; - TermCompList t = new TermCompList(cf); + TermCompList t = new TermCompList(cf,minCompChars); //t.setSearchParams(sp); // t.isInSeparateWindow(true) or t.isolate(true)?? t.enableEditModel(false); Modified: phenote/trunk/src/java/phenote/gui/field/FieldPanel.java =================================================================== --- phenote/trunk/src/java/phenote/gui/field/FieldPanel.java 2007-08-28 19:36:48 UTC (rev 836) +++ phenote/trunk/src/java/phenote/gui/field/FieldPanel.java 2007-08-28 19:57:33 UTC (rev 837) @@ -133,11 +133,8 @@ fieldPanel = new JPanel(new GridBagLayout()); jTabbedPane.addTab("Tab "+tab++,fieldPanel); } - CharFieldGui gui = CharFieldGui.makeCharFieldGui(charField); - if (charField.isTerm()) { - int minCompChars = Config.inst().getMinCompChars(fieldNum); - gui.setMinCompChars(minCompChars); - } + int minCompChars = Config.inst().getMinCompChars(fieldNum); + CharFieldGui gui = CharFieldGui.makeCharFieldGui(charField,minCompChars); ++fieldNum; gui.setSelectionManager(this.selectionManager); gui.setEditManager(this.editManager); Modified: phenote/trunk/src/java/phenote/gui/field/PostCompGui.java =================================================================== --- phenote/trunk/src/java/phenote/gui/field/PostCompGui.java 2007-08-28 19:36:48 UTC (rev 836) +++ phenote/trunk/src/java/phenote/gui/field/PostCompGui.java 2007-08-28 19:57:33 UTC (rev 837) @@ -81,8 +81,7 @@ //compFieldPanel.setSearchParams(searchParams); // MAIN GENUS TERM - genusField = CharFieldGui.makePostCompTermList(charField,"Genus"); - genusField.setMinCompChars(minCompChars); + genusField = CharFieldGui.makePostCompTermList(charField,"Genus",minCompChars); genusField.setSelectionManager(this.selectionManager); compFieldPanel.addCharFieldGuiToPanel(genusField); @@ -130,7 +129,7 @@ relField.setEditManager(PostCompGui.this.editManager); relField.setSelectionManager(PostCompGui.this.selectionManager); compFieldPanel.addCharFieldGuiToPanel(relField); - diffField = CharFieldGui.makePostCompTermList(charField,"Differentia"); + diffField = CharFieldGui.makePostCompTermList(charField,"Differentia",minCompChars); diffField.setEditManager(PostCompGui.this.editManager); diffField.setSelectionManager(PostCompGui.this.selectionManager); compFieldPanel.addCharFieldGuiToPanel(diffField); Modified: phenote/trunk/src/java/phenote/gui/field/TermCompList.java =================================================================== --- phenote/trunk/src/java/phenote/gui/field/TermCompList.java 2007-08-28 19:36:48 UTC (rev 836) +++ phenote/trunk/src/java/phenote/gui/field/TermCompList.java 2007-08-28 19:57:33 UTC (rev 837) @@ -34,8 +34,9 @@ private JButton postCompButton; - protected TermCompList(CharField cf) { - super(cf); + protected TermCompList(CharField cf,int minCompChars) { + // AbstractAutoCompList constructor - does pre-populating if minCompChars==0 + super(cf,minCompChars); init(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |