com.bbn.openmap.layer.event
Class EventLayer

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by com.bbn.openmap.Layer
                  extended by com.bbn.openmap.layer.OMGraphicHandlerLayer
                      extended by com.bbn.openmap.layer.event.EventLayer
All Implemented Interfaces:
OMEventHandler, ProjectionListener, GestureResponsePolicy, OMGraphicHandler, ProjectionPainter, PropertyConsumer, TimeBoundsProvider, TimeEventListener, DataBoundsProvider, java.awt.event.ActionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.beancontext.BeanContextChild, java.beans.beancontext.BeanContextMembershipListener, java.io.Serializable, java.util.EventListener

public class EventLayer
extends OMGraphicHandlerLayer
implements DataBoundsProvider, TimeBoundsProvider, TimeEventListener, OMEventHandler

The EventLayer contains all the TemporalOMGraphics and manages the time for the graphics and how they should be displayed. This layer works as a TimeBoundsProvider (an object that provides an active range of time, a OMEventHandler (an object that provides OMEvents to the EventPanel/EventPresenter), and a TimeEventListener (an object that changes when the cloc changes).

Sample properties:

    eventLayer.class=com.bbn.openmap.layer.time.EventLayer
    eventLayer.importer=com.bbn.openmap.layer.time.CSVEventImporter
    eventLayer.prettyName=Test Event
    
    ... see CSVEventImporter for its properties, other importers can be specified here.
 

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  boolean active
           
protected  DataBounds dataBounds
           
protected  java.util.LinkedList<OMEvent> events
           
protected  java.util.LinkedList<OMEvent> filters
           
protected  EventImporter importer
           
static java.lang.String ImporterProperty
           
static java.util.logging.Logger logger
           
protected  java.lang.String mode
           
protected  long time
           
protected  TimeBounds timeBounds
           
protected  java.util.List<TimeBoundsHandler> timeBoundsHandlers
           
 
Fields inherited from class com.bbn.openmap.layer.OMGraphicHandlerLayer
consumeEvents, ConsumeEventsProperty, filter, interruptable, InterruptableProperty, layerWorker, LAYERWORKER_LOCK, layerWorkerQueue, mouseEventInterpreter, mouseModeIDs, MouseModesProperty, projectionChangePolicy, ProjectionChangePolicyProperty, renderPolicy, RenderPolicyProperty, selectedList, TransparencyProperty
 
Fields inherited from class com.bbn.openmap.Layer
addAsBackground, AddAsBackgroundProperty, addToBeanContext, AddToBeanContextProperty, attributes, autoPalette, AutoPaletteProperty, beanContextChildSupport, coordTransform, DataPathPrefixProperty, DisplayPaletteCmd, DisplayPropertiesCmd, doHack, HidePaletteCmd, i18n, localHackList, maxScale, MaxScaleProperty, minScale, MinScaleProperty, palette, paletteListener, PrettyNameProperty, propertyPrefix, readyToPaint, RedrawCmd, removable, RemovableProperty, SWING_PACKAGE, TransformProperty, windowSupport
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface com.bbn.openmap.PropertyConsumer
EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
EventLayer()
           
 
Method Summary
 void addTimeBoundsHandler(TimeBoundsHandler tbh)
          The TimeBoundsProvider keep track of the handlers it needs to notify when the bounds or activeness changes.
 void callForTimeBoundsReset()
           
 TemporalOMGraphicList createData()
          Read the data files and construct the TemporalOMGraphics.
 void findAndInit(java.lang.Object someObj)
          This method is called by the findAndInit(Iterator) method, once for every object inside the iterator.
 DataBounds getDataBounds()
          DataBoundsProvider method.
 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)
           
 java.lang.String getMode()
           
 java.util.Properties getProperties(java.util.Properties props)
          PropertyConsumer method, to fill in a Properties object, reflecting the current values of the layer.
 java.util.Properties getPropertyInfo(java.util.Properties list)
          Method to fill in a Properties object with values reflecting the properties able to be set on this PropertyConsumer.
 long getTime()
           
 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.
 OMGraphicList prepare()
          The main method call in the EventLayer that actually modifies the OMGraphics and updates the map.
 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.
 void setFilterState(java.lang.String filterName, java.lang.Boolean state)
           
 void setMode(java.lang.String mode)
           
 void setProperties(java.lang.String prefix, java.util.Properties properties)
          The properties and prefix are managed and decoded here, for the standard uses of the EventLayer.
