|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bbn.openmap.MapHandlerChild com.bbn.openmap.OMComponent com.bbn.openmap.layer.location.AbstractLocationHandler com.bbn.openmap.layer.location.csv.CSVLocationHandler com.bbn.openmap.layer.location.csv.CSVLinkHandler
public class CSVLinkHandler
The CSVLinkHandler is designed to let you put data on the map based on information from a Comma Separated Value(CSV) file. It's assumed that the each row in the file refers to two locations, and that a link is to be shown between the two locations. It has the same basic properties as the CSVLocationHandler, with allowances for extra lat/lon per record to handle the other side of the link/line.
The individual fields must not have leading whitespace.
The locationFile property should contain a URL referring to the file. This can take the form of file:/myfile.csv for a local file or http://somehost.org/myfile.csv for a remote file If there is a lat/lon index, and a lat2/lon2 index, then the links' endpoints are in the link file.
The Link CSV file has to have certain fields, and the column number of those fields are set in the properties:
# latitude and longitude indexes of the link end points. The first two are the same as CSVLocationHandler. linkMarkerName.latIndex=column_number linkMarkerName.lonIndex=column_number linkMarkerName.lat2Index=column_number linkMarkerName.lon2Index=column_number #plus all the other optional properties. The marker parameters will work on the link OMGraphics.
TODO: update the quadtree used to instead use a com.bbn.openmap.geo.ExtentIndex, so that lines that bisect the map will appear. Right now, one of the endpoints of the line has to be in the map window in order for the link to be displayed, and that's not quite right.
Field Summary | |
---|---|
protected int |
lat2Index
Index of column in CSV to use as latitude2 of link. |
static java.lang.String |
Lat2IndexProperty
Property to use to designate the column of the link file to use as the latitude of end "2". |
protected int |
lon2Index
Index of column in CSV to use as longitude2 of link. |
static java.lang.String |
Lon2IndexProperty
Property to use to designate the column of the link file to use as the longitude of end "2". |
Fields inherited from class com.bbn.openmap.layer.location.csv.CSVLocationHandler |
---|
box, csvHasHeader, csvHeaderProperty, defaultIconURL, DefaultIconURLProperty, eastIsNeg, eastIsNegProperty, iconIndex, IconIndexProperty, latIndex, LatIndexProperty, locationFile, LocationFileProperty, lonIndex, LonIndexProperty, nameIndex, NameIndexProperty, quadtree |
Fields inherited from class com.bbn.openmap.layer.location.AbstractLocationHandler |
---|
i18n, logger, RenderAttributesListProperty, zLayer |
Fields inherited from class com.bbn.openmap.OMComponent |
---|
propertyPrefix |
Fields inherited from class com.bbn.openmap.MapHandlerChild |
---|
beanContextChildSupport, isolated |
Fields inherited from interface com.bbn.openmap.layer.location.LocationHandler |
---|
defaultLocationColorString, defaultNameColorString, forceGlobalCommand, ForceGlobalProperty, LocationPropertyPrefix, NamePropertyPrefix, readDataCommand, showdetails, showLocationsCommand, ShowLocationsProperty, showname, showNamesCommand, ShowNamesProperty |
Fields inherited from interface com.bbn.openmap.PropertyConsumer |
---|
EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty |
Constructor Summary | |
---|---|
CSVLinkHandler()
The default constructor for the Layer. |
Method Summary | |
---|---|
protected boolean |
checkIndexSettings()
|
protected void |
createLocation(java.util.List recordList,
QuadTree<Location> qt)
This is the method called by create data with a row's worth of information stuffed in the record List. |
java.awt.Component |
getGUI()
Provides the palette widgets to control the options of showing maps, or attribute text. |
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 CSVLinkHandler. |
Methods inherited from class com.bbn.openmap.layer.location.csv.CSVLocationHandler |
---|
createData, createLocation, get, getItemsForPopupMenu, reloadData, tokenToDouble, tokenToDouble, tokenToString |
Methods inherited from class com.bbn.openmap.layer.location.AbstractLocationHandler |
---|
getLayer, getLocationColor, getLocationDrawingAttributes, getNameColor, getNameDrawingAttributes, getPrettyName, getPropertyPrefix, isForceGlobal, isShowLocations, isShowNames, removed, setForceGlobal, setLayer, setLocationColor, setLocationDrawingAttributes, setNameColor, setNameDrawingAttributes, setPrettyName, setProperties, setPropertyPrefix, setShowLocations, setShowNames |
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 |
Methods inherited from interface com.bbn.openmap.layer.location.LocationHandler |
---|
getLayer, getPrettyName, isForceGlobal, isShowLocations, isShowNames, removed, setForceGlobal, setLayer, setPrettyName, setShowLocations, setShowNames |
Methods inherited from interface com.bbn.openmap.PropertyConsumer |
---|
getPropertyPrefix, setProperties, setPropertyPrefix |
Field Detail |
---|
public static final java.lang.String Lat2IndexProperty
public static final java.lang.String Lon2IndexProperty
protected int lat2Index
protected int lon2Index
Constructor Detail |
---|
public CSVLinkHandler()
Method Detail |
---|
public void setProperties(java.lang.String prefix, java.util.Properties properties)
setProperties
in interface PropertyConsumer
setProperties
in class CSVLocationHandler
prefix
- string prefix used in the properties file for this layer.properties
- the properties set in the properties file.public java.util.Properties getProperties(java.util.Properties props)
getProperties
in interface PropertyConsumer
getProperties
in class CSVLocationHandler
props
- a Properties object to load the PropertyConsumer properties
into.
public java.util.Properties getPropertyInfo(java.util.Properties list)
getPropertyInfo
in interface PropertyConsumer
getPropertyInfo
in class CSVLocationHandler
list
- a Properties object to load the PropertyConsumer properties
into. If getList equals null, then a new Properties object should
be created.
protected boolean checkIndexSettings()
checkIndexSettings
in class CSVLocationHandler
public java.awt.Component getGUI()
In this case, the palette widget only contains one button, which reloads the data files for the layer.
getGUI
in interface LocationHandler
getGUI
in class CSVLocationHandler
protected void createLocation(java.util.List recordList, QuadTree<Location> qt)
createLocation
in class CSVLocationHandler
recordList
- a record/row of data from the csv file.qt
- the Quadtree to add the Location object, created from the row
contents.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |