com.isti.quakewatch.util
Class QWFilterProperties

java.lang.Object
  extended by com.isti.quakewatch.util.QWFilterProperties

public class QWFilterProperties
extends java.lang.Object

Class QWFilterProperties manages the QuakeWatch client event-filter configuration.


Field Summary
 CfgProperties configPropsObj
          Configuration-properties object; may be passed in.
static java.lang.String DEF_DESC_SUFFIX
          Default description-suffix string.
static double DEF_MAXAGE_DAYS
          Default maximum age (in days) for events.
 CfgPropItem dispMaxAgeDaysProp
          Maximum age (in days) for events (0 = show all).
 CfgPropItem dispMaxAzimGapProp
          Maximum azimuthal gap for events.
 CfgPropItem dispMaxDepthProp
          Maximum depth for events.
 CfgPropItem dispMaxHorizErrorProp
          Maximum horizontal error for events (km).
 CfgPropItem dispMaxMagErrorProp
          Maximum magnitude error for events.
 CfgPropItem dispMaxStandErrorProp
          Maximum standard (RMS time) error for events (seconds).
 CfgPropItem dispMaxVertErrorProp
          Maximum vertical error for events (km).
 CfgPropItem dispMinDepthProp
          Minimum depth for events.
 CfgPropItem dispMinMagnitudeProp
          Minimum magnitude value for events.
 CfgPropItem dispMinNumPhaUsedProp
          Minimum number of phases used for events.
 CfgPropItem dropDataSourcesProp
          Drop events from these data sources.
protected  java.util.Vector dropDataSourcesVec
           
 CfgPropItem dropInvalidEventsFlagProp
          Drop events with invalid data values.
 CfgPropItem evtMaxLatitudeProp
          Maximum latitude value allowed for an event.
 CfgPropItem evtMaxLongitudeProp
          Maximum longitude value allowed for an event.
 CfgPropItem evtMinLatitudeProp
          Minimum latitude value allowed for an event.
 CfgPropItem evtMinLongitudeProp
          Minimum longitude value allowed for an event.
protected  boolean filterDropInvalidEventsFlag
           
protected  boolean filterLatEnabledFlag
           
protected  boolean filterLonEnabledFlag
           
protected  long filterMaxAgeMs
           
protected  double filterMaxAzimGapVal
           
protected  double filterMaxDepthVal
           
protected  double filterMaxHorizErrorVal
           
protected  double filterMaxLatVal
           
protected  double filterMaxLonVal
           
protected  double filterMaxMagErrorVal
           
protected  double filterMaxStandErrorVal
           
protected  double filterMaxVertErrorVal
           
protected  double filterMinAmpsShownVal
           
protected  boolean filterMinAmpsValSetFlag
           
protected  double filterMinDepthVal
           
protected  double filterMinLatVal
           
protected  double filterMinLonVal
           
protected  double filterMinMagVal
           
protected  int filterMinNumPhaUsedVal
           
protected  boolean inDropSrcsChgdMethodFlag
           
protected  boolean inKeepSrcsChgdMethodFlag
           
 CfgPropItem keepDataSourcesProp
          Keep events from these data sources.
protected  java.util.Vector keepDataSourcesVec
           
protected  long lastPropertyChangeTime
           
static CfgPropValidator latLonValidator
          Validator for latitude/longitude items.
 CfgProperties localPropsObj
          Config-properties object containing only filter items.
protected  java.lang.Object localValuesSyncObj
           
 CfgPropItem minValAmpsShownProp
          Minimum value for amplitudes shown.
 
Constructor Summary
QWFilterProperties()
          Constructs an event-filter-properties manager object, using a newly- created configuration-properties object.
QWFilterProperties(CfgProperties propsObj, java.lang.Object groupSelObj)
          Constructs an event-filter-properties manager object.
QWFilterProperties(CfgProperties propsObj, java.lang.Object groupSelObj, boolean showDropInvEvtsItemFlag)
          Constructs an event-filter-properties manager object.
