gov.nih.nlm.mms.filters
Class SemanticTypesToRemoveFilter

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

public class SemanticTypesToRemoveFilter
extends AbstractFilter
implements ConceptSelector

This Filter removes all CUIs with a given semantic type

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
SemanticTypesToRemoveFilter()
          Instantiates a SemanticTypesToRemoveFilter.
 
Method Summary
 void addSemanticTypeToRemove(HierarchicalSemanticType semantic_type)
          Adds a HierarchicalSemanticType to the data structure that holds the list of semantic_types to be excluded.
 boolean anySty()
          Indicates whether any or all of a concepts semantic types must be on the removal list for the concept to be removed.
 boolean getAutomaticSelection()
          Indicates whether the automatic_selection option has been chosen on the MetamorphoSys Options dialog box.
 Color getColor()
          Returns the Color that should be used to display the name.
 String getConfigurationDetails()
          Returns the configuration details for mmsys.log.
 JPanel getHelpPanel()
          Returns the help JPanel.
 String getName()
          Returns the name.
 JPanel getPanel()
          Returns the GUI panel that will display the filter's screen as one of the tabs on the main GUI window.
 Properties getProperties()
          Returns the filter state as a Properties object.
 List getSemanticTypesToRemove()
          Returns eturns the List containing all HierarchicalSemanticTypes to be excluded.
 HierarchicalSemanticType getSTYForString(String sem_type)
          Returns the HierarchicalSemanticType with the given String representation.
 String getTabDescription()
          Returns the description.
 boolean hasAdvancedOptions()
          Indicates whether or not an options menu item should be supplied for advanced configuration options.
 boolean isEfficientEnabled()
          Indicates whether or not this filter can use the efficient mode during the "Initialize Cuis" phase of the subsetting process.
 boolean isSemanticTypeToRemove(HierarchicalSemanticType semantic_type)
          Indicates whether or not the specified HierarchicalSemanticType is of the type to be removed.
 boolean keep(Concept concept)
          Indicates if Concept should be selected to be kept for the subset.
 boolean removeSelectedSemanticTypes()
          This method indicates whether the selections represent semantic types to be excluded or semantic types to be kept.
 void removeSemanticTypeToRemove(HierarchicalSemanticType semantic_type)
          Removes a HierarchicalSemanticType from the data structure that holds the list of semantic_types to be excluded.
 void resetToDefaults()
          Resets state to default values.
 void setAnySty(boolean b)
          Sets whether any or all of a concepts semantic types must be on the removal list for the concept to be removed.
 void setPanelSelections()
          Applies filter state to panel selections.
 void setProperties(Properties props)
          Sets the filter state via a Properties object.
 void setRemoveSelectedSemanticTypes(boolean b)
          This method sets whether or not the selections represent semantic types to be excluded or semantic types to be kept.
 void setSemanticTypesToRemove(List str)
          Sets the List of HierarchicalSemanticTypes to exclude.
 void showOptions()
          Show Options GUI.
 void valueChanged(ListSelectionEvent e)
          Sets the list of semantic_types to removed when selection changes.
 
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, setConfiguration, setConfiguration, 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 gov.nih.nlm.mms.Configurable
setConfiguration, 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

SemanticTypesToRemoveFilter

public SemanticTypesToRemoveFilter()
Instantiates a SemanticTypesToRemoveFilter.

Method Detail

getPanel

public JPanel getPanel()
Returns the GUI panel that will display the filter's screen as one of the tabs on the main GUI window. The code can assume that this method is called after AbstractFilter.setConfiguration(ApplicationConfiguration) and setProperties(Properties). There is no data change as a result of calling this method.

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

setPanelSelections

public void setPanelSelections()
Applies filter state to panel selections.

Specified by:
setPanelSelections in interface GUIConfigurable

getTabDescription

public String getTabDescription()
Returns the description.

Specified by:
getTabDescription in interface GUIConfigurable
Returns:
the description

resetToDefaults

public void resetToDefaults()
Resets state to default values.

Specified by:
resetToDefaults in interface Configurable

showOptions

public void showOptions()
Show Options GUI.

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

getHelpPanel

public JPanel getHelpPanel()
Returns the help JPanel.

