phenote.gui.field
Class CharFieldGui

java.lang.Object
  extended by phenote.gui.field.CharFieldGui
All Implemented Interfaces:
java.util.EventListener, javax.swing.event.ListSelectionListener
Direct Known Subclasses:
AbstractAutoCompList, FreeTextField, PickListFieldGui, ReadOnlyFieldGui

public abstract class CharFieldGui
extends java.lang.Object
implements javax.swing.event.ListSelectionListener

fields can either be text fields for free text or combo boxes if have ontology to browse - CharFieldGui does either - with get/setText - hides the details of the gui - just a field that gives text ListSelectionListener listening to events from table selection (make inner class?) subclasses: TermCompList, FreeTextField,...


Field Summary
(package private) static int fieldHeight
           
(package private) static java.awt.Dimension inputSize
           
protected  ca.odell.glazedlists.swing.EventSelectionModel<CharacterI> selectionModel
           
 
Constructor Summary
protected CharFieldGui(CharField charField)
           
 
Method Summary
protected  boolean areCharactersEqualForCharField(java.util.List<CharacterI> characters, CharField charField)
          return true if all values for char field in all characters are the same value(equal) - used for multi select
protected  void checkPostCompButton(boolean allow)
          no-op - overridden by term comp list - set to false for now for terms in comp window - resursion coming...
 void commitAndSelectNext()
           
protected  boolean editModelEnabled()
           
protected  void enableEditModel(boolean em)
           
protected  void focusGained()
           
protected  void focusLost()
           
protected  CharField getCharField()
           
(package private)  CharFieldEnum getCharFieldEnum()
           
protected  javax.swing.JButton getCompButton()
          Overridden by TermCompList
(package private)  AbstractAutoCompList getCompList()
          for testing and internal use - overridden
(package private)  org.obo.datamodel.OBOClass getCurrentOboClass()
          overridden by term comp list
 org.obo.datamodel.OBOProperty getCurrentRelation()
          overridden by RelationCompList
protected  java.awt.Color getDisabledTextColor()
           
 EditManager getEditManager()
           
protected  java.awt.Color getEnabledTextColor()
           
(package private)  java.lang.String getLabel()
           
(package private)  javax.swing.JButton getListDelButton()
           
protected  javax.swing.JComponent getListGui()
          JList? initialize if configged list gui is the list that is displayed if the field is multi valued - takes more than one value - NOT the drop down list
 int getMinCompChars()
           
protected  javax.swing.JComboBox getOntologyChooser()
           
(package private)  javax.swing.JButton getRetrieveButton()
           
protected  java.util.List<CharacterI> getSelectedChars()
          get selected chars from selection model
 SelectionManager getSelectionManager()
           
protected  TermCompList getTermComp()
           
protected abstract  java.lang.String getText()
           
protected abstract  javax.swing.JComponent getUserInputGui()
          Get the component used for user input - text field or jCombo
protected  boolean hasChangedMultipleValues()
           
protected  boolean hasCompButton()
          Overridden by TermCompList
protected abstract  boolean hasFocus()
           
protected  boolean hasListGui()
          should get this from config...
protected  boolean hasOntologyChooser()
           
(package private)  boolean hasRetrieveButton()
           
(package private)  boolean isCompList()
           
protected  boolean isInMultipleValueState()
           
protected  boolean isTermCompList()
           
static CharFieldGui makeCharFieldGui(CharField charField, int minCompChars)
          CharFieldGui for main window not post comp box - factory method, make appropriate CFG subclass from type of charField - minCompChars is not used at moment - may come back
static CharFieldGui makePostCompTermList(CharField cf, java.lang.String label, int minCompChars)
          make term completion lists for post comp window (genus & diff), they dont listen to selection nor edit model - isolated
static CharFieldGui makeRelationList(CharField cf)
          createPostCompRelationList - will relation lists ever be in main window and if so will they ever have listeners enabled - maybe, probably not
protected abstract  void setCharFieldValue(CharFieldValue value)
           
protected  void setDoingInternalEdit(boolean doingEdit)
           
 void setEditManager(EditManager manager)
           
protected  void setForegroundColor(java.awt.Color color)
           
protected  void setGuiForMultipleValues()
           
protected  void setGuiForNoSelection()
           
protected  void setHasChangedMultipleValues(boolean hasChangedMultipleValues)
           
protected  void setInMultipleValueState(boolean inMultipleValueState)
           
protected  void setLabel(java.lang.String label)
           
 void setListSelectionModel(ca.odell.glazedlists.swing.EventSelectionModel<CharacterI> model)
           
 void setMinCompChars(int minCompChars)
          no op - override in term completion gui
protected  void setMultipleValuesConditions()
           
protected  void setOboClass(org.obo.datamodel.OBOClass term)
          no-op overridden by TermCompList
(package private)  void setOntologyChooserFromTerm(org.obo.datamodel.OBOClass term)
          for post comp gui to set ontol chooser - overridden by term comp
(package private)  void setRel(org.obo.datamodel.OBOProperty rel)
          for auto combos (ontol) for relationships (post comp rel) no-op overriddedn by RelationCompList
 void setSelectionManager(SelectionManager manager)
           
protected abstract  void setText(java.lang.String text)
           
protected  void setUpdateGuiOnly(boolean u)
           
protected  void setValueFromChars(java.util.List<CharacterI> characters)
          Set the gui from the model (selection)
protected  boolean shouldResetGuiForMultipleValues()
           
protected  boolean updateGuiOnly()
           
protected abstract  void updateModel()
          Main method for subclasses to edit model with current value
 void valueChanged(javax.swing.event.ListSelectionEvent e)
          part of ListSelectionListener interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fieldHeight

static int fieldHeight

inputSize

static java.awt.Dimension inputSize

selectionModel

protected ca.odell.glazedlists.swing.EventSelectionModel<CharacterI> selectionModel
Constructor Detail

CharFieldGui

protected CharFieldGui(CharField charField)
Method Detail

makeCharFieldGui

public static CharFieldGui makeCharFieldGui(CharField charField,
                                            int minCompChars)
CharFieldGui for main window not post comp box - factory method, make appropriate CFG subclass from type of charField - minCompChars is not used at moment - may come back


makeRelationList

public static CharFieldGui makeRelationList(CharField cf)
createPostCompRelationList - will relation lists ever be in main window and if so will they ever have listeners enabled - maybe, probably not


makePostCompTermList

public static CharFieldGui makePostCompTermList(CharField cf,
                                                java.lang.String label,
                                                int minCompChars)
make term completion lists for post comp window (genus & diff), they dont listen to selection nor edit model - isolated


getUserInputGui

protected abstract javax.swing.JComponent getUserInputGui()
Get the component used for user input - text field or jCombo


setListSelectionModel

public void setListSelectionModel(ca.odell.glazedlists.swing.EventSelectionModel<CharacterI> model)

valueChanged

public void valueChanged(javax.swing.event.ListSelectionEvent e)
part of ListSelectionListener interface. Receives ListSelectionEvents from selectionModel. Table row selection causes this event to fly

Specified by:
valueChanged in interface javax.swing.event.ListSelectionListener

setDoingInternalEdit

protected void setDoingInternalEdit(boolean doingEdit)

setValueFromChars

protected void setValueFromChars(java.util.List<CharacterI> characters)
Set the gui from the model (selection)


areCharactersEqualForCharField

protected boolean areCharactersEqualForCharField(java.util.List<CharacterI> characters,
                                                 CharField charField)
return true if all values for char field in all characters are the same value(equal) - used for multi select


setCharFieldValue

protected abstract void setCharFieldValue(CharFieldValue value)

focusLost

protected void focusLost()

focusGained

protected void focusGained()

commitAndSelectNext

