gov.nih.nlm.mms.filters
Class ContentViewFilter

java.lang.Object
  extended bygov.nih.nlm.mms.filters.AbstractFilter
      extended bygov.nih.nlm.mms.filters.ContentViewFilter
All Implemented Interfaces:
Comparable, ConceptContentSelector, Configurable, Filter, GUIConfigurable, SourcesToRemoveListener, SubsetListener

public class ContentViewFilter
extends AbstractFilter
implements SourcesToRemoveListener, ConceptContentSelector

Keeps only content in selected content views. Content view definitions are entirely data driven from the "default" property file.


Field Summary
 
Fields inherited from class gov.nih.nlm.mms.filters.AbstractFilter
default_configuration, init_cui, subset_content, user_configuration
 
Constructor Summary
ContentViewFilter()
          Instantiates an empty ContentViewFilter.
 
Method Summary
 void applySelections(Concept concept)
          Apply the filter to the specified Concept.
 Color getColor()
          Method indicates the Color that should be used to display the name.
 String getConfigurationDetails()
          Returns the statement that should appear in the subset log file regarding this Filter.
 GUIConfigurable getGUIConfigurableForValidationFailure()
          Returns the GUIConfigurable whose tab should next be displayed to allow the user to correct an error or warning.
 JPanel getHelpPanel()
          Method provides a JPanel that will be called from the help menu to allow the user to reference a help window that is particular to this filter.
 String getName()
          Returns the name of the Filter.
 JPanel getPanel()
          Returns a configuration panel.
 Properties getProperties()
          Returns a Properties object with the configuration.
 String getTabDescription()
          Return the description to appear above the main configuration panel in the {#link MetamorphoSysGUI}.
 String getValidateMessage()
          Returns the validation message (if validation falied).
 String[] getValidationErrors()
          Returns the messages indicating why validation failed.
 String[] getValidationWarnings()
          Returns warnings that were indicated during validation.
 boolean isEfficientEnabled()
          Indicates if Filter can use the efficient mode during the "Initialize Cuis" phase of the subsetting process.
 void resetToDefaults()
          There are no defaults because this filter has nothing to configure.
 void setConfiguration(ApplicationConfiguration c)
          Gives the filter access to the default configuration object.
 void setPanelSelections()
          Inactive method because there are no items to configure on this filter.
 void setProperties(Properties props)
          Not an active method, because this filter doesn't have any filter specific properties.
 void sourcesToRemoveChanged(SourcesToRemoveEvent stre)
          Listens for changes in the sources to remove list.
 boolean validate()
          This method is the default method for filters that don't check for validity and it returns true indicating a valid filter.
 
Methods inherited from class gov.nih.nlm.mms.filters.AbstractFilter
addDataChangeListener, applyFilter, beginInitializeCuiList, beginSubsetContent, compareTo, endInitializeCuiList, endSubsetContent, fireDataChanged, fireNotUndoableDataChanged, hasAdvancedOptions, hasDataChanged, removeDataChangeListener, resetDataChanged, setConfiguration, setCuiList, setDataChanged, showOptions
 
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.filters.Filter
applyFilter
 
Methods inherited from interface gov.nih.nlm.mms.GUIConfigurable
addDataChangeListener, hasAdvancedOptions, hasDataChanged, removeDataChangeListener, resetDataChanged, setDataChanged, showOptions
 
Methods inherited from interface gov.nih.nlm.mms.Configurable
setConfiguration
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface gov.nih.nlm.mms.SubsetListener
beginInitializeCuiList, beginSubsetContent, endInitializeCuiList, endSubsetContent, setCuiList
 

Constructor Detail

ContentViewFilter

public ContentViewFilter()
Instantiates an empty ContentViewFilter.

Method Detail

getPanel

public JPanel getPanel()
Returns a configuration panel. Allows user to choose which content views should be applied.

Specified by:
getPanel in interface GUIConfigurable
Returns:
the configuration JPanel

getHelpPanel

public JPanel getHelpPanel()
Method provides a JPanel that will be called from the help menu to allow the user to reference a help window that is particular to this filter.

Specified by:
getHelpPanel in interface GUIConfigurable
Overrides:
getHelpPanel in class AbstractFilter
Returns:
JPanel to be added to the Help menu

getTabDescription

public String getTabDescription()
Return the description to appear above the main configuration panel in the {#link MetamorphoSysGUI}.

Specified by:
getTabDescription in interface GUIConfigurable
Returns:
tab description String

resetToDefaults

public void resetToDefaults()
There are no defaults because this filter has nothing to configure.

Specified by:
resetToDefaults in interface Configurable

setConfiguration

public void setConfiguration(ApplicationConfiguration c)
Gives the filter access to the default configuration object.

Specified by:
setConfiguration in interface Configurable
Overrides:
setConfiguration in class AbstractFilter
Parameters:
c - ApplicationConfiguration

getProperties

public Properties getProperties()
Returns a Properties object with the configuration.

Specified by:
getProperties in interface Configurable
Returns:
a Properties object with the configuration.

setProperties

public void setProperties(Properties props)
Not an active method, because this filter doesn't have any filter specific properties.

Specified by:
setProperties in interface Configurable
Parameters:
props - Properties

applySelections

public void applySelections(Concept concept)
Apply the filter to the specified Concept. Atoms whose Content View Fields don't provide a bit-wise AND with the selected views, that is non-zero, are removed.

Specified by:
applySelections in interface ConceptContentSelector
Parameters:
concept - Concept

setPanelSelections

public void setPanelSelections()
Inactive method because there are no items to configure on this filter.

Specified by:
setPanelSelections in interface GUIConfigurable

getName

public String getName()
Returns the name of the Filter.

Specified by:
getName in interface GUIConfigurable
Returns:
name of the filter

getConfigurationDetails

public String getConfigurationDetails()
Returns the statement that should appear in the subset log file regarding this Filter.

Specified by:
getConfigurationDetails in interface Configurable
Returns:
filter statement for log file

getColor

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

Specified by:
getColor in interface GUIConfigurable
Overrides:
getColor in class AbstractFilter
Returns:
Color

isEfficientEnabled

public boolean isEfficientEnabled()
Indicates if Filter can use the efficient mode during the "Initialize Cuis" phase of the subsetting process. The efficient mode reads only MRCONSO and MRSTY during the "Initialize Cuis" phase.

Specified by:
isEfficientEnabled in interface Filter
Returns:
true if efficient mode is acceptable false if efficient mode is not acceptable

validate

public boolean validate()
This method is the default method for filters that don't check for validity and it returns true indicating a valid filter.

Specified by:
validate in interface GUIConfigurable
Overrides:
validate in class AbstractFilter
Returns:
true filter is valid

getValidateMessage

public String getValidateMessage()
Returns the validation message (if validation falied).

Overrides:
getValidateMessage in class AbstractFilter
Returns:
the validation message (if validation falied)

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
Overrides:
getValidationErrors in class AbstractFilter
Returns:
the failure messages

getValidationWarnings

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

Specified by:
getValidationWarnings in interface GUIConfigurable
Overrides:
getValidationWarnings in class AbstractFilter
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
Overrides:
getGUIConfigurableForValidationFailure in class AbstractFilter
Returns:
GUIConfigurable to be displayed

sourcesToRemoveChanged

public void sourcesToRemoveChanged(SourcesToRemoveEvent stre)
Listens for changes in the sources to remove list.

Specified by:
sourcesToRemoveChanged in interface SourcesToRemoveListener
Parameters:
stre - the event


Copyright ©2005