|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bbn.openmap.plugin.AbstractPlugIn com.bbn.openmap.plugin.BeanContextAbstractPlugIn com.bbn.openmap.plugin.OMGraphicHandlerPlugIn com.bbn.openmap.plugin.CSVTiledImagePlugIn
public class CSVTiledImagePlugIn
This PlugIn can be used to load image files for background use. The images are automatically scaled to fit the projection. The actual accuracy of matching the scaled images to the map depends on the projection of the images, and the projection type being used for the map. At larger scales, the error may not be noticeable.
This PlugIn uses a csv file to find out about the images that should be loaded. The layer assumes that the csv file has these fields, in this order:
Upper Latitude, Western Longitude, Lower Latitude, Eastern Longitude, URL of image 42,-73.5,40,-72,file:///data/images/test1.jpg 40,-73.5,38,-72,file:///data/images/test2.jpgMake sure there are not spaces in the data portion of the file!
The properties for the PlugIn look like this:
plugin.class=com.bbn.openmap.plugin.CSVTiledImagePlugIn plugin.prettyName=Name of Layer # URL of the data file plugin.tileFile=URL of csv file # If the csv file has descriptive header line that should not be used for images. (default = true) plugin.fileHasHeader=trueThe PlugIn doesn't do anything fancy with image caching. The plugin loads all of the images when the layer is turned on. You might have to bump up the heap size of the JVM when loading large or many images.
This class was inspired by, and created from parts of the ImageLayer submission from Adrian Lumsden@sss, on 25-Jan-2002. Use the MediaTracker code from that class. Update: The MediaTracker has been replaced by ImageIO components in OpenMap 4.6.3.
Field Summary | |
---|---|
static java.lang.String |
CSVFileNameProperty
The property for the data file - tileFile. |
protected boolean |
DEBUG
|
protected boolean |
fileHasHeader
|
static java.lang.String |
FileHasHeaderProperty
The property for whether the data file has a descriptive header on the first line, to let the reader know to ignore that line - fileHasHeader. |
int |
lrlatIndex
Index of column for lower latitude of image in the csv file. |
int |
lrlonIndex
Index of column for eastern longitude of image in the csv file. |
protected CSVFile |
tilefile
|
protected java.lang.String |
tileFileName
|
protected java.util.HashSet |
tiles
The set of tiles. |
int |
ullatIndex
Index of column for upper latitude of image in the csv file. |
int |
ullonIndex
Index of column for western longitude of image in the csv file. |
int |
urlIndex
Index of column for URL of image file in the csv file. |
Fields inherited from class com.bbn.openmap.plugin.OMGraphicHandlerPlugIn |
---|
filter |
Fields inherited from class com.bbn.openmap.plugin.BeanContextAbstractPlugIn |
---|
beanContextChildSupport |
Fields inherited from class com.bbn.openmap.plugin.AbstractPlugIn |
---|
addToBeanContext, component, i18n, mml, name, prefix, removable, RemovableProperty |
Fields inherited from interface com.bbn.openmap.PropertyConsumer |
---|
EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty |
Constructor Summary | |
---|---|
CSVTiledImagePlugIn()
Default constructor. |
|
CSVTiledImagePlugIn(java.awt.Component comp)
|
Method Summary | |
---|---|
int |
getLrlatIndex()
|
int |
getLrlonIndex()
|
java.util.Properties |
getProperties(java.util.Properties getList)
Method to fill in a Properties object, reflecting the current values of the PropertyConsumer. |
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. |
OMGraphicList |
getRectangle(Projection p)
The getRectangle call is the main call into the PlugIn module. |
CSVFile |
getTilefile()
|
java.lang.String |
getTileFileName()
|
java.util.HashSet |
getTiles()
|
int |
getUllatIndex()
|
int |
getUllonIndex()
|
int |
getUrlIndex()
|
boolean |
isFileHasHeader()
|
protected void |
loadTiles(java.lang.String csvFileName)
Takes the URL to a csv file and parses it into OMScaledRasters, adding them to the tiles HashSet. |
void |
setFileHasHeader(boolean fileHasHeader)
|
void |
setLrlatIndex(int lrlatIndex)
|
void |
setLrlonIndex(int lrlonIndex)
|
void |
setProperties(java.lang.String prefix,
java.util.Properties props)
PropertyConsumer method, setting the PlugIn with properties that apply to it. |
void |
setTilefile(CSVFile tilefile)
|
void |
setTileFileName(java.lang.String tileFileName)
|
void |
setTiles(java.util.HashSet tiles)
|
void |
setUllatIndex(int ullatIndex)
|
void |
setUllonIndex(int ullonIndex)
|
void |
setUrlIndex(int urlIndex)
|
Methods inherited from class com.bbn.openmap.plugin.OMGraphicHandlerPlugIn |
---|
canSetList, doAction, filter, filter, filter, getFilter, getList, resetFiltering, setFilter, setList, supportsSQL |
Methods inherited from class com.bbn.openmap.plugin.BeanContextAbstractPlugIn |
---|
addPropertyChangeListener, addVetoableChangeListener, childrenAdded, childrenRemoved, findAndInit, findAndInit, findAndUndo, firePropertyChange, fireVetoableChange, getBeanContext, removePropertyChangeListener, removeVetoableChangeListener, setBeanContext |
Methods inherited from class com.bbn.openmap.plugin.AbstractPlugIn |
---|
dispose, doPrepare, getAddToBeanContext, getComponent, getGUI, getMapMouseListener, getMouseModeServiceList, getName, getPropertyPrefix, isRemovable, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mouseMoved, mousePressed, mouseReleased, removed, repaint, setAddToBeanContext, setComponent, setMapMouseListener, setName, setProperties, setPropertyPrefix, setRemovable |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.HashSet tiles
protected boolean DEBUG
public static final java.lang.String CSVFileNameProperty
public static final java.lang.String FileHasHeaderProperty
protected java.lang.String tileFileName
protected boolean fileHasHeader
protected CSVFile tilefile
public int ullatIndex
public int ullonIndex
public int lrlatIndex
public int lrlonIndex
public int urlIndex
Constructor Detail |
---|
public CSVTiledImagePlugIn()
public CSVTiledImagePlugIn(java.awt.Component comp)
Method Detail |
---|
public OMGraphicList getRectangle(Projection p)
getRectangle
in interface PlugIn
getRectangle
in class OMGraphicHandlerPlugIn
p
- projection of the screen, holding scale, center coords, height,
width.
Projection
,
OMGraphicList
public void setProperties(java.lang.String prefix, java.util.Properties props)
setProperties
in interface PropertyConsumer
setProperties
in class AbstractPlugIn
prefix
- a String used by the PropertyConsumer to prepend to each
property value it wants to look up -
setList.getProperty(prefix.propertyKey). If the prefix had already
been set, then the prefix passed in should replace that previous
value.props
- a Properties object that the PropertyConsumer can use to
retrieve expected properties it can use for configuration.protected void loadTiles(java.lang.String csvFileName)
public java.util.Properties getProperties(java.util.Properties getList)
getProperties
in interface PropertyConsumer
getProperties
in class AbstractPlugIn
getList
- a Properties object to load the PropertyConsumer
properties into. If getList equals null, then a new Properties
object should be created.
public java.util.Properties getPropertyInfo(java.util.Properties list)
getPropertyInfo
in interface PropertyConsumer
getPropertyInfo
in class AbstractPlugIn
list
- a Properties object to load the PropertyConsumer properties
into. If getList equals null, then a new Properties object should
be created.
public boolean isFileHasHeader()
public void setFileHasHeader(boolean fileHasHeader)
public int getLrlatIndex()
public void setLrlatIndex(int lrlatIndex)
public int getLrlonIndex()
public void setLrlonIndex(int lrlonIndex)
public CSVFile getTilefile()
public void setTilefile(CSVFile tilefile)
public java.lang.String getTileFileName()
public void setTileFileName(java.lang.String tileFileName)
public java.util.HashSet getTiles()
public void setTiles(java.util.HashSet tiles)
public int getUllatIndex()
public void setUllatIndex(int ullatIndex)
public int getUllonIndex()
public void setUllonIndex(int ullonIndex)
public int getUrlIndex()
public void setUrlIndex(int urlIndex)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |