|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
com.bbn.openmap.Layer
com.bbn.openmap.layer.OMGraphicHandlerLayer
com.bbn.openmap.layer.imageTile.MapTileLayer
public class MapTileLayer
A Layer that uses a MapTileFactory to display information (tiles) on the map. Properties for this layer look like this:
tiles.class=com.bbn.openmap.layer.imageTile.MapTileLayer tiles.prettyName=TILES tiles.tileFactory=com.bbn.openmap.dataAccess.mapTile.StandardMapTileFactory tiles.jar=mapTilesInJar.jar (optional, for runtime jar loading) tiles.rootDir=root_directory_of_tiles #optional, .png is default tiles.fileExt=.png tiles.cacheSize=the number of mapTiles the factory should hold on to. The default is 100. # transform for naming convention of tiles default is OSMMapTileCoordinateTransform, but it depends on the source of tiles. GDAL is TSMMapTileCoordinateTransform mapTileTransform=com.bbn.openmap.dataAccess.mapTile.OSMMapTileCoordinateTransform, or com.bbn.openmap.dataAccess.mapTile.TMSMapTileCoordinateTransformYou can also have:
tiles.class=com.bbn.openmap.layer.imageTile.MapTileLayer tiles.prettyName=TILES tiles.tileFactory=com.bbn.openmap.dataAccess.mapTile.ServerMapTileFactory tiles.rootDir=URL root directory of tiles # a local location to cache tiles, to reduce load on server. tiles.localCacheRootDir=/data/tiles/osmtiles # other properties are the same. tiles.fileExt=.png tiles.cacheSize=the number of mapTiles the factory should hold on to. The default is 100. # transform for naming convention of tiles default is OSMMapTileCoordinateTransform, but it depends on the source of tiles. GDAL is TSMMapTileCoordinateTransform mapTileTransform=com.bbn.openmap.dataAccess.mapTile.OSMMapTileCoordinateTransform, or com.bbn.openmap.dataAccess.mapTile.TMSMapTileCoordinateTransformTo make things simpler, you can define a tiles.omp file that sits under the tile root directory or at the top level of the jar file, and let it specify the properties for the tile set. The properties in that file should be unscoped:
fileExt=.png #for instance, for GDAL processed stuff need this transform mapTileTransform=com.bbn.openmap.dataAccess.mapTile.TMSMapTileCoordinateTransform #in jar file, should specify rootDir inside jar to tiles (don't need this for file system rootDirs): rootDir=mytilesIf you do this last configuration, all you need to define is rootDir (and prettyName, class) property for layer, and then define all other props with data.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
javax.swing.JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
java.awt.Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
static java.lang.String |
INCREMENTAL_UPDATES_PROPERTY
Property to allow the MapTileFactory to call repaint on this layer as map tiles become available. |
protected boolean |
incrementalUpdates
Flag to allow this layer to set itself as a repaint callback object on the tile factory. |
static java.util.logging.Logger |
logger
|
static java.lang.String |
TILE_FACTORY_CLASS_PROPERTY
Property that sets the class name of the MapTileFactory to use for this layer. |
protected MapTileFactory |
tileFactory
The MapTileFactory that knows how to fetch image files and create OMRasters for them. |
static java.lang.String |
ZOOM_LEVEL_PROPERTY
A property to set if you want to force the layer to use tiles of a certain zoom level. |
protected int |
zoomLevel
The zoomLevel to use when requesting tiles from the MapTileFactory. |
| Fields inherited from class com.bbn.openmap.layer.OMGraphicHandlerLayer |
|---|
consumeEvents, ConsumeEventsProperty, filter, interruptable, InterruptableProperty, layerWorker, LAYERWORKER_LOCK, layerWorkerQueue, mouseEventInterpreter, mouseModeIDs, MouseModesProperty, projectionChangePolicy, ProjectionChangePolicyProperty, renderPolicy, RenderPolicyProperty, selectedList, TransparencyProperty |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface com.bbn.openmap.PropertyConsumer |
|---|
EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
MapTileLayer()
|
|
MapTileLayer(MapTileFactory tileFactory)
|
|
| Method Summary | |
|---|---|
java.util.Properties |
getProperties(java.util.Properties props)
Overrides Layer getProperties method., also calls that method on Layer. |
MapTileFactory |
getTileFactory()
|
java.lang.String |
getToolTipTextFor(OMGraphic omg)
If applicable, should return a tool tip for the OMGraphic. |
int |
getZoomLevel()
|
boolean |
isIncrementalUpdates()
|
OMGraphicList |
prepare()
OMGraphicHandlerLayer method, called with projection changes or whenever else doPrepare() is called. |
void |
removed(java.awt.Container cont)
Called when the layer has been turned off and the projection changes, signifying that the layer can clean up. |
void |
setIncrementalUpdates(boolean incrementalUpdates)
|
void |
setProperties(java.lang.String prefix,
java.util.Properties props)
Overrides the Layer setProperties method. |
void |
setTileFactory(MapTileFactory tileFactory)
|
void |
setZoomLevel(int zoomLevel)
|
| Methods inherited from class javax.swing.JComponent |
|---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update, updateUI |
| Methods inherited from class java.awt.Container |
|---|
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
| Methods inherited from class java.awt.Component |
|---|
action, add, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.beans.beancontext.BeanContextChild |
|---|
addPropertyChangeListener, removePropertyChangeListener |
| Field Detail |
|---|
public static java.util.logging.Logger logger
public static final java.lang.String TILE_FACTORY_CLASS_PROPERTY
public static final java.lang.String INCREMENTAL_UPDATES_PROPERTY
public static final java.lang.String ZOOM_LEVEL_PROPERTY
protected MapTileFactory tileFactory
protected boolean incrementalUpdates
protected int zoomLevel
| Constructor Detail |
|---|
public MapTileLayer()
public MapTileLayer(MapTileFactory tileFactory)
| Method Detail |
|---|
public OMGraphicList prepare()
prepare in class OMGraphicHandlerLayerpublic java.lang.String getToolTipTextFor(OMGraphic omg)
OMGraphicHandlerLayer
getToolTipTextFor in interface GestureResponsePolicygetToolTipTextFor in class OMGraphicHandlerLayer
public void setProperties(java.lang.String prefix,
java.util.Properties props)
OMGraphicHandlerLayer
setProperties in interface PropertyConsumersetProperties in class OMGraphicHandlerLayerprefix - the token to prefix the property namesprops - the Properties objectpublic java.util.Properties getProperties(java.util.Properties props)
OMGraphicHandlerLayer
getProperties in interface PropertyConsumergetProperties in class OMGraphicHandlerLayerprops - a Properties object to load the PropertyConsumer properties
into. If props equals null, then a new Properties object should be
created.
public void removed(java.awt.Container cont)
removed in class Layercont - Containerpublic MapTileFactory getTileFactory()
public void setTileFactory(MapTileFactory tileFactory)
public boolean isIncrementalUpdates()
public void setIncrementalUpdates(boolean incrementalUpdates)
public int getZoomLevel()
public void setZoomLevel(int zoomLevel)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||