phenote.gui.field
Class TermCompList

java.lang.Object
  extended by phenote.gui.field.CharFieldGui
      extended by phenote.gui.field.AbstractAutoCompList
          extended by phenote.gui.field.TermCompList
All Implemented Interfaces:
ca.odell.glazedlists.event.ListEventListener<CharacterI>, java.util.EventListener

public class TermCompList
extends AbstractAutoCompList


Field Summary
 
Fields inherited from class phenote.gui.field.CharFieldGui
fieldHeight, inputSize, selectionModel
 
Constructor Summary
TermCompList(CharField cf, int minCompChars)
           
 
Method Summary
protected  void checkPostCompButton(boolean allow)
          no-op - overridden by term comp list - set to false for now for terms in comp window - resursion coming...
(package private)  void enableTermInfoListening()
          This is touchy stuff - so i want to be able to display info about term in TermInfo when user mouses over terms in combo boxes JList.
protected  CharFieldValue getCharFieldValue()
          Returns the current value as a "character-independent" value (character is null).
protected  javax.swing.JButton getCompButton()
          Overridden by TermCompList
 org.obo.datamodel.OBOClass getCurrentOboClass()
          Throws exception if there isnt a current obo class, if the user has typed something that isnt yet a term - hasnt selected a term
protected  java.lang.String getCurrentTermRelName()
          Return the name of the current term or relation - was gonna call this item name but that gets confused with "items" in combo box
protected  javax.swing.JComboBox getOntologyChooser()
           
protected  void getSearchItems(java.lang.String input, SearchListener l, boolean thread)
          now threaded so cant return - when done sets AbstractAutoCompList.ListSearchListener.newResults
protected  TermCompList getTermComp()
           
protected  boolean hasCompButton()
          Overridden by TermCompList
protected  boolean hasOntologyChooser()
           
protected  boolean isTermCompList()
           
protected  void setCharFieldValue(CharFieldValue value)
           
protected  void setCurrentValidItem(boolean useTopHit)
          The user has selected a term from the list, validate and set current obo class if doesnt validate throw ex called by updateModel to get valid term.
protected  void setModelToNull()
           
protected  void setOboClass(org.obo.datamodel.OBOClass term)
          rename setTerm?
(package private)  void setOntologyChooserFromTerm(org.obo.datamodel.OBOClass term)
          for post comp gui to set ontol chooser - overridden by term comp
protected  void updateModel(boolean useTopHit)
          edits one or more selected chars if there is valid input, if not sets model to null if useTopHit is false then only set model if have selected comp term (user selected from list).
 
Methods inherited from class phenote.gui.field.AbstractAutoCompList
canGetUIJList, clear, doMouseOver, getCompList, getCompListSearcher, getFirstCompListObj, getJComboBox, getMinCompChars, getSearchParams, getSelectedObject, getTableCellEditor, getText, getUIJList, getUserInputGui, hasFocus, hasMoreThanOneOntology, isCompList, setForegroundColor, setMinCompChars, setTestMode, setText, setText, simulateKeyStroke, simulateLKeyStroke, updateModel
 
Methods inherited from class phenote.gui.field.CharFieldGui
addActionListener, alreadyInList, areCharactersEqualForCharField, commitAndSelectNext, editModelEnabled, enableEditModel, fireActionPerformed, focusGained, focusLost, getCharField, getCharFieldEnum, getCurrentRelation, getDisabledTextColor, getEditButton, getEditManager, getEnabledTextColor, getLabel, getListDelButton, getListGui, getListMessage, getRetrieveButton, getSelectedChars, getSelectionManager, hasChangedMultipleValues, hasEditButton, hasListGui, hasRetrieveButton, isInMultipleValueState, listChanged, makeCharFieldGui, makePostCompTermList, makeRelationList, removeActionListener, setDoingInternalEdit, setEditManager, setEnabledState, setGuiForMultipleValues, setGuiForNoSelection, setHasChangedMultipleValues, setInMultipleValueState, setLabel, setListSelectionModel, setMultipleValuesConditions, setRel, setSelectionManager, setUpdateGuiOnly, setValueFromChars, shouldResetGuiForMultipleValues, updateGuiOnly
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TermCompList

