com.bbn.openmap.layer.event
Class CSVEventImporter

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

public class CSVEventImporter
extends OMComponent
implements EventImporter

A data importer for the EventLayer. The location file should contain information about objects that will be moving on the map. The activity file will contain information about where and when the objects moved. Sample properties:

    eventLayer.class=com.bbn.openmap.layer.time.EventLayer
    eventLayer.importer=com.bbn.openmap.layer.time.CSVEventImporter
    eventLayer.prettyName=Test Event
    eventLayer.locationFile=org-list.csv
    eventLayer.locationFileHasHeader=true
    eventLayer.nameIndex=0
    eventLayer.iconIndex=5
    eventLayer.activityFile=org-activities.csv
    eventLayer.activityFileHasHeader=true
    eventLayer.activityNameIndex=1
    eventLayer.latIndex=9
    eventLayer.lonIndex=10
    eventLayer.timeFormat=d-MMM-yyyy HH:mm
    eventLayer.timeIndex=7
    # If no icon defined, used for location markers edge.
    eventLayer.lineColor=aaaaaa33
    # If no icon defined, used for location markers fill.
    eventLayer.fillColor=aaaaaa33
 

Author:
dietrick

Field Summary
protected  java.lang.String activityFile
           
static java.lang.String ActivityFileProperty
          activityFile
protected  boolean activityHeader
           
static java.lang.String ActivityHeaderProperty
          activityFileHasHeader
protected  int activityNameIndex
           
static java.lang.String ActivityNameIndexProperty
          activityNameIndex
protected  java.lang.String defaultIconURL
          Icon URL for points to use as default.
static java.lang.String DefaultIconURLProperty
          defaultURL
protected  DrawingAttributes drawingAttributes
           
protected  boolean eastIsNeg
           
static java.lang.String EastIsNegProperty
          eastIsNeg
protected  int iconIndex
           
static java.lang.String IconIndexProperty
          iconIndex
protected  int latIndex
           
static java.lang.String LatIndexProperty
          latIndex
protected  java.lang.String locationFile
           
static java.lang.String LocationFileProperty
          locationFile
protected  boolean locationHeader
           
static java.lang.String LocationHeaderProperty
          locationFileHasHeader
static java.util.logging.Logger logger
           
protected  int lonIndex
           
static java.lang.String LonIndexProperty
          lonIndex
protected  int nameIndex
           
static java.lang.String NameIndexProperty
          nameIndex
protected  int orientation
           
protected  boolean showNames
           
static java.lang.String ShowNamesProperty
          showNames
protected  java.text.SimpleDateFormat timeFormat
          TimeFormat default is similar to IETF standard date syntax: "Sat, 12 Aug 1995 13:30:00 GMT" represented by (EEE, d MMM yyyy HH:mm:ss z), except for the local timezone.
static java.lang.String TimeFormatProperty
          timeFormat
protected  int timeIndex
           
static java.lang.String TimeIndexProperty
          timeIndex
 
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
CSVEventImporter()
           
 
Method Summary
 TemporalOMGraphicList createData(EventLayer callback)
          Read the data files and construct the TemporalOMGraphics.
 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.
 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.
 
Methods inherited from class com.bbn.openmap.OMComponent
getPropertyPrefix, setProperties, setPropertyPrefix
 
Methods inherited from class com.bbn.openmap.MapHandlerChild
addPropertyChangeListener, addVetoableChangeListener, childrenAdded, childrenRemoved, findAndInit, findAndInit, findAndUndo, 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

logger

public static java.util.logging.Logger logger

LocationFileProperty

public static final java.lang.String LocationFileProperty
locationFile

See Also:
Constant Field Values

LocationHeaderProperty

public static final java.lang.String LocationHeaderProperty
locationFileHasHeader

See Also:
Constant Field Values

IconIndexProperty

public static final java.lang.String IconIndexProperty
iconIndex

See Also:
Constant Field Values

NameIndexProperty

public static final java.lang.String NameIndexProperty
nameIndex

See Also:
Constant Field Values

ActivityFileProperty

public static final java.lang.String ActivityFileProperty
activityFile

See Also:
Constant Field Values

ActivityNameIndexProperty

public static final java.lang.String ActivityNameIndexProperty
activityNameIndex

See Also:
Constant Field Values

ActivityHeaderProperty

public static final java.lang.String ActivityHeaderProperty
activityFileHasHeader

See Also:
Constant Field Values

LatIndexProperty

public static final java.lang.String LatIndexProperty
latIndex

See Also:
Constant Field Values

LonIndexProperty

public static final java.lang.String LonIndexProperty
lonIndex

See Also:
Constant Field Values

TimeIndexProperty

public static final java.lang.String TimeIndexProperty
timeIndex

See Also:
Constant Field Values

EastIsNegProperty

public static final java.lang.String EastIsNegProperty
eastIsNeg

See Also:
Constant Field Values

ShowNamesProperty

public static final java.lang.String ShowNamesProperty
showNames

See Also:
Constant Field Values

DefaultIconURLProperty

public static final java.lang.String DefaultIconURLProperty
defaultURL

See Also:
Constant Field Values

TimeFormatProperty

public static final java.lang.String TimeFormatProperty
timeFormat

See Also:
Constant Field Values

timeFormat

protected java.text.SimpleDateFormat timeFormat
TimeFormat default is similar to IETF standard date syntax: "Sat, 12 Aug 1995 13:30:00 GMT" represented by (EEE, d MMM yyyy HH:mm:ss z), except for the local timezone.


locationFile

protected java.lang.String locationFile

locationHeader

protected boolean locationHeader

nameIndex

protected int nameIndex

iconIndex

protected int iconIndex

activityFile

protected java.lang.String activityFile

activityHeader

protected boolean activityHeader

activityNameIndex

protected int activityNameIndex

latIndex

protected int latIndex

lonIndex

protected int lonIndex

timeIndex

protected int timeIndex

eastIsNeg

protected boolean eastIsNeg

orientation

protected int orientation

defaultIconURL

protected java.lang.String defaultIconURL
Icon URL for points to use as default. May be null.


showNames

protected boolean showNames

drawingAttributes

protected DrawingAttributes drawingAttributes
Constructor Detail

CSVEventImporter

public CSVEventImporter()
Method Detail

createData

public TemporalOMGraphicList createData(EventLayer callback)
Read the data files and construct the TemporalOMGraphics. You also need to create TimeBounds, keep track of the time stamps from the data source, and set the new TimeBounds on the EventLayer before returning from this method. If you want to set the DataBounds on the layer, in order for the view menu to have a selection for the area of interest, fetch the DataBounds object and set it accordingly while you are in this method.

Read the data files and construct the TemporalOMGraphics. There are four things you need to do in this method.

Specified by:
createData in interface EventImporter

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 OMComponent
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 OMComponent
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 OMComponent
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.


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