|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.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.
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)
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.
| Nested Class Summary | |
|---|---|
class |
CSVLinkHandler.LinkDecoder
|
| Nested classes/interfaces inherited from class com.bbn.openmap.layer.location.csv.CSVLocationHandler |
|---|
CSVLocationHandler.DefaultLocationDecoder, CSVLocationHandler.TokenDecoder |
| 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". |
static java.lang.String |
LinkTypeIndexProperty
Not used. |
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 |
|---|
i18n, locationDrawingAttributes, logger, nameDrawingAttributes, propertyPrefix, zLayer |
| Fields inherited from interface com.bbn.openmap.layer.location.LocationHandler |
|---|
defaultLocationColorString, defaultNameColorString, forceGlobalCommand, ForceGlobalProperty, LocationColorProperty, LocationPropertyPrefix, NameColorProperty, 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 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. |
protected CSVLocationHandler.TokenDecoder |
getTokenDecoder()
|
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 |
|---|
actionPerformed, createData, createLocation, get, getItemsForPopupMenu, readCSVLineFromFile, reloadData |
| Methods inherited from class com.bbn.openmap.layer.location.AbstractLocationHandler |
|---|
getLayer, getLocationColor, getLocationDrawingAttributes, getNameColor, getNameDrawingAttributes, getPropertyPrefix, isForceGlobal, isShowLocations, isShowNames, removed, setForceGlobal, setLayer, setLocationColor, setLocationDrawingAttributes, setNameColor, setNameDrawingAttributes, 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
protected int lat1Index
protected int lon1Index
protected int lat2Index
protected int lon2Index
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 PropertyConsumersetProperties in class CSVLocationHandlerprefix - 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 PropertyConsumergetProperties in class CSVLocationHandlerprops - a Properties object to load the PropertyConsumer properties
into.
public java.util.Properties getPropertyInfo(java.util.Properties list)
getPropertyInfo in interface PropertyConsumergetPropertyInfo in class CSVLocationHandlerlist - 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 CSVLocationHandlerprotected CSVLocationHandler.TokenDecoder getTokenDecoder()
getTokenDecoder in class CSVLocationHandlerpublic 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 LocationHandlergetGUI in class CSVLocationHandlerprotected int getLineTypeFromToken(java.lang.Object token)
token - the token read from the 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 | |||||||||