gov.nih.nlm.mms.filters
Class PrecedenceFilter

java.lang.Object
  extended bygov.nih.nlm.mms.filters.AbstractFilter
      extended bygov.nih.nlm.mms.filters.PrecedenceFilter
All Implemented Interfaces:
Comparable, ConceptManipulator, Configurable, CutandPasteModeListener, EventListener, Filter, FocusListener, GUIConfigurable, SourcesToRemoveListener, SubsetListener

public class PrecedenceFilter
extends AbstractFilter
implements CutandPasteModeListener, FocusListener, SourcesToRemoveListener, ConceptManipulator

This Filter allows the user to reorder the source/termgroup rows in the table to indicate the ranking of termgroups desired.

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
PrecedenceFilter()
          Instantiates a PrecedenceFilter.
 
Method Summary
 void applyChanges(Concept concept)
          Manipulates data in the Concept, but does not remove any data from the concept.
 void clearPrecedence()
          This method clears the data structure that holds the precedence list.
 void cutDoneinCutMode(CutandPasteModeEvent e)
          This method is called when a cut has appropriately been done while in cut mode.
 void cutDoneinPasteMode(CutandPasteModeEvent e)
          This method is called when a cut has been attempted illegally while in paste mode.
 void focusGained(FocusEvent e)
          Provides means to keep focus on the PrecedenceFilter so as not to leave the filter when a cut has not yet been pasted.
 void focusLost(FocusEvent e)
          Provides means to keep focus on the PrecedenceFilter so as not to leave the filter when a cut has not yet been pasted.
 Color getColor()
          Method indicates the Color that should be used to display the name.
 String getConfigurationDetails()
          Method returns a list of the precedence order for display in the configuration file.
 JPanel getHelpPanel()
          Returns 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.
 String getName()
          Returns the name.
 JPanel getPanel()
          Provides the GUI panel that will display the filter's screen as one of the tabs on the main GUI window.
 List getPrecedence()
          This method returns the ArrayList ranking the SourceTermTypes according to precedence.
 List getPrecedenceSubset()
          Gets the subset of rows from the precedence data that will not be excluded based on the exclusions chosen on the Sources to Exclude tab.
 Properties getProperties()
          Returns all Properties specific to the filter.
 String getTabDescription()
          Returns the description.
 String getValidateMessage()
          This method returns the message that the user will see if this filter is invalid.
 boolean isEfficientEnabled()
          Indicates if Filter can use the efficient mode during the "Initialize Cuis" phase of the subsetting process.
 void moveSourceTermTypes(int[] drag_row_index, int drop_row_index)
          This method makes updates to the precedence list based on changes made by the user with the drag & drop interface.
 void pasteDoneinCutMode(CutandPasteModeEvent e)
          This method is called when a paste has been attempted illegally while in cut mode.
 void pasteDoneinPasteMode(CutandPasteModeEvent e)
          This method is called when a paste has appropriately been done while in paste mode.
 void resetToDefaults()
          Resets filter state to default.
 void setConfiguration(ApplicationConfiguration c)
          Sets the ApplicationConfiguration.
 void setPanelSelections()
          Applies state to panel selections.
 void setProperties(Properties p)
          Sets all Properties specific to the filter.
 void sourcesToRemoveChanged(SourcesToRemoveEvent e)
          This method is called when there is a change to the selections on the sources to exclude tab.
 boolean validate()
          This method indicates that this filter is only valid when any rows that have been cut have also been pasted.
 
Methods inherited from class gov.nih.nlm.mms.filters.AbstractFilter
addDataChangeListener, applyFilter, beginInitializeCuiList, beginSubsetContent, compareTo, endInitializeCuiList, endSubsetContent, fireDataChanged, fireNotUndoableDataChanged, getGUIConfigurableForValidationFailure, getValidationErrors, getValidationWarnings, hasAdvancedOptions, hasDataChanged, removeDataChangeListener, resetDataChanged, setConfiguration, setCuiList, 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
 
Methods inherited from interface gov.nih.nlm.mms.GUIConfigurable
addDataChangeListener, getGUIConfigurableForValidationFailure, 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
 

