gov.nih.nlm.mms.filters
Class SourcesToRemoveFilter

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

public class SourcesToRemoveFilter
extends AbstractFilter
implements ConceptContentSelector

This Filter removes all CUIs that are from sources chosen to be excluded from the subset.

Author:
Deborah Shapiro

Field Summary
 
Fields inherited from class gov.nih.nlm.mms.filters.AbstractFilter
default_configuration, init_cui, subset_content, user_configuration
 
Constructor Summary
SourcesToRemoveFilter()
          Instantiates an empty SourcesToRemoveFilter.
 
Method Summary
 void addSelectedSource(Source source)
          This method adds a Source to the data structure that holds the list of selected sources.
 void applySelections(Concept concept)
          Method which determines if a given Concept or its components will be removed from the release.
 void clearSelectedSources()
          This method clears the data structure that holds the list of selected sources.
 void clearSourceDependencies()
          Clears data structure that holds Dependency(s).
 boolean enforceDependentSourceSelection()
          This method indicates whether the Enforce Dependent Source Selection option has been chosen on the Advanced Source List Options dialog box.
 boolean enforceFamilySelection()
          This method indicates whether or not the Enforce Family Selection option has been chosen in the Advanced Source List Options dialog box.
 boolean getAutomaticSelection()
          This method returns whether or not the automatic_selection option has been chosen on the MetamorphoSys Options dialog box.
 Color getColor()
          Method indicates the Color that should be used to display the name.
 ApplicationConfiguration getConfiguration()
          Method returns the default ApplicationConfiguration.
 String getConfigurationDetails()
          Method returns a list of the sources to be excluded and sources to be kept for display in the configuration file.
 List getDefaultSourcesToRemove()
          This method returns a List of all Sources to be excluded.
 Set getDefaultSourcesToRemoveAsSet()
          This method returns a Set containing the default list of all Sources to be excluded.
 List getDependentSources(Source source)
          Method gets all dependent sources for a given Source.
 Set getDependentSourcesAsSet(Source source)
          Method gets all dependent sources for a given Source.
 JPanel getHelpPanel()
          Method provides a JPanel that will be added to the main GUI help menu to allow the user to consult a help window that is particular to this filter.
 String getName()
          Returns the name.
 JPanel getPanel()
          Method provides the GUI panel that will display the filter's screen as one of the tabs on the main GUI window.
 Properties getProperties()
          Method returns all properties specific to the filter.
 List getSelectedSources()
          This method returns the List containing all Sources selected.
 Set getSelectedSourcesAsSet()
          This method returns the Set containing all Sources selected.
 List getSelectedSourcesInverse()
          This method returns the List of Sources that are not selected.
 Set getSelectedSourcesInverseAsSet()
          This method returns the Set of Sources that are not selected.
 List getSourceDependencies()
          Method returns a List of Dependency(s).
 Set getSourceDependenciesAsSet()
          Method returns a Set of Dependency(s).
 List getSources()
          Returns the list of Sources from the default configuration.
 List getSourcesToRemove()
          This method is used by the SourcesToRemoveListener to determine which sources should be removed from the other Filter's displays.
 String getTabDescription()
          Method provides the description of the filter's screen and includes instructions on use.
 boolean hasAdvancedOptions()
          Indicates whether or not an options menu item should be supplied for advanced configuration options.
 boolean hasDependentSource(Source source)
          Returns if given Source has a dependent source.
 void initialize()
          Set initial values for filter specific variables from user config file.
 boolean isEfficientEnabled()
          Indicates if Filter can use the efficient mode during the "Initialize Cuis" phase of the subsetting process.
 boolean isSourceToRemove(Source s)
          This method returns a boolean depending on whether or not the Source is excluded from the subset.
 void removeSelectedSource(Source source)
          This method removes a Source from the data structure that holds the list of selected sources.
 boolean removeSelectedSources()
          This method indicates whether the selections represent sources to be excluded or sources to be kept.
 void resetToDefaults()
          Method allows the user to reset the filter's settings to defaults.
 void setConfiguration(ApplicationConfiguration c)
          Method provides the filter with values from the default properties file.
 void setConfiguration(UserConfiguration c)
          Method provides the filter with values from the user configuration file.
 void setEnforceDependentSourceSelection(boolean b)
          This method sets whether or not the Enforce Dependent Source Selection option will be executed on the gui.
 void setEnforceFamilySelection(boolean b)
          This method sets whether or not the Enforce Family Selection option will be executed on the gui.
 void setPanelSelections()
          Method makes selections on the filter's table
 void setProperties(Properties p)
          Method provides the filter with all properties specific to the filter.
 void setRemoveSelectedSources(boolean b)
          This method sets whether or not the selections represent sources to be excluded or sources to be kept.
 void setSelectedSources(List str)
          This method replaces the selected_sources list with the one provided.
 void setSelectedSources(Set str)
          This method replaces the selected_sources list with the one provided.
 void setSourceDependencies(List source_dependencies)
          Replaces the struction that holds Dependency(s) with the one given.
 void showOptions()
          Presents an advanced options GUI to the user.
 
Methods inherited from class gov.nih.nlm.mms.filters.AbstractFilter
addDataChangeListener, applyFilter, beginInitializeCuiList, beginSubsetContent, compareTo, endInitializeCuiList, endSubsetContent, fireDataChanged, fireNotUndoableDataChanged, getGUIConfigurableForValidationFailure, getValidateMessage, getValidationErrors, getValidationWarnings, hasDataChanged, removeDataChangeListener, resetDataChanged, setCuiList, setDataChanged, validate
 
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, getGUIConfigurableForValidationFailure, getValidationErrors, getValidationWarnings, hasDataChanged, removeDataChangeListener, resetDataChanged, setDataChanged, validate
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface gov.nih.nlm.mms.SubsetListener
beginInitializeCuiList, beginSubsetContent, endInitializeCuiList, endSubsetContent, setCuiList
 

Constructor Detail

SourcesToRemoveFilter

public SourcesToRemoveFilter()
Instantiates an empty SourcesToRemoveFilter.

Method Detail

initialize

public void initialize()
Set initial values for filter specific variables from user config file.


getPanel

public JPanel getPanel()
Method provides the GUI panel that will display the filter's screen as one of the tabs on the main GUI window.

Specified by:
getPanel in interface GUIConfigurable
Returns:
JPanel that displays the graphical interface for the filter

setPanelSelections

public void setPanelSelections()
Method makes selections on the filter's table

Specified by:
setPanelSelections in interface GUIConfigurable

getTabDescription

public String getTabDescription()
Method provides the description of the filter's screen and includes instructions on use.

Specified by:
getTabDescription in interface GUIConfigurable
Returns:
String text of instructions for use of panel

resetToDefaults

public void resetToDefaults()
Method allows the user to reset the filter's settings to defaults.

Specified by:
resetToDefaults in interface Configurable

showOptions

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

Specified by:
showOptions in interface GUIConfigurable
Overrides:
showOptions in class AbstractFilter

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
Overrides:
hasAdvancedOptions in class AbstractFilter
Returns:
true if so; false otherwise

getHelpPanel

public JPanel getHelpPanel()
Method provides a JPanel that will be added to the main GUI help menu to allow the user to consult 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

setConfiguration

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

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

getConfiguration

public ApplicationConfiguration getConfiguration()
Method returns the default ApplicationConfiguration.

Returns:
ApplicationConfiguration

getProperties

public Properties getProperties()
Method returns all properties specific to the filter.

Specified by:
getProperties in interface Configurable
Returns:
Properties only those directly related to the filter. They will start with the filter's class name which will be concatenated to the name of the property. Filter.property_name

setProperties

public void setProperties(Properties p)
Method provides the filter with all properties specific to the filter.

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

applySelections

public void applySelections(Concept concept)
Method which determines if a given Concept or its components will be removed from the release.

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

getName

public String getName()
Returns the name.

Specified by:
getName in interface GUIConfigurable
Returns:
String

getConfigurationDetails

public String getConfigurationDetails()
Method returns a list of the sources to be excluded and sources to be kept for display in the configuration file.

Specified by:
getConfigurationDetails in interface Configurable
Returns:
String

clearSelectedSources

public void clearSelectedSources()
This method clears the data structure that holds the list of selected sources.


addSelectedSource

public void addSelectedSource(Source source)
This method adds a Source to the data structure that holds the list of selected sources.

Parameters:
source - Source

removeSelectedSource

public void removeSelectedSource(Source source)
This method removes a Source from the data structure that holds the list of selected sources.

Parameters:
source - Source

getSelectedSources

public List getSelectedSources()
This method returns the List containing all Sources selected.

Returns:
List selected_sources

getSelectedSourcesAsSet