public TermCompList(CharField cf,
                    int minCompChars)
Method Detail

isTermCompList

protected boolean isTermCompList()
Overrides:
isTermCompList in class CharFieldGui

getTermComp

protected TermCompList getTermComp()
Overrides:
getTermComp in class CharFieldGui

hasCompButton

protected boolean hasCompButton()
Description copied from class: CharFieldGui
Overridden by TermCompList

Overrides:
hasCompButton in class CharFieldGui

getCompButton

protected javax.swing.JButton getCompButton()
Description copied from class: CharFieldGui
Overridden by TermCompList

Overrides:
getCompButton in class CharFieldGui

checkPostCompButton

protected void checkPostCompButton(boolean allow)
Description copied from class: CharFieldGui
no-op - overridden by term comp list - set to false for now for terms in comp window - resursion coming...

Overrides:
checkPostCompButton in class CharFieldGui

setCharFieldValue

protected void setCharFieldValue(CharFieldValue value)
Specified by:
setCharFieldValue in class AbstractAutoCompList

getCharFieldValue

protected CharFieldValue getCharFieldValue()
Description copied from class: CharFieldGui
Returns the current value as a "character-independent" value (character is null).

Overrides:
getCharFieldValue in class AbstractAutoCompList

setOntologyChooserFromTerm

void setOntologyChooserFromTerm(org.obo.datamodel.OBOClass term)
Description copied from class: CharFieldGui
for post comp gui to set ontol chooser - overridden by term comp

Overrides:
setOntologyChooserFromTerm in class CharFieldGui

getSearchItems

protected void getSearchItems(java.lang.String input,
                              SearchListener l,
                              boolean thread)
now threaded so cant return - when done sets AbstractAutoCompList.ListSearchListener.newResults

Specified by:
getSearchItems in class AbstractAutoCompList

setCurrentValidItem

protected void setCurrentValidItem(boolean useTopHit)
                            throws OboException
The user has selected a term from the list, validate and set current obo class if doesnt validate throw ex called by updateModel to get valid term. if useTopHit is true then input is partial string and use top hit in comp list. if false only use selected term - throw oboex otherwise

Throws:
OboException

getCurrentTermRelName

protected java.lang.String getCurrentTermRelName()
Description copied from class: AbstractAutoCompList
Return the name of the current term or relation - was gonna call this item name but that gets confused with "items" in combo box

Specified by:
getCurrentTermRelName in class AbstractAutoCompList

setOboClass

protected void setOboClass(org.obo.datamodel.OBOClass term)
rename setTerm?

Overrides:
setOboClass in class CharFieldGui

getCurrentOboClass

public org.obo.datamodel.OBOClass getCurrentOboClass()
                                              throws CharFieldGuiEx
Throws exception if there isnt a current obo class, if the user has typed something that isnt yet a term - hasnt selected a term

Overrides:
getCurrentOboClass in class CharFieldGui
Throws:
CharFieldGuiEx

updateModel

protected void updateModel(boolean useTopHit)
edits one or more selected chars if there is valid input, if not sets model to null if useTopHit is false then only set model if have selected comp term (user selected from list). if useTopHit is true, then input is user string, (user has hit enter) and use the top hit in the list that comes from that partial string

Specified by:
updateModel in class AbstractAutoCompList

setModelToNull

protected void setModelToNull()
Specified by:
setModelToNull in class AbstractAutoCompList

enableTermInfoListening

void enableTermInfoListening()
This is touchy stuff - so i want to be able to display info about term in TermInfo when user mouses over terms in combo boxes JList. This is not explicitly supported by JComboBox. have to dig into its UI to get JList. The combo box ui selects items in JList on mouse over, this listener will listen for those mouse over selections should this be done with a selection event - or is that overkill, i guess the question will anyone besides term info ever care about these mouse over selection - if so make generic


hasOntologyChooser

protected boolean hasOntologyChooser()
Overrides:
hasOntologyChooser in class AbstractAutoCompList

getOntologyChooser

protected javax.swing.JComboBox getOntologyChooser()
Overrides:
getOntologyChooser in class CharFieldGui