com.bbn.openmap.layer.event
Class TestEventHandler

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

public class TestEventHandler
extends OMEventHandlerAdapter
implements TimeBoundsProvider

Sample OMEventHandler to demonstrate being a TimeBoundsProvider and TimeBoundsHandler.

Author:
dietrick

Field Summary
protected  boolean active
           
protected  TimeBounds timeBounds
           
protected  java.util.List<TimeBoundsHandler> timeBoundsHandlers
           
 
Fields inherited from class com.bbn.openmap.event.OMEventHandlerAdapter
events, filterList, filterStates, macroFilters, 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
TestEventHandler()
           
 
Method Summary
 void addEvent(OMEvent event)
           
 void addTimeBoundsHandler(TimeBoundsHandler tbh)
          The TimeBoundsProvider keep track of the handlers it needs to notify when the bounds or activeness changes.
 void callForTimeBoundsReset()
           
protected  void createEvents()
           
 java.util.List<OMEvent> getEventList(java.util.List filters)
          This is the main call to return OMEvents based on filters set in the GUI.
 TimeBounds getTimeBounds()
          A method called on the TimeBoundsProvider to retrieve the provider's time bounds.
 void handleTimeBounds(TimeBounds tb)
          A method called on the TimeBoundsProvider to inform it of the overall time bounds, in case some external time bounds values are being set by another component and this provider wants to react to those bounds in some way.
 boolean isActive()
          A query that can be made to the TimeBoundsProvider asking it if it is active, and if it's time bounds should be considered.
 void removeTimeBoundsHandler(TimeBoundsHandler tbh)
          The TimeBoundsProvider keep track of the handlers it needs to notify when the bounds or activeness changes.
 void setActive(boolean active)
          An accessor that switches the TimeBoundsProvider on/off.
 
Methods inherited from class com.bbn.openmap.event.OMEventHandlerAdapter
addMacroFilter, clearEvents, clearMacroFilters, findAndInit, findAndUndo, getEventList, getFilters, getFilterState, getMacroFilteredList, removeEvent, removeMacroFilter, setFilterState
 
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

timeBounds

protected TimeBounds timeBounds

timeBoundsHandlers

protected java.util.List<TimeBoundsHandler> timeBoundsHandlers

active

protected boolean active
Constructor Detail

TestEventHandler

public TestEventHandler()
Method Detail

createEvents

protected void createEvents()

addEvent

public void addEvent(OMEvent event)
Overrides:
addEvent in class OMEventHandlerAdapter

getEventList

public java.util.List<OMEvent> getEventList(java.util.List filters)
Description copied from class: OMEventHandlerAdapter
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
Overrides:
getEventList in class OMEventHandlerAdapter
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

addTimeBoundsHandler

public void addTimeBoundsHandler(TimeBoundsHandler tbh)
Description copied from interface: TimeBoundsProvider
The TimeBoundsProvider keep track of the handlers it needs to notify when the bounds or activeness changes. Called when a new handler needs to know.

Specified by:
addTimeBoundsHandler in interface TimeBoundsProvider

getTimeBounds

public TimeBounds getTimeBounds()
Description copied from interface: TimeBoundsProvider
A method called on the TimeBoundsProvider to retrieve the provider's time bounds.

Specified by:
getTimeBounds in interface TimeBoundsProvider

handleTimeBounds

public void handleTimeBounds(TimeBounds tb)
Description copied from interface: TimeBoundsProvider
A method called on the TimeBoundsProvider to inform it of the overall time bounds, in case some external time bounds values are being set by another component and this provider wants to react to those bounds in some way.

Specified by:
handleTimeBounds in interface TimeBoundsProvider

isActive

public boolean isActive()
Description copied from interface: TimeBoundsProvider
A query that can be made to the TimeBoundsProvider asking it if it is active, and if it's time bounds should be considered.

Specified by:
isActive in interface TimeBoundsProvider

setActive

public void setActive(boolean active)
Description copied from interface: TimeBoundsProvider
An accessor that switches the TimeBoundsProvider on/off.

Specified by:
setActive in interface TimeBoundsProvider

removeTimeBoundsHandler

public void removeTimeBoundsHandler(TimeBoundsHandler tbh)
Description copied from interface: TimeBoundsProvider
The TimeBoundsProvider keep track of the handlers it needs to notify when the bounds or activeness changes. Called when a handler doesn't need to know.

Specified by:
removeTimeBoundsHandler in interface TimeBoundsProvider

callForTimeBoundsReset

public void callForTimeBoundsReset()


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