QWFilterProperties(CfgProperties propsObj, java.lang.Object groupSelObj, java.lang.String descSuffixStr)
          Constructs an event-filter-properties manager object.
QWFilterProperties(CfgProperties propsObj, java.lang.Object groupSelObj, java.lang.String descSuffixStr, boolean showDropInvEvtsItemFlag)
          Constructs an event-filter-properties manager object.
 
Method Summary
 void addDataChangedListener(DataChangedListener listenerObj)
          Adds the given data-changed listener to each of the filter items.
 CfgProperties getConfigProps()
          Returns the 'CfgProperties' object holding the configuration-property items.
 java.lang.String getItemsDisplayString()
          Returns a string containing a display of the names and values for the filter property items.
 java.lang.String getItemsDisplayString(java.lang.String equalsStr, java.lang.String newlineStr)
          Returns a string containing a display of the names and values for the filter property items.
 CfgProperties getLocalProps()
          Returns the 'CfgProperties' object holding the local configuration-property items (related to filter settings).
 CfgPropItem getMinValAmpsShownProp()
          Returns the "Minimum value for amplitudes shown" configuration property item object.
 boolean passesFilter(QWEventMsgRecord recObj)
          Tests if the given event passes the filter parameters.
 void removeDataChangedListener(DataChangedListener listenerObj)
          Removes the given data-changed listener from each of the filter items.
protected  java.lang.String setDropDataSourcesStr(java.lang.String codeListStr)
          Sets the list of data source codes for events that are to be dropped.
 void setKeepDataSourcesDefault(java.lang.String str)
          Sets the default value for the 'keepDataSources' item, and sets up the empty-string-default flag for the item.
protected  java.lang.String setKeepDataSourcesStr(java.lang.String codeListStr)
          Sets the list of data source codes for events that are to be kept.
protected  void updateLastPropertyChangeTime()
          Updates the time of last change to configuration-property item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEF_DESC_SUFFIX

public static final java.lang.String DEF_DESC_SUFFIX
Default description-suffix string.

See Also:
Constant Field Values

DEF_MAXAGE_DAYS

public static final double DEF_MAXAGE_DAYS
Default maximum age (in days) for events.

See Also:
Constant Field Values

latLonValidator

public static final CfgPropValidator latLonValidator
Validator for latitude/longitude items.


filterMinMagVal

protected double filterMinMagVal

filterMaxAgeMs

protected long filterMaxAgeMs

filterMinLatVal

protected double filterMinLatVal

filterMaxLatVal

protected double filterMaxLatVal

filterMinLonVal

protected double filterMinLonVal

filterMaxLonVal

protected double filterMaxLonVal

filterLatEnabledFlag

protected boolean filterLatEnabledFlag

filterLonEnabledFlag

protected boolean filterLonEnabledFlag

keepDataSourcesVec

protected java.util.Vector keepDataSourcesVec

dropDataSourcesVec

protected java.util.Vector dropDataSourcesVec

filterMinDepthVal

protected double filterMinDepthVal

filterMaxDepthVal

protected double filterMaxDepthVal

filterMaxMagErrorVal

protected double filterMaxMagErrorVal

filterMaxHorizErrorVal

protected double filterMaxHorizErrorVal

filterMaxVertErrorVal

protected double filterMaxVertErrorVal

filterMaxStandErrorVal

protected double filterMaxStandErrorVal

filterMaxAzimGapVal

protected double filterMaxAzimGapVal

filterMinNumPhaUsedVal

protected int filterMinNumPhaUsedVal

filterDropInvalidEventsFlag

protected boolean filterDropInvalidEventsFlag

filterMinAmpsShownVal

protected double filterMinAmpsShownVal

filterMinAmpsValSetFlag

protected boolean filterMinAmpsValSetFlag

localValuesSyncObj

protected final java.lang.Object localValuesSyncObj

inKeepSrcsChgdMethodFlag

protected boolean inKeepSrcsChgdMethodFlag

inDropSrcsChgdMethodFlag

protected boolean inDropSrcsChgdMethodFlag

lastPropertyChangeTime

protected long lastPropertyChangeTime

configPropsObj

public final CfgProperties configPropsObj
Configuration-properties object; may be passed in.


localPropsObj

public final CfgProperties localPropsObj
Config-properties object containing only filter items.


dispMinMagnitudeProp

public final CfgPropItem dispMinMagnitudeProp
Minimum magnitude value for events.


dispMaxAgeDaysProp

public final CfgPropItem dispMaxAgeDaysProp
Maximum age (in days) for events (0 = show all).


keepDataSourcesProp

public final CfgPropItem keepDataSourcesProp
Keep events from these data sources.


dropDataSourcesProp

public final CfgPropItem dropDataSourcesProp
Drop events from these data sources.


evtMinLatitudeProp

public final CfgPropItem evtMinLatitudeProp
Minimum latitude value allowed for an event.


evtMaxLatitudeProp

public final CfgPropItem evtMaxLatitudeProp
Maximum latitude value allowed for an event.


evtMinLongitudeProp

public final CfgPropItem evtMinLongitudeProp
Minimum longitude value allowed for an event.


evtMaxLongitudeProp

public final CfgPropItem evtMaxLongitudeProp
Maximum longitude value allowed for an event.


dispMinDepthProp

public final CfgPropItem dispMinDepthProp
Minimum depth for events.


dispMaxDepthProp

public final CfgPropItem dispMaxDepthProp
Maximum depth for events.


dispMaxMagErrorProp

public final CfgPropItem dispMaxMagErrorProp
Maximum magnitude error for events.


dispMaxHorizErrorProp

public final CfgPropItem dispMaxHorizErrorProp
Maximum horizontal error for events (km).


dispMaxVertErrorProp

public final CfgPropItem dispMaxVertErrorProp
Maximum vertical error for events (km).


dispMaxStandErrorProp

public final CfgPropItem dispMaxStandErrorProp
Maximum standard (RMS time) error for events (seconds).


dispMaxAzimGapProp

public final CfgPropItem dispMaxAzimGapProp
Maximum azimuthal gap for events.


dispMinNumPhaUsedProp

public final CfgPropItem dispMinNumPhaUsedProp
Minimum number of phases used for events.


dropInvalidEventsFlagProp

public final CfgPropItem dropInvalidEventsFlagProp
Drop events with invalid data values.


minValAmpsShownProp

public final CfgPropItem minValAmpsShownProp
Minimum value for amplitudes shown. (Not in filter group.)

Constructor Detail

QWFilterProperties

public QWFilterProperties(CfgProperties propsObj,
                          java.lang.Object groupSelObj,
                          java.lang.String descSuffixStr,
                          boolean showDropInvEvtsItemFlag)
Constructs an event-filter-properties manager object.

Parameters:
propsObj - the configuration-properties object to add item to, or null to create a new configuration-properties object.
groupSelObj - the configuration-group-selection object to use, or null for none.
descSuffixStr - description suffix string to be appended to several of the items' descriptions, or null for none.
showDropInvEvtsItemFlag - true to show the "Drop events with invalid data values" item (by setting its group-select object to the given 'groupSelObj') and set its default value to 'true'; false to not show the item and set its default value to 'false'.

QWFilterProperties

public QWFilterProperties(CfgProperties propsObj,
                          java.lang.Object groupSelObj,
                          java.lang.String descSuffixStr)
Constructs an event-filter-properties manager object.

Parameters:
propsObj - the configuration-properties object to add item to, or null to create a new configuration-properties object.
groupSelObj - the configuration-group-selection object to use, or null for none.
descSuffixStr - description suffix string to be appended to several of the items' descriptions, or null for none.

QWFilterProperties

public QWFilterProperties(CfgProperties propsObj,
                          java.lang.Object groupSelObj,
                          boolean showDropInvEvtsItemFlag)
Constructs an event-filter-properties manager object. The default description-suffix string (" displayed") is appended to several of the items' descriptions.

Parameters:
propsObj - the configuration-properties object to add item to, or null to create a new configuration-properties object.
groupSelObj - the configuration-group-selection object to use, or null for none.
showDropInvEvtsItemFlag - true to show the "Drop events with invalid data values" item (by setting its group-select object to the given 'groupSelObj') and set its default value to 'true'; false to not show the item and set its default value to 'false'.

QWFilterProperties

public QWFilterProperties(CfgProperties propsObj,
                          java.lang.Object groupSelObj)
Constructs an event-filter-properties manager object. The default description-suffix string (" displayed") is appended to several of the items' descriptions.

Parameters:
propsObj - the configuration-properties object to add item to, or null to create a new configuration-properties object.
groupSelObj - the configuration-group-selection object to use, or null for none.

QWFilterProperties

public QWFilterProperties()
Constructs an event-filter-properties manager object, using a newly- created configuration-properties object. The default description-suffix string (" displayed") is appended to several of the items' descriptions.

Method Detail

addDataChangedListener

public void addDataChangedListener(DataChangedListener listenerObj)
Adds the given data-changed listener to each of the filter items.

Parameters:
listenerObj - the data-changed listener object to use.

removeDataChangedListener

public void removeDataChangedListener(DataChangedListener listenerObj)
Removes the given data-changed listener from each of the filter items.

Parameters:
listenerObj - the data-changed listener object to use.

getMinValAmpsShownProp

public CfgPropItem getMinValAmpsShownProp()
Returns the "Minimum value for amplitudes shown" configuration property item object. This item object is created and held by this filter-properties object but is not added to the configuration properties object or the filter group. Client programs that use this configuration property item will fetch it via this method, add it to the configuration properties and setup its group-select object.

Returns:
The "Minimum value for amplitudes shown" configuration property item object.

setKeepDataSourcesDefault

public void setKeepDataSourcesDefault(java.lang.String str)
Sets the default value for the 'keepDataSources' item, and sets up the empty-string-default flag for the item.

Parameters:
str - default value for item.

passesFilter

public boolean passesFilter(QWEventMsgRecord recObj)
Tests if the given event passes the filter parameters.

Parameters:
recObj - the message record object for the given event.
Returns:
true if the event passes; false if the event should be filtered out.

getConfigProps

public CfgProperties getConfigProps()
Returns the 'CfgProperties' object holding the configuration-property items. If a 'CfgProperties' object parameter is passed in to the constructor then this method will return it.

Returns:
The 'CfgProperties' object holding the configuration-property items.

getLocalProps

public CfgProperties getLocalProps()
Returns the 'CfgProperties' object holding the local configuration-property items (related to filter settings).

Returns:
The 'CfgProperties' object holding the local configuration-property items (related to filter settings).

getItemsDisplayString

public java.lang.String getItemsDisplayString(java.lang.String equalsStr,
                                              java.lang.String newlineStr)
Returns a string containing a display of the names and values for the filter property items.

Parameters:
equalsStr - a String containing the characters to be placed between each name and value; or if null then the characters " = " will be used.
newlineStr - a String containing the characters to be used to separate items; or if null then the system default newline character(s) will be used.
Returns:
A string containing a display of the names and values for the connection property items.

getItemsDisplayString

public java.lang.String getItemsDisplayString()
Returns a string containing a display of the names and values for the filter property items.

Returns:
A string containing a display of the names and values for the connection property items.

setKeepDataSourcesStr

protected java.lang.String setKeepDataSourcesStr(java.lang.String codeListStr)
Sets the list of data source codes for events that are to be kept.

Parameters:
codeListStr - a list of data source codes, separated by spaces, commas or semicolons; or null for no codes.
Returns:
The list of data source codes with each item separated by ", " and made all upper-case, or null if no codes.

setDropDataSourcesStr

protected java.lang.String setDropDataSourcesStr(java.lang.String codeListStr)
Sets the list of data source codes for events that are to be dropped.

Parameters:
codeListStr - a list of data source codes, separated by spaces, commas or semicolons; or null for no codes.
Returns:
The list of data source codes with each item separated by ", " and made all upper-case, or null if no codes.

updateLastPropertyChangeTime

protected void updateLastPropertyChangeTime()
Updates the time of last change to configuration-property item.