phenote.gui.field
Class CharFieldGui

java.lang.Object
  extended by phenote.gui.field.CharFieldGui
All Implemented Interfaces:
ca.odell.glazedlists.event.ListEventListener<CharacterI>, java.util.EventListener
Direct Known Subclasses:
AbstractAutoCompList, CharacterListFieldGui, FreeTextField, PickListFieldGui

public abstract class CharFieldGui
extends java.lang.Object
implements ca.odell.glazedlists.event.ListEventListener<CharacterI>

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
 void addActionListener(java.awt.event.ActionListener l)
           
protected  boolean alreadyInList(org.obo.datamodel.OBOObject obj)
           
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()
          This method is called by a ResponderChainAction.
protected  boolean editModelEnabled()
           
protected  void enableEditModel(boolean em)
           
protected  void fireActionPerformed()
           
protected  void focusGained()
           
protected  void focusLost()
           
protected  CharField getCharField()
           
(package private)  CharFieldEnum getCharFieldEnum()
           
protected abstract  CharFieldValue getCharFieldValue()
          Returns the current value as a "character-independent" value (character is null).
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()
           
(package private)  javax.swing.JButton getEditButton()
           
 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
(package private)  javax.swing.JLabel getListMessage()
          list message is to display message to user on multi select that not all lists selected are same - if so
 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()
           
abstract  javax.swing.table.TableCellEditor getTableCellEditor()
           
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
(package private)  boolean hasEditButton()
           
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()
           
 void listChanged(ca.odell.glazedlists.event.ListEvent<CharacterI> listChanges)
          part of ListEventListener interface.
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 RelationCompList makeRelationList(CharField cf)
          createPostCompRelationList - will relation lists ever be in main window and if so will they ever have listeners enabled - maybe, probably not
 void removeActionListener(java.awt.event.ActionListener l)
           
protected abstract  void setCharFieldValue(CharFieldValue value)
           
protected  void setDoingInternalEdit(boolean doingEdit)
           
 void setEditManager(EditManager manager)
           
protected  void setEnabledState()
           
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
 
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 RelationCompList 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)

listChanged

public void listChanged(ca.odell.glazedlists.event.ListEvent<CharacterI> listChanges)
part of ListEventListener interface. Receives ListEvents from selectionModel's EventList. Table row selection causes this event to fly

Specified by:
listChanged in interface ca.odell.glazedlists.event.ListEventListener<CharacterI>

setDoingInternalEdit

protected void setDoingInternalEdit(boolean doingEdit)

setValueFromChars

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


setEnabledState

protected void setEnabledState()

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)

getCharFieldValue

protected abstract CharFieldValue getCharFieldValue()
Returns the current value as a "character-independent" value (character is null).


focusLost

protected void focusLost()

focusGained

protected void focusGained()

commitAndSelectNext

public void commitAndSelectNext()
This method is called by a ResponderChainAction. It commits the currently edited value, then causes the next character to be selected so that the user can keep editing the same field for each character.


setSelectionManager

public void setSelectionManager(SelectionManager manager)

getSelectionManager

public SelectionManager getSelectionManager()

setEditManager

public void setEditManager(EditManager manager)

getEditManager

public EditManager getEditManager()

getTableCellEditor

public abstract javax.swing.table.TableCellEditor getTableCellEditor()

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


hasEditButton

boolean hasEditButton()

getEditButton

javax.swing.JButton getEditButton()

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()

getListMessage

javax.swing.JLabel getListMessage()
list message is to display message to user on multi select that not all lists selected are same - if so


alreadyInList

protected boolean alreadyInList(org.obo.datamodel.OBOObject obj)

setMinCompChars

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


getMinCompChars

public int getMinCompChars()

addActionListener

public void addActionListener(java.awt.event.ActionListener l)

removeActionListener

public void removeActionListener(java.awt.event.ActionListener l)

fireActionPerformed

protected void fireActionPerformed()