gov.nih.nlm.mms
Class AbstractGUIConfigurable

java.lang.Object
  extended by gov.nih.nlm.mms.AbstractGUIConfigurable
All Implemented Interfaces:
Configurable, GUIConfigurable, Comparable
Direct Known Subclasses:
MRCXTBuilder

public class AbstractGUIConfigurable
extends Object
implements GUIConfigurable

Generically represents an object that can be configured by the MetamorphoSysGUI.

Author:
Deborah Shapiro

Field Summary
protected  ApplicationConfiguration default_configuration
           
protected  UserConfiguration user_configuration
           
 
Constructor Summary
AbstractGUIConfigurable()
           
 
Method Summary
 void addDataChangeListener(DataChangeListener dcl)
          Adds a DataChangeListener that responds to configuration changes.
 int compareTo(Object o)
          Compares this object with the specified object for order.
 Color getColor()
          Returns the Color that should be used to display the name.
 String getConfigurationDetails()
          Method returns a String detailing the user selections on the filter.
 GUIConfigurable getGUIConfigurableForValidationFailure()
          Returns the GUIConfigurable whose tab should next be displayed to allow the user to correct an error or warning.
 JPanel getHelpPanel()
          Returns a JPanel that will be displayed when the user selects the corresponding menu item from the Help menu and will provide the user with detailed instructions on the tab's use.
 String getName()
          Returns the name.
 JPanel getPanel()
          Returns a JPanel containing configuration options.
 Properties getProperties()
          Returns the Properties representing the configuration choices.
 String getTabDescription()
          Returns the description to be used in conjunction with the panel when presented to the user.
 String[] getValidationErrors()
          Returns the messages indicating why validation failed.
 String[] getValidationWarnings()
          Returns warnings that were indicated during validation.
 boolean hasAdvancedOptions()
          Indicates whether or not an options menu item should be supplied for advanced configuration options.
 boolean hasDataChanged()
          Indicates whether or not the configuration information has changed.
 void removeDataChangeListener(DataChangeListener dcl)
          Removes the specified DataChangeListener.
 void resetDataChanged()
          Sets the data changed flag to false.
 void resetToDefaults()
          Resets the configuration back to default values.
 void setConfiguration(ApplicationConfiguration c)
          Method provides the filter with values from the default configuration file.
 void setConfiguration(UserConfiguration c)
          Method provides the filter with values from the user configuration file.
 void setDataChanged(boolean b)
          Sets the value of the data changed flag.
 void setPanelSelections()
          Updates the view to reflect the data model.
 void setProperties(Properties p)
          Sets the Properties representing the configuration choices.
 void showOptions()
          Presents an advanced options GUI to the user.
 boolean validate()
          Indicates whether or not the validation rules have passed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

user_configuration

protected UserConfiguration user_configuration

default_configuration

protected ApplicationConfiguration default_configuration
Constructor Detail

AbstractGUIConfigurable

public AbstractGUIConfigurable()
Method Detail

setConfiguration

public void setConfiguration(ApplicationConfiguration c)
Method provides the filter with values from the default configuration file.

Specified by:
setConfiguration in interface Configurable
Parameters:
c - ApplicationConfiguration

setConfiguration

public void setConfiguration(UserConfiguration c)
Method provides the filter with values from the user configuration file.

Specified by:
setConfiguration in interface Configurable
Parameters:
c - UserConfiguration

getConfigurationDetails

public String getConfigurationDetails()
Method returns a String detailing the user selections on the filter. This String will be displayed in the mmsys.log at the completion of subsetting so it should be formatted to be easily read.

Specified by:
getConfigurationDetails in interface Configurable
Returns:
String of data for log

getProperties

public Properties getProperties()
Returns the Properties representing the configuration choices.

Specified by:
getProperties in interface Configurable
Returns:
the Properties representing the configuration choices

setProperties

public void setProperties(Properties p)
Sets the Properties representing the configuration choices.

Specified by:
setProperties in interface Configurable
Parameters:
p - the Properties representing the configuration choices

resetToDefaults