protected  void setTimeBounds(TimeBounds tb)
           
 void setVisible(boolean setting)
          Part of a layer hack to notify the component listener when the component is hidden.
 void updateTime(TimeEvent te)
           
 
Methods inherited from class com.bbn.openmap.layer.OMGraphicHandlerLayer
actionPerformed, canSetList, copy, createLayerWorker, cut, deselect, dispose, doAction, doPrepare, filter, filter, filter, getConsumeEvents, getDefaultSettingsPanel, getFilter, getInfoText, getItemsForMapMenu, getItemsForOMGraphicMenu, getLayerWorker, getList, getMapMouseListener, getMouseEventInterpreter, getMouseModeIDsForEvents, getProjectionChangePolicy, getRedrawButton, getRenderPolicy, getSelected, getSettingsButton, getToolTipTextFor, getTransparency, getTransparencyAdjustmentPanel, highlight, isCancelled, isHighlightable, isInterruptable, isSelectable, isWorking, leftClick, mouseOver, paint, paste, projectionChanged, receivesMapEvents, renderDataForProjection, resetFiltering, select, setConsumeEvents, setFilter, setInterruptable, setLayerWorker, setList, setMouseEventInterpreter, setMouseModeIDsForEvents, setProjectionChangePolicy, setRenderPolicy, setTransparency, supportsSQL, unhighlight, workerComplete
 
Methods inherited from class com.bbn.openmap.Layer
addComponentListener, added, addInfoDisplayListener, addLayerStatusListener, addMouseListener, addVetoableChangeListener, childrenAdded, childrenRemoved, clearListeners, connectToBeanContext, createWindowSupport, disconnectFromBeanContext, finalize, findAndInit, findAndUndo, fireHideToolTip, firePaletteEvent, fireRequestBrowserContent, fireRequestBrowserContent, fireRequestCursor, fireRequestInfoLine, fireRequestInfoLine, fireRequestInfoLine, fireRequestMessage, fireRequestMessage, fireRequestToolTip, fireRequestToolTip, fireRequestURL, fireRequestURL, fireStatusUpdate, fireStatusUpdate, fireVetoableChange, getAddAsBackground, getAddToBeanContext, getAttribute, getBeanContext, getCoordTransform, getGUI, getIcon, getMaxScale, getMinScale, getPackage, getPalette, getProjection, getPropertyPrefix, getWindowSupport, hasGUI, hidePalette, isAutoPalette, isProjectionOK, isReadyToPaint, isRemovable, notifyHideHack, prependDataPathPrefix, putAttribute, removeComponentListener, removeConfirmed, removed, removeInfoDisplayListener, removeLayerStatusListener, removeVetoableChangeListener, repaint, resetPalette, setAddAsBackground, setAddToBeanContext, setAutoPalette, setBeanContext, setCoordTransform, setIcon, setLayerProperties, setMaxScale, setMinScale, setName, setPaletteVisible, setProjection, setProjection, setProperties, setPropertyPrefix, setReadyToPaint, setRemovable, setWindowSupport, showPalette
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.bbn.openmap.util.DataBoundsProvider
getName
 
Methods inherited from interface java.beans.beancontext.BeanContextChild
addPropertyChangeListener, removePropertyChangeListener
 

Field Detail

logger

public static java.util.logging.Logger logger

ImporterProperty

public static final java.lang.String ImporterProperty
See Also:
Constant Field Values

importer

protected EventImporter importer

dataBounds

protected DataBounds dataBounds

timeBounds

protected TimeBounds timeBounds

time

protected long time

mode

protected java.lang.String mode

active

protected boolean active

timeBoundsHandlers

protected java.util.List<TimeBoundsHandler> timeBoundsHandlers