public Set getSelectedSourcesAsSet()
This method returns the Set containing all Sources selected.

Returns:
Set selected_sources

getSourcesToRemove

public List getSourcesToRemove()
This method is used by the SourcesToRemoveListener to determine which sources should be removed from the other Filter's displays.

Returns:
List of Sources

getSelectedSourcesInverse

public List getSelectedSourcesInverse()
This method returns the List of Sources that are not selected.

Returns:
List of Sources not selected

getSelectedSourcesInverseAsSet

public Set getSelectedSourcesInverseAsSet()
This method returns the Set of Sources that are not selected.

Returns:
Set of Sources not selected

getDefaultSourcesToRemove

public List getDefaultSourcesToRemove()
This method returns a List of all Sources to be excluded.

Returns:
List

getDefaultSourcesToRemoveAsSet

public Set getDefaultSourcesToRemoveAsSet()
This method returns a Set containing the default list of all Sources to be excluded.

Returns:
Set

setSelectedSources

public void setSelectedSources(List str)
This method replaces the selected_sources list with the one provided.

Parameters:
str - List of Sources

setSelectedSources

public void setSelectedSources(Set str)
This method replaces the selected_sources list with the one provided.

Parameters:
str - Set of Sources

isSourceToRemove

public boolean isSourceToRemove(Source s)
This method returns a boolean depending on whether or not the Source is excluded from the subset.

Parameters:
s - Source
Returns:
boolean true if Source is to be removed false if Source is to be kept

enforceFamilySelection

public boolean enforceFamilySelection()
This method indicates whether or not the Enforce Family Selection option has been chosen in the Advanced Source List Options dialog box.

Returns:
boolean true all sources that share a source family will also be selected false otherwise

setEnforceFamilySelection

public void setEnforceFamilySelection(boolean b)
This method sets whether or not the Enforce Family Selection option will be executed on the gui.

Parameters:
b - boolean true all sources that share a source family will also be selected false otherwise

enforceDependentSourceSelection

public boolean enforceDependentSourceSelection()
This method indicates whether the Enforce Dependent Source Selection option has been chosen on the Advanced Source List Options dialog box.

Returns:
true all sources that are dependent on the chosen source will also be selected false otherwise

setEnforceDependentSourceSelection

public void setEnforceDependentSourceSelection(boolean b)
This method sets whether or not the Enforce Dependent Source Selection option will be executed on the gui.

Parameters:
b - boolean

removeSelectedSources

public boolean removeSelectedSources()
This method indicates whether the selections represent sources to be excluded or sources to be kept.

Returns:
true selected sources will be excluded false selected sources will be kept

setRemoveSelectedSources

public void setRemoveSelectedSources(boolean b)
This method sets whether or not the selections represent sources to be excluded or sources to be kept.

Parameters:
b - boolean

getAutomaticSelection

public boolean getAutomaticSelection()
This method returns whether or not the automatic_selection option has been chosen on the MetamorphoSys Options dialog box. Automatic selection allows the application to select dependent sources and sources sharing the source family without prompting the user. This occurs only if the enforce_dep_source_selection and enforce_family_selection flags are set to true on the Advanced Source List Options dialog box.

Returns:
true if automatic selection has been chosen false otherwise

setConfiguration

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

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

getSourceDependencies

public List getSourceDependencies()
Method returns a List of Dependency(s).

Returns:
List

getSourceDependenciesAsSet

public Set getSourceDependenciesAsSet()
Method returns a Set of Dependency(s).

Returns:
Set

getDependentSources

public List getDependentSources(Source source)
Method gets all dependent sources for a given Source.

Parameters:
source - Source
Returns:
List of Sources

getDependentSourcesAsSet

public Set getDependentSourcesAsSet(Source source)
Method gets all dependent sources for a given Source.

Parameters:
source - Source
Returns:
Set of Sources

hasDependentSource

public boolean hasDependentSource(Source source)
Returns if given Source has a dependent source.

Parameters:
source - Source
Returns:
boolean true if source has a dependent source false otherwise

clearSourceDependencies

public void clearSourceDependencies()
Clears data structure that holds Dependency(s).


setSourceDependencies

public void setSourceDependencies(List source_dependencies)
Replaces the struction that holds Dependency(s) with the one given.

Parameters:
source_dependencies - List of Dependency(s)

getSources

public List getSources()
Returns the list of Sources from the default configuration.

Returns:
List of sources

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


Copyright ©2005