public void commitAndSelectNext()

setSelectionManager

public void setSelectionManager(SelectionManager manager)

getSelectionManager

public SelectionManager getSelectionManager()

setEditManager

public void setEditManager(EditManager manager)

getEditManager

public EditManager getEditManager()

setMultipleValuesConditions

protected void setMultipleValuesConditions()

shouldResetGuiForMultipleValues

protected boolean shouldResetGuiForMultipleValues()

setGuiForMultipleValues

protected void setGuiForMultipleValues()

setGuiForNoSelection

protected void setGuiForNoSelection()

getDisabledTextColor

protected java.awt.Color getDisabledTextColor()

getEnabledTextColor

protected java.awt.Color getEnabledTextColor()

isInMultipleValueState

protected boolean isInMultipleValueState()

setInMultipleValueState

protected void setInMultipleValueState(boolean inMultipleValueState)

hasChangedMultipleValues

protected boolean hasChangedMultipleValues()

setHasChangedMultipleValues

protected void setHasChangedMultipleValues(boolean hasChangedMultipleValues)

setForegroundColor

protected void setForegroundColor(java.awt.Color color)

hasFocus

protected abstract boolean hasFocus()

enableEditModel

protected void enableEditModel(boolean em)

editModelEnabled

protected boolean editModelEnabled()

updateModel

protected abstract void updateModel()
Main method for subclasses to edit model with current value


getSelectedChars

protected java.util.List<CharacterI> getSelectedChars()
get selected chars from selection model


checkPostCompButton

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


hasRetrieveButton

boolean hasRetrieveButton()

getRetrieveButton

javax.swing.JButton getRetrieveButton()

updateGuiOnly

protected boolean updateGuiOnly()

setUpdateGuiOnly

protected void setUpdateGuiOnly(boolean u)

getCompList

AbstractAutoCompList getCompList()
for testing and internal use - overridden


isCompList

boolean isCompList()

getTermComp

protected TermCompList getTermComp()

setLabel

protected void setLabel(java.lang.String label)

getLabel

java.lang.String getLabel()

setText

protected abstract void setText(java.lang.String text)

getText

protected abstract java.lang.String getText()

setOboClass

protected void setOboClass(org.obo.datamodel.OBOClass term)
no-op overridden by TermCompList


setRel

void setRel(org.obo.datamodel.OBOProperty rel)
for auto combos (ontol) for relationships (post comp rel) no-op overriddedn by RelationCompList


getCharFieldEnum

CharFieldEnum getCharFieldEnum()

getCharField

protected CharField getCharField()

getCurrentOboClass

org.obo.datamodel.OBOClass getCurrentOboClass()
                                        throws CharFieldGuiEx
overridden by term comp list

Throws:
CharFieldGuiEx

getCurrentRelation

public org.obo.datamodel.OBOProperty getCurrentRelation()
                                                 throws CharFieldGuiEx
overridden by RelationCompList

Throws:
CharFieldGuiEx

isTermCompList

protected boolean isTermCompList()

setOntologyChooserFromTerm

void setOntologyChooserFromTerm(org.obo.datamodel.OBOClass term)
for post comp gui to set ontol chooser - overridden by term comp


hasOntologyChooser

protected boolean hasOntologyChooser()

getOntologyChooser

protected javax.swing.JComboBox getOntologyChooser()

hasCompButton

protected boolean hasCompButton()
Overridden by TermCompList


getCompButton

protected javax.swing.JButton getCompButton()
Overridden by TermCompList


hasListGui

protected boolean hasListGui()
should get this from config... stub for now


getListGui

protected javax.swing.JComponent getListGui()
JList? initialize if configged list gui is the list that is displayed if the field is multi valued - takes more than one value - NOT the drop down list


getListDelButton

javax.swing.JButton getListDelButton()

setMinCompChars

public void setMinCompChars(int minCompChars)
no op - override in term completion gui


getMinCompChars

public int getMinCompChars()