events

protected java.util.LinkedList<OMEvent> events

filters

protected java.util.LinkedList<OMEvent> filters
Constructor Detail

EventLayer

public EventLayer()
Method Detail

prepare

public OMGraphicList prepare()
The main method call in the EventLayer that actually modifies the OMGraphics and updates the map.

Overrides:
prepare in class OMGraphicHandlerLayer

createData

public TemporalOMGraphicList createData()
Read the data files and construct the TemporalOMGraphics.


setProperties

public void setProperties(java.lang.String prefix,
                          java.util.Properties properties)
The properties and prefix are managed and decoded here, for the standard uses of the EventLayer.

Specified by:
setProperties in interface PropertyConsumer
Overrides:
setProperties in class OMGraphicHandlerLayer
Parameters:
prefix - string prefix used in the properties file for this layer.
properties - the properties set in the properties file.

getProperties

public java.util.Properties getProperties(java.util.Properties props)
PropertyConsumer method, to fill in a Properties object, reflecting the current values of the layer. If the layer has a propertyPrefix set, the property keys should have that prefix plus a separating '.' prepended to each property key it uses for configuration.

Specified by:
getProperties in interface PropertyConsumer
Overrides:
getProperties in class OMGraphicHandlerLayer
Parameters:
props - a Properties object to load the PropertyConsumer properties into.
Returns:
Properties object containing PropertyConsumer property values. If getList was not null, this should equal getList. Otherwise, it should be the Properties object created by the PropertyConsumer.

getPropertyInfo

public java.util.Properties getPropertyInfo(java.util.Properties list)
Method to fill in a Properties object with values reflecting the properties able to be set on this PropertyConsumer. The key for each property should be the raw property name (without a prefix) with a value that is a String that describes what the property key represents, along with any other information about the property that would be helpful (range, default value, etc.). This method takes care of the basic LocationHandler parameters, so any LocationHandlers that extend the AbstractLocationHandler should call this method, too, before adding any specific properties.

Specified by:
getPropertyInfo in interface PropertyConsumer
Overrides:
getPropertyInfo in class OMGraphicHandlerLayer
Parameters:
list - a Properties object to load the PropertyConsumer properties into. If getList equals null, then a new Properties object should be created.
Returns:
Properties object containing PropertyConsumer property values. If getList was not null, this should equal getList. Otherwise, it should be the Properties object created by the PropertyConsumer.

getMode

public java.lang.String getMode()

setMode

public void setMode(java.lang.String mode)

getDataBounds

public DataBounds getDataBounds()
DataBoundsProvider method.

Specified by:
getDataBounds in interface DataBoundsProvider
Returns:
a DataBounds object describing the area of coverage, may be null if the data hasn't been evaluated yet.

findAndInit

public void findAndInit(java.lang.Object someObj)
Description copied from class: Layer
This method is called by the findAndInit(Iterator) method, once for every object inside the iterator. It's here to allow subclasses a way to receive objects and still let the super classes have a shot at the object. So, you can override this method can call super.findAndInit(obj), or override the findAndInit(Iterator) method and call super.findAndInit(obj). Whatever.

Overrides:
findAndInit in class Layer

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

setTimeBounds

protected void setTimeBounds(TimeBounds tb)

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

updateTime

public void updateTime(TimeEvent te)
Specified by:
updateTime in interface TimeEventListener

getTime

public long getTime()

getEventList

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

getEventList

public java.util.List<OMEvent> getEventList(java.util.List filters)
Description copied from interface: OMEventHandler
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 pass filters

getFilterState

public java.lang.Boolean getFilterState(java.lang.String filterName)
Description copied from interface: OMEventHandler
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.

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.

getMacroFilteredList

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

setFilterState

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

callForTimeBoundsReset

public void callForTimeBoundsReset()

setVisible

public void setVisible(boolean setting)
Description copied from class: Layer
Part of a layer hack to notify the component listener when the component is hidden. These components don't receive the ComponentHidden notification. Remove when it works.

Overrides:
setVisible in class Layer


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