Specified by:
getHelpPanel in interface GUIConfigurable
Overrides:
getHelpPanel in class AbstractFilter
Returns:
the help JPanel

getProperties

public Properties getProperties()
Returns the filter state as a Properties object.

Specified by:
getProperties in interface Configurable
Returns:
the filter state as a Properties object

setProperties

public void setProperties(Properties props)
Sets the filter state via a Properties object.

Specified by:
setProperties in interface Configurable
Parameters:
props - the Properties filter state

keep

public boolean keep(Concept concept)
Indicates if Concept should be selected to be kept for the subset.

Specified by:
keep in interface ConceptSelector
Parameters:
concept - Concept to be evaluated for removal
Returns:
boolean true if concept should be kept false otherwise

getName

public String getName()
Returns the name.

Specified by:
getName in interface GUIConfigurable
Returns:
the name

getConfigurationDetails

public String getConfigurationDetails()
Returns the configuration details for mmsys.log.

Specified by:
getConfigurationDetails in interface Configurable
Returns:
the configuration details for mmsys.log

addSemanticTypeToRemove

public void addSemanticTypeToRemove(HierarchicalSemanticType semantic_type)
Adds a HierarchicalSemanticType to the data structure that holds the list of semantic_types to be excluded.

Parameters:
semantic_type - the HierarchicalSemanticType

removeSemanticTypeToRemove

public void removeSemanticTypeToRemove(HierarchicalSemanticType semantic_type)
Removes a HierarchicalSemanticType from the data structure that holds the list of semantic_types to be excluded.

Parameters:
semantic_type - the HierarchicalSemanticType

isSemanticTypeToRemove

public boolean isSemanticTypeToRemove(HierarchicalSemanticType semantic_type)
Indicates whether or not the specified HierarchicalSemanticType is of the type to be removed.

Parameters:
semantic_type - the HierarchicalSemanticType
Returns:
true if so, false otherwise

getSemanticTypesToRemove

public List getSemanticTypesToRemove()
Returns eturns the List containing all HierarchicalSemanticTypes to be excluded.

Returns:
semantic_types_to_remove the List

setSemanticTypesToRemove

public void setSemanticTypesToRemove(List str)
Sets the List of HierarchicalSemanticTypes to exclude.

Parameters:
str - List of HierarchicalSemanticTypes to exclude

getSTYForString

public HierarchicalSemanticType getSTYForString(String sem_type)
Returns the HierarchicalSemanticType with the given String representation.

Parameters:
sem_type - the String
Returns:
the corresponding HierarchicalSemanticType

getAutomaticSelection

public boolean getAutomaticSelection()
Indicates whether the automatic_selection option has been chosen on the MetamorphoSys Options dialog box. Automatic selection allows the application to select semantic types sharing the same hierarchy without prompting the user.

Returns:
automatic_selection true or false

anySty

public boolean anySty()
Indicates whether any or all of a concepts semantic types must be on the removal list for the concept to be removed. The user can set this option on the Advanced Semantic Types to Exclude Options dialog box.

Returns:
boolean true if concept will be removed if any of its terms have a semantic type to be removed false if concept will be removed only if all of its terms have semantic types on the removal list

setAnySty

public void setAnySty(boolean b)
Sets whether any or all of a concepts semantic types must be on the removal list for the concept to be removed. The user can set this option on the Advanced Semantic Types to Exclude Options dialog box.

Parameters:
b - boolean true if concept should be removed if any of its terms have a semantic type to be removed false if concept should be removed only if all of its terms have semantic types on the removal list

removeSelectedSemanticTypes

public boolean removeSelectedSemanticTypes()
This method indicates whether the selections represent semantic types to be excluded or semantic types to be kept.

Returns:
true selected semantic types will be excluded false selected semantic types will be kept

setRemoveSelectedSemanticTypes

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

Parameters:
b - boolean

valueChanged

public void valueChanged(ListSelectionEvent e)
Sets the list of semantic_types to removed when selection changes.

Parameters:
e - ListSelectionEvent

getColor

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

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

isEfficientEnabled

public boolean isEfficientEnabled()
Indicates whether or not this 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


Copyright ©2005