|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.bbn.openmap.layer.location.AbstractLocationHandler | +--com.bbn.openmap.layer.location.csv.CSVLocationHandler | +--com.bbn.openmap.layer.location.csv.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.
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 lat1/lon1 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 linkMarkerName.lat1Index=column_number linkMarkerName.lon1Index=column_number linkMarkerName.lat2Index=column_number linkMarkerName.lon2Index=column_number # These are optional linkMarkerName.dashIndex=column_number for true/false (false is default) linkMarkerName.colorIndex=column_number for color notation linkMarkerName.thicknessIndex=column_number for pixel thickness of link linkMarkerName.geoStyleIndex=column_number for link rendertype (STRAIGHT, GC, RHUMB)
Field Summary | |
protected int |
colorIndex
|
static java.lang.String |
ColorIndexProperty
|
protected int |
dashIndex
|
static java.lang.String |
DashIndexProperty
Index in file for True/false property to indicate link should be dashed line. |
protected int |
geoStyleIndex
Index of column in CSV to use as the line-type to draw a link in. |
static java.lang.String |
GeoStyleIndexProperty
Index in CSV file for rendertype of link - STRAIGHT, GC, RHUMB |
protected int |
lat1Index
Index of column in CSV to use as latitude1 of link. |
static java.lang.String |
Lat1IndexProperty
Property to use to designate the column of the link file to use as the latitude of end "1". |
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 |
linkTypeIndex
Index of column in CSV to use as the type of link. |
static java.lang.String |
LinkTypeIndexProperty
Not used. |
static java.lang.String |
LinkTypesProperty
The names of the various link types on the map. |
protected int |
lon1Index
Index of column in CSV to use as longitude1 of link. |
static java.lang.String |
Lon1IndexProperty
Property to use to designate the column of the link file to use as the longitude of end "1". |
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". |
protected int |
thicknessIndex
|
static java.lang.String |
ThicknessIndexProperty
|
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 |
locationColor, nameColor, propertyPrefix, zLayer |
Fields inherited from interface com.bbn.openmap.layer.location.LocationHandler |
defaultLocationColorString, defaultNameColorString, forceGlobalCommand, ForceGlobalProperty, LocationColorProperty, NameColorProperty, 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 | |
void |
actionPerformed(java.awt.event.ActionEvent e)
The Action Listener method, that reacts to the palette widgets actions. |
protected QuadTree |
createData()
This is called by the CSVLinkWorker to load the CSV file |
protected java.awt.Color |
getColorFromToken(java.lang.Object token)
This interprets a color value from a token. |
java.awt.Component |
getGUI()
Provides the palette widgets to control the options of showing maps, or attribute text. |
protected int |
getLineTypeFromToken(java.lang.Object token)
This gets a line-type from a token, and translates it into one of LINETYPE_STRAIGHT, LINETYPE_GREATCIRCLE, or LINETYPE_RHUMB. |
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 |
createLocation, fillLocationPopUpMenu, get, readCSVLineFromFile, reloadData |
Methods inherited from class com.bbn.openmap.layer.location.AbstractLocationHandler |
getLayer, getLocationColor, getNameColor, getPropertyPrefix, isForceGlobal, isShowLocations, isShowNames, removed, setForceGlobal, setLayer, setLocationColor, setNameColor, setProperties, setPropertyPrefix, setShowLocations, setShowNames |
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, isForceGlobal, isShowLocations, isShowNames, removed, setForceGlobal, setLayer, setShowLocations, setShowNames |
Methods inherited from interface com.bbn.openmap.PropertyConsumer |
getPropertyPrefix, setProperties, setPropertyPrefix |
Field Detail |
public static final java.lang.String Lat1IndexProperty
public static final java.lang.String Lon1IndexProperty
public static final java.lang.String Lat2IndexProperty
public static final java.lang.String Lon2IndexProperty
public static final java.lang.String LinkTypeIndexProperty
public static final java.lang.String DashIndexProperty
public static final java.lang.String ColorIndexProperty
public static final java.lang.String ThicknessIndexProperty
public static final java.lang.String GeoStyleIndexProperty
public static final java.lang.String LinkTypesProperty
protected int lat1Index
protected int lon1Index
protected int lat2Index
protected int lon2Index
protected int linkTypeIndex
protected int geoStyleIndex
protected int dashIndex
protected int colorIndex
protected int thicknessIndex
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 QuadTree createData()
createData
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
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
actionPerformed
in class CSVLocationHandler
protected int getLineTypeFromToken(java.lang.Object token)
token
- the token read from teh CSV file.
protected java.awt.Color getColorFromToken(java.lang.Object token)
token
- the token read from the CSV file.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |