com.bbn.openmap.event
Class OMEventHandlerAdapter

java.lang.Object
  extended by com.bbn.openmap.MapHandlerChild
      extended by com.bbn.openmap.OMComponent
          extended by com.bbn.openmap.event.OMEventHandlerAdapter
All Implemented Interfaces:
OMEventHandler, LightMapHandlerChild, PropertyConsumer, java.beans.beancontext.BeanContextChild, java.beans.beancontext.BeanContextMembershipListener, java.util.EventListener
Direct Known Subclasses:
TestEventHandler

public abstract class OMEventHandlerAdapter
extends OMComponent
implements OMEventHandler

OMEventHandler subclasses look for the things that create OMEvents.

Author:
dietrick

Field Summary
protected  java.util.LinkedList<OMEvent> events
           
protected  java.util.List filterList
           
protected  java.util.Hashtable filterStates
           
protected  java.util.List macroFilters
           
static java.lang.String ShowEventsAtStartupProperty
           
 
Fields inherited from class com.bbn.openmap.OMComponent
i18n, propertyPrefix
 
Fields inherited from class com.bbn.openmap.MapHandlerChild
beanContextChildSupport, isolated
 
Fields inherited from interface com.bbn.openmap.PropertyConsumer
EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty
 
Constructor Summary
OMEventHandlerAdapter()
           
 
Method Summary
 void addEvent(OMEvent me)
           
 void addMacroFilter(OMEventMacroFilter mf)
           
 void clearEvents()
           
 void clearMacroFilters()
           
 void findAndInit(java.lang.Object someObj)
          The findAndInit method has been made non-abstract, because it now calls this method for every object that is in the iterator it receives.
 void findAndUndo(java.lang.Object someObj)
          The childrenRemoved has been changed to go through its iterator to call this method with every object.
 java.util.List<OMEvent> getEventList()
           
 java.util.List<OMEvent> getEventList(java.util.List filters)
          This is the main call to return OMEvents based on filters set in the GUI.
 java.util.List getFilters()
           
 java.lang.Boolean getFilterState(java.lang.String filterName)
          Query to find out if a filter should be enabled, based on EventHandler settings and history.
 java.util.List<OMEvent> getMacroFilteredList(java.util.Collection eventCollection)
           
 void removeEvent(OMEvent me)
           
 void removeMacroFilter(OMEventMacroFilter mf)
           
 void setFilterState(java.lang.String filterName, java.lang.Boolean state)
           
 
Methods inherited from class com.bbn.openmap.OMComponent
getProperties, getPropertyInfo, getPropertyPrefix, setProperties, setProperties, setPropertyPrefix
 
Methods inherited from class com.bbn.openmap.MapHandlerChild
addPropertyChangeListener, addVetoableChangeListener, childrenAdded, childrenRemoved, findAndInit, firePropertyChange, fireVetoableChange, getBeanContext, isIsolated, removePropertyChangeListener, removeVetoableChangeListener, setBeanContext, setIsolated
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

events

protected java.util.LinkedList<OMEvent> events

filterList

protected java.util.List filterList

macroFilters

protected java.util.List macroFilters

filterStates

protected java.util.Hashtable filterStates

ShowEventsAtStartupProperty

public static final java.lang.String ShowEventsAtStartupProperty
See Also:
Constant Field Values
Constructor Detail

OMEventHandlerAdapter

public OMEventHandlerAdapter()
Method Detail

addEvent

public void addEvent(OMEvent me)

removeEvent

public void removeEvent(OMEvent me)

clearEvents

public void clearEvents()

getEventList

public java.util.List<OMEvent> getEventList()
Specified by:
getEventList in interface OMEventHandler

getEventList

public java.util.List<OMEvent> getEventList(java.util.List filters)
This is the main call to return OMEvents based on filters set in the GUI. In subclasses, you can make the call to getMacroFilterList(Collection) from here to check against other filters that are being set across all OMEventhandlers.

Specified by:
getEventList in interface OMEventHandler
Parameters:
filters - A List of Strings. If your OMEventHandler provides entries into the filterList, you should check the entries on that list to see if they are in this provided list. If they are, you should return the OMEvents that fall under that filter String's jurisdiction.
Returns:
List of OMEvents that past filters

addMacroFilter

public void addMacroFilter(OMEventMacroFilter mf)

removeMacroFilter

public void removeMacroFilter(OMEventMacroFilter mf)

clearMacroFilters

public void clearMacroFilters()

getMacroFilteredList

public java.util.List<OMEvent> getMacroFilteredList(java.util.Collection eventCollection)
Specified by:
getMacroFilteredList in interface OMEventHandler

findAndInit

public void findAndInit(java.lang.Object someObj)
Description copied from class: MapHandlerChild
The findAndInit method has been made non-abstract, because it now calls this method for every object that is in the iterator it receives. This lets subclasses call a method on super classes so they can handle their needs as well.

Specified by:
findAndInit in interface LightMapHandlerChild
Overrides:
findAndInit in class MapHandlerChild

findAndUndo

public void findAndUndo(java.lang.Object someObj)
Description copied from class: MapHandlerChild
The childrenRemoved has been changed to go through its iterator to call this method with every object. This lets subclasses call this method on their super class, so it can handle what it needs to with objects it may be interested in.

Specified by:
findAndUndo in interface LightMapHandlerChild
Overrides:
findAndUndo in class MapHandlerChild

getFilters

public java.util.List getFilters()
Specified by:
getFilters in interface OMEventHandler
Returns:
List of Strings that serve as pretty names for the gui, and as filters. OK to return null.

getFilterState

public java.lang.Boolean getFilterState(java.lang.String filterName)
Query to find out if a filter should be enabled, based on EventHandler settings and history.

Specified by:
getFilterState in interface OMEventHandler
Parameters:
filterName - the filter string.
Returns:
Boolean.TRUE for things that should be display, Boolean.FALSE for things that shouldn't be displayed, and null for things that aren't known about.

setFilterState

public void setFilterState(java.lang.String filterName,
                           java.lang.Boolean state)
Specified by:
setFilterState in interface OMEventHandler
Parameters:
filterName -
state -


Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details