gov.nih.nlm.mms.filters
Class ContentViewFilter

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.ContentViewFilter
All Implemented Interfaces:
Configurable, ConceptContentSelector, Filter, GUIConfigurable, SourcesToRemoveListener, SubsetListener, Comparable
Direct Known Subclasses:
ContentViewBrowserRestrictorFilter

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.


Nested Class Summary
protected  class ContentViewFilter.ContentViewOption
          Represents a single defined content view.
 
Field Summary
protected  ContentView combined_view
           
protected  Map<String,ContentViewFilter.ContentViewOption> id_to_content_views
           
protected  boolean ignore_events
           
protected  Set<String> selected_views
           
protected  List sources_to_remove
           
 
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
ContentViewFilter()
          Instantiates an empty ContentViewFilter.
 
Method Summary
protected  void addSelectedView(String id)
          Adds a selected view to the group of ones that will be applied.
 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.
 ContentView getCombinedView()
          Returns the combined view, the bit-wise OR for all currently selected content views.
 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 getIdForName(String name)
          Returns the content view id associated with the given content view name.
 String[] getIdsForFlag(long flag)
           
 String getName()
          Returns the name of the Filter.
 String getNameForId(String id)
          Returns the content view name associated with the given content view id.
 JPanel getPanel()
          Returns a configuration panel.
 Properties getProperties()
          Returns a Properties object with the configuration.
 String[] getSelectedViews()
           
 String getTabDescription()
          Return the description to appear above the main configuration panel in the {#link MetamorphoSysGUI}.
 boolean isEfficientEnabled()
          Indicates if Filter can use the efficient mode during the "Initialize Cuis" phase of the subsetting process.
protected  void makeCombinedView()
          Calculates the bit-wise OR for all currently selected views.
protected  void removeSelectedView(String id)
          Removes a selected view from the group of ones that will be applied.
 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
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, getValidationErrors, getValidationWarnings, hasAdvancedOptions, hasDataChanged, removeDataChangeListener, resetDataChanged, setConfiguration, 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, getWarnings
 
Methods inherited from interface gov.nih.nlm.mms.GUIConfigurable
addDataChangeListener, getValidationErrors, getValidationWarnings, 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
 

Field Detail

sources_to_remove

protected List sources_to_remove

ignore_events

protected boolean ignore_events

id_to_content_views

protected final Map<String,ContentViewFilter.ContentViewOption> id_to_content_views

selected_views

protected final Set<String> selected_views

combined_view

protected final ContentView combined_view
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
Overrides:
getPanel in class AbstractGUIConfigurable
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 AbstractGUIConfigurable
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
Overrides:
getTabDescription in class AbstractGUIConfigurable
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
Overrides:
resetToDefaults in class AbstractGUIConfigurable

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 AbstractGUIConfigurable
Parameters:
c - ApplicationConfiguration

getProperties

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

Specified by:
getProperties in interface Configurable
Overrides:
getProperties in class AbstractGUIConfigurable
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
Overrides:
setProperties in class AbstractGUIConfigurable
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
Overrides:
setPanelSelections in class AbstractGUIConfigurable

getName

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

Specified by:
getName in interface GUIConfigurable
Overrides:
getName in class AbstractGUIConfigurable
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
Overrides:
getConfigurationDetails in class AbstractGUIConfigurable
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 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

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 AbstractGUIConfigurable
Returns:
true filter is valid

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

addSelectedView

protected void addSelectedView(String id)
Adds a selected view to the group of ones that will be applied.

Parameters:
id - for the related ContentViewOption

removeSelectedView

protected void removeSelectedView(String id)
Removes a selected view from the group of ones that will be applied.

Parameters:
id - for the related ContentViewOption

makeCombinedView

protected void makeCombinedView()
Calculates the bit-wise OR for all currently selected views.


getCombinedView

public ContentView getCombinedView()
Returns the combined view, the bit-wise OR for all currently selected content views.

Returns:
ContentView combined_view

getSelectedViews

public String[] getSelectedViews()

getNameForId

public String getNameForId(String id)
Returns the content view name associated with the given content view id.

Parameters:
id - String
Returns:
content view name

getIdForName

public String getIdForName(String name)
Returns the content view id associated with the given content view name.

Parameters:
id - String
Returns:
content view id

getIdsForFlag

public String[] getIdsForFlag(long flag)


Copyright ©2005