Constructor Detail

PrecedenceFilter

public PrecedenceFilter()
Instantiates a PrecedenceFilter.

Method Detail

getPanel

public JPanel getPanel()
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
Returns:
JPanel that displays graphical interface for the filter

setPanelSelections

public void setPanelSelections()
Applies 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 filter state to default.

Specified by:
resetToDefaults in interface Configurable

getHelpPanel

public JPanel getHelpPanel()
Returns 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)
Sets the ApplicationConfiguration.

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

getProperties

public Properties getProperties()
Returns all Properties specific to the filter. Used for undo/redo and saving state.

Specified by:
getProperties in interface Configurable
Returns:
Properties only those directly related to the filter.

setProperties

public void setProperties(Properties p)
Sets all Properties specific to the filter.

Specified by:
setProperties in interface Configurable
Parameters:
p - the Properties

applyChanges

public void applyChanges(Concept concept)
Manipulates data in the Concept, but does not remove any data from the concept.

Specified by:
applyChanges in interface ConceptManipulator
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 precedence order for display in the configuration file.

Specified by:
getConfigurationDetails in interface Configurable
Returns:
String

clearPrecedence

public void clearPrecedence()
This method clears the data structure that holds the precedence list.


getPrecedence

public List getPrecedence()
This method returns the ArrayList ranking the SourceTermTypes according to precedence.

Returns:
precedence ArrayList

moveSourceTermTypes

public void moveSourceTermTypes(int[] drag_row_index,
                                int drop_row_index)
This method makes updates to the precedence list based on changes made by the user with the drag & drop interface.

Parameters:
drag_row_index - int[]- indexes of all rows to be dragged to new location
drop_row_index - int - index of location where dragged rows should be dropped

cutDoneinCutMode

public void cutDoneinCutMode(CutandPasteModeEvent e)
This method is called when a cut has appropriately been done while in cut mode.

Specified by:
cutDoneinCutMode in interface CutandPasteModeListener
Parameters:
e - CutandPasteModeEvent

cutDoneinPasteMode

public void cutDoneinPasteMode(CutandPasteModeEvent e)
This method is called when a cut has been attempted illegally while in paste mode.

Specified by:
cutDoneinPasteMode in interface CutandPasteModeListener
Parameters:
e - CutandPasteModeEvent

pasteDoneinPasteMode

public void pasteDoneinPasteMode(CutandPasteModeEvent e)
This method is called when a paste has appropriately been done while in paste mode.

Specified by:
pasteDoneinPasteMode in interface CutandPasteModeListener
Parameters:
e - CutandPasteModeEvent

pasteDoneinCutMode

public void pasteDoneinCutMode(CutandPasteModeEvent e)
This method is called when a paste has been attempted illegally while in cut mode.

Specified by:
pasteDoneinCutMode in interface CutandPasteModeListener
Parameters:
e - CutandPasteModeEvent

validate

public boolean validate()
This method indicates that this filter is only valid when any rows that have been cut have also been pasted.

Specified by:
validate in interface GUIConfigurable
Overrides:
validate in class AbstractFilter
Returns:
true if filter is valid false if cut has been done, but paste has not been done.

getValidateMessage

public String getValidateMessage()
This method returns the message that the user will see if this filter is invalid.

Overrides:
getValidateMessage in class AbstractFilter
Returns:
String with error message

focusGained

public void focusGained(FocusEvent e)
Provides means to keep focus on the PrecedenceFilter so as not to leave the filter when a cut has not yet been pasted.

Specified by:
focusGained in interface FocusListener
Parameters:
e - FocusEvent

focusLost

public void focusLost(FocusEvent e)
Provides means to keep focus on the PrecedenceFilter so as not to leave the filter when a cut has not yet been pasted.

Specified by:
focusLost in interface FocusListener
Parameters:
e - FocusEvent

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

getPrecedenceSubset

public List getPrecedenceSubset()
Gets the subset of rows from the precedence data that will not be excluded based on the exclusions chosen on the Sources to Exclude tab.

Returns:
List of SourceTermTypes

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