gov.nih.nlm.mms.filters
Class RemoveByTermgroupFilter

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

public class RemoveByTermgroupFilter
extends AbstractFilter
implements SourcesToRemoveListener, ConceptContentSelector

Computes which content is removable based on source/term types and removes it.

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
RemoveByTermgroupFilter()
          Instantiates an empty RemoveByTermgroupFilter.
 
Method Summary
protected  void addRemovableTermgroup(SourceTermType tg)
          Adds a SourceTermType to the list of removable termgroups.
 void applySelections(Concept concept)
          Sets the suppressibility of atoms and removes suppressible content if advanced options indicate to do so.
 void clearConfirmDefaultRemovableTermgroups()
          Clears the list of SourceTermTypes that have been confirmed by the user to be removable.
protected  void clearRemovableTermgroups()
          Clears the list of removable SourceTermTypes.
 boolean getAutomaticSelection()
          This method indicates whether the automatic_selection option has been chosen.
 Color getColor()
          Returns the Color that should be used to display the name.
 String getConfigurationDetails()
          Returns configuration details for use in mmsys.log.
 List getConfirmDefaultRemovableTermgroups()
          Returns a list of SourceTermTypes that have been confirmed by the user via a dialog box to be removable.
 List getDefaultRemovableTermgroups()
          Returns an List containing all SourceTermTypes to be removed from the default termgroup list.
 JPanel getHelpPanel()
          Returns a help JPanel.
 String getName()
          Returns the filter 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 filter state.
 List getRemovableTermgroups()
          Returns the List containing all removable SourceTermTypes.
 SortableJTable getRemovableTermgroupsTable()
          Returns the table that includes SourceTermTypes with the removable termgroups highlighted.
 int getRowForTermgroup(SourceTermType tg)
          Maps a SourceTermType to a row number in the table.
 List getSourceTermTypes()
          This method returns the List containing all SourceTermTypes.
 List getSourceTermTypes(Source s)
          This method returns the List containing all SourceTermTypes that share the same Source.
 String getTabDescription()
          Returns the description.
 SourceTermType getTermgroupAtRow(int tg)
          Maps a row number to the SourceTermType.
 boolean hasAdvancedOptions()
          Indicates whether or not an options menu item should be supplied for advanced configuration options.
 boolean isEfficientEnabled()
          Indicates if Filter can use the efficient mode during the "Initialize Cuis" phase of the subsetting process.
protected  void removeRemovableTermgroup(SourceTermType tg)
          Removes a SourceTermType from the list of removable termgroups.
 boolean removeSelectedTermgroups()
          This method indicates whether the selections represent source term types to be excluded or source term types to be kept.
 void resetToDefaults()
          Resets state to defaults.
 void setConfiguration(ApplicationConfiguration c)
          Sets the ApplicationConfiguration.
 void setPanelSelections()
          Selects rows on the source/term type table for rows of termgroups that should be removed.
 void setProperties(Properties p)
          Sets filter state.
 void setRemovableTermgroups(List stgs)
          Sets the removable termgroups list with the one provided.
 void setRemoveSelectedTermgroups(boolean b)
          This method sets whether or not the selections represent source term types to be excluded or source term types to be kept.
 void showOptions()
          Shows an advanced options GUI to the user.
 void sourcesToRemoveChanged(SourcesToRemoveEvent e)
          Resets the removability table when the user tabs between filters.
 
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, 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
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface gov.nih.nlm.mms.SubsetListener
beginInitializeCuiList, beginSubsetContent, endInitializeCuiList, endSubsetContent, setCuiList
 

Constructor Detail

RemoveByTermgroupFilter

public RemoveByTermgroupFilter()
Instantiates an empty RemoveByTermgroupFilter.

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.

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

setPanelSelections

public void setPanelSelections()
Selects rows on the source/term type table for rows of termgroups that should be removed.

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 defaults.

Specified by:
resetToDefaults in interface Configurable

showOptions

public void showOptions()
Shows 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()
Returns a help JPanel.

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

setConfiguration

public void setConfiguration(ApplicationConfiguration c)
Sets the ApplicationConfiguration. Used for "default" selections.

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

getProperties

public Properties getProperties()
Returns filter state.

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

setProperties

public void setProperties(Properties p)
Sets filter state.

Specified by:
setProperties in interface Configurable
Parameters:
p - Properties representing filter state

applySelections

public void applySelections(Concept concept)
Sets the suppressibility of atoms and removes suppressible content if advanced options indicate to do so.

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

getName

public String getName()
Returns the filter name.

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

getAutomaticSelection

public boolean getAutomaticSelection()
This method indicates whether the automatic_selection option has been chosen. Automatic selection allows the application to select relationship types sharing the same source without prompting the user.

Returns:
automatic_selection booleantrue false

getConfigurationDetails

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

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

clearRemovableTermgroups

protected void clearRemovableTermgroups()
Clears the list of removable SourceTermTypes.


addRemovableTermgroup

protected void addRemovableTermgroup(SourceTermType tg)
Adds a SourceTermType to the list of removable termgroups.

Parameters:
tg - the SourceTermType

removeRemovableTermgroup

protected void removeRemovableTermgroup(SourceTermType tg)
Removes a SourceTermType from the list of removable termgroups.

Parameters:
tg - SourceTermType

getDefaultRemovableTermgroups

public List getDefaultRemovableTermgroups()
Returns an List containing all SourceTermTypes to be removed from the default termgroup list.

Returns:
List of removed termgroups

getConfirmDefaultRemovableTermgroups

public List getConfirmDefaultRemovableTermgroups()
Returns a list of SourceTermTypes that have been confirmed by the user via a dialog box to be removable. Prevents user from being queried twice about a termgroup's removability.

Returns:
List of removed termgroups

clearConfirmDefaultRemovableTermgroups

public void clearConfirmDefaultRemovableTermgroups()
Clears the list of SourceTermTypes that have been confirmed by the user to be removable.


removeSelectedTermgroups

public boolean removeSelectedTermgroups()
This method indicates whether the selections represent source term types to be excluded or source term types to be kept.

Returns:
true selected source term types will be excluded false selected source term types will be kept

setRemoveSelectedTermgroups

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

Parameters:
b - boolean

getSourceTermTypes

public List getSourceTermTypes()
This method returns the List containing all SourceTermTypes.

Returns:
List of SourceTermTypes

getSourceTermTypes

public List getSourceTermTypes(Source s)
This method returns the List containing all SourceTermTypes that share the same Source.

Parameters:
s - Source
Returns:
List of RelTypes

setRemovableTermgroups

public void setRemovableTermgroups(List stgs)
Sets the removable termgroups list with the one provided.

Parameters:
stgs - the List of SourceTermTypes

getRemovableTermgroups

public List getRemovableTermgroups()
Returns the List containing all removable SourceTermTypes.

Returns:
List of removable termgroups

getRemovableTermgroupsTable

public SortableJTable getRemovableTermgroupsTable()
Returns the table that includes SourceTermTypes with the removable termgroups highlighted.

Returns:
SortableJTable

sourcesToRemoveChanged

public void sourcesToRemoveChanged(SourcesToRemoveEvent e)
Resets the removability table when the user tabs between filters. Removes entries visible in the table based on which sources are to be excluded.

Specified by:
sourcesToRemoveChanged in interface SourcesToRemoveListener
Parameters:
e - SourcesToRemoveEvent

getRowForTermgroup

public int getRowForTermgroup(SourceTermType tg)
Maps a SourceTermType to a row number in the table. This is necessary because only SourceTermTypes from sources that are not to be excluded will be visible in the table.

Parameters:
tg - the SourceTermType
Returns:
int row number of termgroup in table -1 if termgroup is to be excluded

getTermgroupAtRow

public SourceTermType getTermgroupAtRow(int tg)
Maps a row number to the SourceTermType. Adjusts for the SourceTermTypes that are not currently visible in the table because their sources are to be excluded.

Parameters:
tg - int row in the table
Returns:
SourceTermType located at that row in the table

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


Copyright ©2005