public void resetToDefaults()
Resets the configuration back to default values. When used with a GUI this method should change the data model behind the GUI and allow setPanelSelections to actually update the GUI.

Specified by:
resetToDefaults in interface Configurable

getPanel

public JPanel getPanel()
Returns a JPanel containing configuration options.

Specified by:
getPanel in interface GUIConfigurable
Returns:
a JPanel containing configuration options

hasDataChanged

public boolean hasDataChanged()
Indicates whether or not the configuration information has changed.

Specified by:
hasDataChanged in interface GUIConfigurable
Returns:
true if data has changed; false otherwise

setDataChanged

public void setDataChanged(boolean b)
Sets the value of the data changed flag.

Specified by:
setDataChanged in interface GUIConfigurable
Parameters:
b - the boolean value for the data changed flag

resetDataChanged

public void resetDataChanged()
Sets the data changed flag to false.

Specified by:
resetDataChanged in interface GUIConfigurable

addDataChangeListener

public void addDataChangeListener(DataChangeListener dcl)
Adds a DataChangeListener that responds to configuration changes. Allows main GUI to record all changes to this gui in the undo/redo mechanism.

Specified by:
addDataChangeListener in interface GUIConfigurable
Parameters:
dcl - the DataChangeListener to add

removeDataChangeListener

public void removeDataChangeListener(DataChangeListener dcl)
Removes the specified DataChangeListener.

Specified by:
removeDataChangeListener in interface GUIConfigurable
Parameters:
dcl - the DataChangeListener to remove

getColor

public Color getColor()
Returns the Color that should be used to display the name.

Specified by:
getColor in interface GUIConfigurable
Returns:
the Color that should be used to display the name.

getName

public String getName()
Returns the name.

Specified by:
getName in interface GUIConfigurable
Returns:
the name

getTabDescription

public String getTabDescription()
Returns the description to be used in conjunction with the panel when presented to the user.

Specified by:
getTabDescription in interface GUIConfigurable
Returns:
the description

showOptions

public void showOptions()
Presents an advanced options GUI to the user.

Specified by:
showOptions in interface GUIConfigurable

hasAdvancedOptions

public boolean hasAdvancedOptions()
Indicates whether or not an options menu item should be supplied for advanced configuration options.

Specified by:
hasAdvancedOptions in interface GUIConfigurable
Returns:
true if so; false otherwise

getHelpPanel

public JPanel getHelpPanel()
Returns a JPanel that will be displayed when the user selects the corresponding menu item from the Help menu and will provide the user with detailed instructions on the tab's use.

Specified by:
getHelpPanel in interface GUIConfigurable
Returns:
the JPanel to be used when showing user help

setPanelSelections

public void setPanelSelections()
Updates the view to reflect the data model.

Specified by:
setPanelSelections in interface GUIConfigurable

validate

public boolean validate()
Indicates whether or not the validation rules have passed.

Specified by:
validate in interface GUIConfigurable
Returns:
booleantrue if so; false otherwise

getValidationErrors

public String[] getValidationErrors()
Returns the messages indicating why validation failed. Should only be called if validate() returns false.

Specified by:
getValidationErrors in interface GUIConfigurable
Returns:
the failure messages

getValidationWarnings

public String[] getValidationWarnings()
Returns warnings that were indicated during validation.

Specified by:
getValidationWarnings in interface GUIConfigurable
Returns:
the warning messages

getGUIConfigurableForValidationFailure

public GUIConfigurable getGUIConfigurableForValidationFailure()
Returns the GUIConfigurable whose tab should next be displayed to allow the user to correct an error or warning.

Specified by:
getGUIConfigurableForValidationFailure in interface GUIConfigurable
Returns:
GUIConfigurable to be displayed

compareTo

public int compareTo(Object o)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Required method for implementing Comparable interface. Indicates the means for comparison between two Filters.

Specified by:
compareTo in interface Comparable
Parameters:
o - the Object to be compared.
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Throws:
ClassCastException - if the specified object's type is not GUIConfigurable.


Copyright ©2005