gov.nih.nlm.mms.filters
Class AttributeTypesToRemoveFilter

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

public class AttributeTypesToRemoveFilter
extends AbstractFilter
implements SourcesToRemoveListener, ConceptContentSelector

This Filter removes all CUIs with a given attribute type.

Author:
Deborah Shapiro

Field Summary
protected  SortableJTable attribute_type_table
           
protected static ArrayList attribute_types
           
protected  List attribute_types_to_remove
           
protected  ApplicationConfiguration default_config
           
protected  AttributeTypesToRemoveListSelectionListener listener
           
protected  List sources_to_remove
           
protected  UserConfiguration user_config
           
 
Fields inherited from class gov.nih.nlm.mms.filters.AbstractFilter
default_configuration, init_cui, subset_content, user_configuration
 
Constructor Summary
AttributeTypesToRemoveFilter()
          Every filter is required to have a no-arg constructor.
 
Method Summary
 void addAttributeTypeToRemove(AttType attribute_type)
          This method adds a AttType to the data structure that holds the list of attribute types to be excluded.
 void applySelections(Concept concept)
          Method which determines if a given CUI will be removed from the release.
 void clearAttributeTypesToRemove()
          This method clears the data structure that holds the list of attribute types to be excluded.
 AttType getAttributeTypeAtRow(int a)
          This method compensates for the AttTypes with sources to be excluded that are therefore not displayed in the attribute type table.
 List getAttributeTypes()
          This method returns the List containing all attribute types.
 List getAttributeTypes(Source s)
          This method returns the List containing all AttTypes that share the same source.
 Set getAttributeTypesAsSet(Source s)
          This method returns the Set containing all AttTypes that share the same Source.
 List getAttributeTypesToRemove()
          This method returns the List containing all AttributeTypes to be excluded.
 boolean getAutomaticSelection()
          This method is used by the AttributeTypesToRemoveListSelectionListener and indicates whether the automatic selection option on the MetamorphoSys Options dialog box has been chosen.
 Color getColor()
          Method indicates the Color that should be used to display the name.
 String getConfigurationDetails()
          Method returns a list of the attribute types to be excluded for display in the configuration file.
 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  NoEditTableModel getModel()
           
 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.
 int getRowForAttributeType(AttType at)
          This method compensates for the AttTypes with sources to be excluded that are therefore not displayed in the attribute type table.
 String getTabDescription()
          Method provides the description of the filter's screen and includes instructions on use.
 boolean isEfficientEnabled()
          Indicates if Filter can use the efficient mode during the "Initialize Cuis" phase of the subsetting process.
 void removeAttributeTypeToRemove(AttType attribute_type)
          This method removes a AttType from the data structure that holds the list of attribute_types to be excluded.
 boolean removeSelectedAttributes()
          This method indicates whether the selections represent attributes to be excluded or attributes to be kept.
 void resetToDefaults()
          Provides functionality for a "Reset To Defaults" Menu item.
 void setAttributeTypesToRemove(List atr)
          This method replaces the List of AttTypes to be removed with the one provided.
 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 setPanelSelections()
          This method is responsible for selecting the rows of the table based on the properties for this filter.
 void setProperties(Properties props)
          Method provides the filter with all properties specific to the filter.
 void setRemoveSelectedAttributes(boolean b)
          This method sets whether or not the selections represent attributes to be excluded or attributes to be kept.
 void sourcesToRemoveChanged(SourcesToRemoveEvent e)
          This method is called when there is a change to the selections on the sources to exclude tab.
 
Methods inherited from class gov.nih.nlm.mms.filters.AbstractFilter
addDataChangeListener, applyFilter, beginInitializeCuiList, beginSubsetContent, compareTo, endInitializeCuiList, endSubsetContent, fireDataChanged, fireNotUndoableDataChanged, getGUIConfigurableForValidationFailure, getValidateMessage, getValidationErrors, getValidationWarnings, hasAdvancedOptions, hasDataChanged, removeDataChangeListener, resetDataChanged, setCuiList, setDataChanged, showOptions, 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, hasAdvancedOptions, hasDataChanged, removeDataChangeListener, resetDataChanged, setDataChanged, showOptions, 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

attribute_types_to_remove

protected List attribute_types_to_remove

attribute_types

protected static ArrayList attribute_types

attribute_type_table

protected SortableJTable attribute_type_table

listener

protected AttributeTypesToRemoveListSelectionListener listener

sources_to_remove

protected List sources_to_remove
Constructor Detail

AttributeTypesToRemoveFilter

public AttributeTypesToRemoveFilter()
Every filter is required to have a no-arg constructor.

Method Detail

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. The code can assume that this method is called after 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()
This method is responsible for selecting the rows of the table based on the properties for this filter.

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

getModel

protected NoEditTableModel getModel()

resetToDefaults

public void resetToDefaults()
Provides functionality for a "Reset To Defaults" Menu item. The implementation removes all selections and fires a "data changed" event.

Specified by:
resetToDefaults in interface Configurable

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. This is the first method called after the class is constructed.

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

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 props)
Method provides the filter with all properties specific to the filter.

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

applySelections

public void applySelections(Concept concept)
Method which determines if a given CUI 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 attribute types to be excluded for display in the configuration file.

Specified by:
getConfigurationDetails in interface Configurable
Returns:
String

removeSelectedAttributes

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

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

setRemoveSelectedAttributes

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

Parameters:
b - boolean

getAttributeTypes

public List getAttributeTypes()
This method returns the List containing all attribute types.

Returns:
List of all attribute types

getAttributeTypes

public List getAttributeTypes(Source s)
This method returns the List containing all AttTypes that share the same source.

Parameters:
s - Source
Returns:
List of AttTypes sharing given Source

getAttributeTypesAsSet

public Set getAttributeTypesAsSet(Source s)
This method returns the Set containing all AttTypes that share the same Source.

Parameters:
s - Source
Returns:
Set of AttTypes sharing given Source

clearAttributeTypesToRemove

public void clearAttributeTypesToRemove()
This method clears the data structure that holds the list of attribute types to be excluded.


addAttributeTypeToRemove

public void addAttributeTypeToRemove(AttType attribute_type)
This method adds a AttType to the data structure that holds the list of attribute types to be excluded.

Parameters:
attribute_type - AttType to be excluded from subset

removeAttributeTypeToRemove

public void removeAttributeTypeToRemove(AttType attribute_type)
This method removes a AttType from the data structure that holds the list of attribute_types to be excluded.

Parameters:
attribute_type - AttType to be included in subset

getAttributeTypesToRemove

public List getAttributeTypesToRemove()
This method returns the List containing all AttributeTypes to be excluded.

Returns:
List

setAttributeTypesToRemove

public void setAttributeTypesToRemove(List atr)
This method replaces the List of AttTypes to be removed with the one provided.

Parameters:
atr - List of AttTypes

getAutomaticSelection

public boolean getAutomaticSelection()
This method is used by the AttributeTypesToRemoveListSelectionListener and indicates whether the automatic selection option on the MetamorphoSys Options dialog box has been chosen. Automatic selection allows the application to select attribute types sharing the same source without prompting the user.

Returns:
automatic_selection true false

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

getRowForAttributeType

public int getRowForAttributeType(AttType at)
This method compensates for the AttTypes with sources to be excluded that are therefore not displayed in the attribute type table.

Parameters:
at - AttType
Returns:
int row where given AttType is displayed

getAttributeTypeAtRow

public AttType getAttributeTypeAtRow(int a)
This method compensates for the AttTypes with sources to be excluded that are therefore not displayed in the attribute type table.

Parameters:
a - int row number where AttType is requested
Returns:
AttType at given row

sourcesToRemoveChanged

public void sourcesToRemoveChanged(SourcesToRemoveEvent e)
This method is called when there is a change to the selections on the sources to exclude tab. It resets the attribute type table model to only include those attribute types that are not from excluded sources.

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

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