gov.nih.nlm.mms.filters
Class SourcesToRemoveFilter

java.lang.Object
  extended by gov.nih.nlm.mms.AbstractGUIConfigurable
      extended by gov.nih.nlm.mms.filters.AbstractFilter
          extended by gov.nih.nlm.mms.filters.SourcesToRemoveFilter
All Implemented Interfaces:
Configurable, ConceptContentSelector, Filter, GUIConfigurable, SubsetListener, Comparable
Direct Known Subclasses:
SourceBrowserRestrictorFilter

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
protected  String base_url
           
protected  ApplicationConfiguration default_config
           
protected  List<Dependency> default_dependent_sources
           
protected  List<Source> default_sources_to_remove
           
protected  List<Dependency> dependent_sources
           
protected  boolean enforce_dep_source_selection
           
protected  boolean enforce_family_selection
           
protected  Properties filter_props
           
protected  JPanel full_panel
           
protected  JRadioButton keep_sources
           
protected  JPanel panel
           
protected  boolean remove_selected_sources
           
protected  JRadioButton remove_sources
           
protected  Set<Source> selected_sources
           
protected  SourcesToRemoveJTable source_table
           
protected  UserConfiguration user_config
           
 
Fields inherited from class gov.nih.nlm.mms.filters.AbstractFilter
init_cui, subset_content, warnings
 
Fields inherited from class gov.nih.nlm.mms.AbstractGUIConfigurable
data_changed, default_configuration, listeners, 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.
 String getBaseSourceInformationURL()
          Returns the base URL for connectiong sources to online documentation.
 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.
protected  Color getHighlightedColor()
           
protected  Color getHighlightedTextColor()
           
 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<Source> 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 setBaseSourceInformationURL(String base_url)
          Sets the base URL for connectiong sources to online documentation.
 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
applyFilter, beginInitializeCuiList, beginSubsetContent, endInitializeCuiList, endSubsetContent, fireDataChanged, fireNotUndoableDataChanged, getValidateMessage, getWarnings, setCuiList
 
Methods inherited from class gov.nih.nlm.mms.AbstractGUIConfigurable
addDataChangeListener, addValidationError, addValidationWarning, clearValidationErrors, clearValidationWarnings, compareTo, getGUIConfigurableForValidationFailure, getValidationErrors, getValidationWarnings, hasDataChanged, removeDataChangeListener, resetDataChanged, 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, getWarnings
 
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
 

Field Detail

default_config

protected ApplicationConfiguration default_config

user_config

protected UserConfiguration user_config

filter_props

protected Properties filter_props

enforce_family_selection

protected boolean enforce_family_selection

enforce_dep_source_selection

protected boolean enforce_dep_source_selection

remove_selected_sources

protected boolean remove_selected_sources

dependent_sources

protected List<Dependency> dependent_sources

default_dependent_sources

protected List<Dependency> default_dependent_sources

selected_sources

protected Set<Source> selected_sources

default_sources_to_remove

protected List<Source> default_sources_to_remove

source_table

protected SourcesToRemoveJTable source_table

panel

protected JPanel panel

full_panel

protected JPanel full_panel

remove_sources

protected JRadioButton remove_sources

keep_sources

protected JRadioButton keep_sources

base_url

protected String base_url
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
Overrides:
getPanel in class AbstractGUIConfigurable
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
Overrides:
setPanelSelections in class AbstractGUIConfigurable

getTabDescription

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

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

getHighlightedColor

protected Color getHighlightedColor()

getHighlightedTextColor

protected Color getHighlightedTextColor()

resetToDefaults

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

Specified by:
resetToDefaults in interface Configurable
Overrides:
resetToDefaults in class AbstractGUIConfigurable

showOptions

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

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

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 AbstractGUIConfigurable
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 AbstractGUIConfigurable
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 AbstractGUIConfigurable
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
Overrides:
getProperties in class AbstractGUIConfigurable
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
Overrides:
setProperties in class AbstractGUIConfigurable
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
Overrides:
getName in class AbstractGUIConfigurable
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
Overrides:
getConfigurationDetails in class AbstractGUIConfigurable
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<Source> 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

getBaseSourceInformationURL

public String getBaseSourceInformationURL()
Returns the base URL for connectiong sources to online documentation.

Returns:
base url, null if not set

setBaseSourceInformationURL

public void setBaseSourceInformationURL(String base_url)
Sets the base URL for connectiong sources to online documentation.

Parameters:
base_url - the base url

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 AbstractGUIConfigurable
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 AbstractGUIConfigurable
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