gov.nih.nlm.mms.browser
Class AbstractFinder

java.lang.Object
  extended bygov.nih.nlm.mms.browser.AbstractFinder
All Implemented Interfaces:
Comparable, Configurable, Finder, GUIConfigurable
Direct Known Subclasses:
CuiSearchFinder, TreeBrowserFinder, WordSearchFinder

public abstract class AbstractFinder
extends Object
implements Comparable, Finder

Abstract implementation of the Finder interface.

Author:
Deborah Shapiro

Field Summary
protected  ConceptListManager clm
           
protected  String font_family
           
protected  int font_point_size
           
protected  boolean has_data_changed
          Indicates whether or not filter data has changed (and therefore needs to be saved).
protected  UserConfiguration user_configuration
           
 
Constructor Summary
AbstractFinder()
          Instantiates a WordSearchFinder.
 
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.
 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 getValidateMessage()
          Returns a message indicating why validation failed.
 String[] getValidationErrors()
          Returns the messages indicating why validation failed.
 String[] getValidationWarnings()
          Returns warnings that were indicated during validation.
 boolean hasDataChanged()
          Indicates whether or not the configuration information has changed.
 void refresh()
          Redraws the text portions of the Finder.
 void removeDataChangeListener(DataChangeListener dcl)
          Removes the specified DataChangeListener.
 void resetDataChanged()
          Sets the data changed flag to false.
 void setConceptListManager(ConceptListManager clm)
          Returns the ConceptListManager.
 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 setFontFamily(String font_family)
          Sets the font family for this Finder.
 void setFontPointSize(int point_size)
          Sets the font point size for this Finder.
 void setPanelSelections()
          Updates the view to reflect the data model.
 void setProperties(Properties p)
          Sets the Properties representing the configuration choices.
 void subsetDirectoryOpened(File source_dir)
          Handles opening of a source directory.
 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
 
Methods inherited from interface gov.nih.nlm.mms.GUIConfigurable
getName, getPanel, hasAdvancedOptions, showOptions
 
Methods inherited from interface gov.nih.nlm.mms.Configurable
resetToDefaults
 

Field Detail

clm

protected ConceptListManager clm

user_configuration

protected UserConfiguration user_configuration

font_family

protected String font_family

font_point_size

protected int font_point_size

has_data_changed

protected boolean has_data_changed
Indicates whether or not filter data has changed (and therefore needs to be saved).

Constructor Detail

AbstractFinder

public AbstractFinder()
Instantiates a WordSearchFinder.

Method Detail

setConceptListManager

public void setConceptListManager(ConceptListManager clm)
Returns the ConceptListManager.

Specified by:
setConceptListManager in interface Finder
Parameters:
clm - ConceptListManager

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

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.

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

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

getValidateMessage

public String getValidateMessage()
Returns a message indicating why validation failed. Should only be called if validate() returns false.

Returns:
the message

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 Finders.

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.

subsetDirectoryOpened

public void subsetDirectoryOpened(File source_dir)
Handles opening of a source directory.

Specified by:
subsetDirectoryOpened in interface Finder
Parameters:
source_dir - the source directory

setFontPointSize

public void setFontPointSize(int point_size)
Sets the font point size for this Finder.

Specified by:
setFontPointSize in interface Finder
Parameters:
point_size - int

setFontFamily

public void setFontFamily(String font_family)
Sets the font family for this Finder.

Specified by:
setFontFamily in interface Finder
Parameters:
font_family - int

refresh

public void refresh()
Redraws the text portions of the Finder.

Specified by:
refresh in interface Finder


Copyright ©2005