|
|||||||||
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
org.ka2ddo.yaac.gui.osm.OSMLayer
public class OSMLayer
This class implements a rendering Layer for OpenMap that draws street maps on the MapBean based on the binary tiled map data extracted from the OpenStreetMap database.
OsmXmlSegmenter
,
Serialized FormNested 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.awt.Color |
DEFAULT_BUILDING_COLOR
The default color used for filling building outlines on the OpenStreetMap layer of the map. |
static float |
MAX_NODE_LABEL_ZOOM
Maximum value of map scale for rendering the labels of Nodes without either matching a searched-for AmenityType or having an expanded zoom level (due to being a Place). |
static float |
MAX_NODE_ZOOM
Maximum value of map scale for rendering Nodes without either matching a searched-for AmenityType or having an expanded zoom level (due to being a Place). |
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 | |
---|---|
OSMLayer()
Create a layer for the map that renders OpenStreetMap data. |
Method Summary | |
---|---|
void |
componentHidden(java.awt.event.ComponentEvent e)
Invoked when the OSMLayer has been made invisible. |
void |
componentMoved(java.awt.event.ComponentEvent e)
Invoked when the OSMLayer's position changes. |
void |
componentResized(java.awt.event.ComponentEvent e)
Invoked when the map window's size changes. |
void |
componentShown(java.awt.event.ComponentEvent e)
Invoked when the OSMLayer has been made visible. |
void |
flushFileCache()
Clear cached pointers to tile files. |
AmenityType |
getAmenityToShow()
Report the specific AmenityType being highlighted on the map. |
java.awt.Color |
getBuildingColor()
Get the current color used for filling in buildings on the map. |
MapMouseListener |
getMapMouseListener()
Specify the object to receive OpenMap mouse events on behalf of the OSM Layer. |
java.lang.String[] |
getMouseModeServiceList()
Specify the behavior the MapBean should give to this OSMLayer for mouse input. |
void |
initializePlaceZoomLevels()
Load the persisted zoom levels for Place labels from the Preferences backing store. |
boolean |
isAutoLoadOsmTiles()
Report whether YAAC is configured to try to auto-download pre-imported OSM tiles that are not currently on the system. |
boolean |
isShowHighwaySigns()
Report whether highway signs should be displayed on the map. |
boolean |
isShowLabelsInEnglish()
Report whether map labels should be displayed in English if the default name is in some other locale and OpenStreetMap provides an English translation. |
boolean |
isShowLayer(int index)
Report whether the identified WayType layer should be rendered on the map. |
boolean |
isShowMap()
Report whether the OpenStreetMap map overlay should be displayed. |
boolean |
isShowPOI()
Report whether OSM Node points of interest should be displayed. |
boolean |
isShowUnlabeledWays()
Report if unlabeled and untyped map features should be displayed. |
boolean |
mouseClicked(java.awt.event.MouseEvent e)
Invoked when the mouse button has been clicked (pressed and released) on a component. |
boolean |
mouseDragged(java.awt.event.MouseEvent mouseEvent)
|
void |
mouseEntered(java.awt.event.MouseEvent mouseEvent)
Invoked when the mouse enters a component. |
void |
mouseExited(java.awt.event.MouseEvent mouseEvent)
Invoked when the mouse exits a component. |
void |
mouseMoved()
|
boolean |
mouseMoved(java.awt.event.MouseEvent mouseEvent)
|
boolean |
mousePressed(java.awt.event.MouseEvent mouseEvent)
Invoked when a mouse button has been pressed on a component. |
boolean |
mouseReleased(java.awt.event.MouseEvent mouseEvent)
Invoked when a mouse button has been released on a component. |
protected void |
paintComponent(java.awt.Graphics g)
Paint the rendered OpenStreetMap data into the map window. |
void |
projectionChanged(ProjectionEvent e)
Callback from OpenMap when map projection is changed, |
void |
regenerateAndRepaint()
Cause the OSMLayer to recompute its map based on current settings. |
void |
run()
DO NOT CALL: background thread to render OpenStreetMap data into a BufferedImage for painting on the map window. |
void |
setAmenityToShow(AmenityType amenityToShow)
Specify that Ways and Nodes of the specified AmenityType should be highlighted on the map, regardless of zoom level, or that there is no special type to highlight. |
void |
setAutoLoadOsmTiles(boolean autoLoadOsmTiles)
Specify whether auto-download of missing pre-imported OSM tiles should be performed. |
void |
setBuildingColor(java.awt.Color buildingColor)
Set the color to be used for filling building outlines on the map. |
void |
setShowHighwaySigns(boolean showHighwaySigns)
Specify whether highway signs should be displayed on the map. |
void |
setShowLabelsInEnglish(boolean showLabelsInEnglish)
Specify whether map labels should be displayed in English if the default name is in some other locale and OpenStreetMap provides an English translation. |
void |
setShowLayer(boolean showLayer,
int index)
Specify whether the identified WayType layer should be rendered on the map. |
void |
setShowMap(boolean showMap)
Specify whether the OpenStreetMap map overlay should be rendered. |
void |
setShowPOI(boolean showPOI)
Specify whether OSM Node points of interest should be displayed. |
void |
setShowUnlabeledWays(boolean showUnlabeledWays)
Specify if unlabeled and untyped map features should be displayed. |
void |
startRegenerate()
Release the lock against rendering OSM data and start a fresh rendering. |
void |
stopRegenerate(int offsetX,
int offsetY)
Stop the current re-rendering of the map and set the pixel offsets for painting the last rendering of the OSM data. |
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, paint, paintBorder, paintChildren, 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 final java.awt.Color DEFAULT_BUILDING_COLOR
public static final float MAX_NODE_ZOOM
setAmenityToShow(org.ka2ddo.yaac.osm.AmenityType)
,
Constant Field Valuespublic static final float MAX_NODE_LABEL_ZOOM
Constructor Detail |
---|
public OSMLayer()
Method Detail |
---|
public void initializePlaceZoomLevels()
public final boolean isShowMap()
public void setShowMap(boolean showMap)
showMap
- boolean true if OpenStreetMap layer should be renderedpublic final boolean isShowLayer(int index)
index
- WayType enumeration ordinal of type being queried
public void setShowLayer(boolean showLayer, int index)
showLayer
- boolean true if ways of the specified WayType should be renderedindex
- WayType enumeration ordinal of type being specifiedpublic boolean isShowHighwaySigns()
public void setShowHighwaySigns(boolean showHighwaySigns)
showHighwaySigns
- boolean true if highways signs should be displayedpublic boolean isShowPOI()
public void setShowPOI(boolean showPOI)
showPOI
- boolean true if points of interest should be rendered on the mappublic boolean isShowUnlabeledWays()
public void setShowUnlabeledWays(boolean showUnlabeledWays)
showUnlabeledWays
- boolean true if unlabeled/untyped map elements should be plottedpublic boolean isAutoLoadOsmTiles()
public void setAutoLoadOsmTiles(boolean autoLoadOsmTiles)
autoLoadOsmTiles
- boolean true if auto-download should be enabledpublic boolean isShowLabelsInEnglish()
public void setShowLabelsInEnglish(boolean showLabelsInEnglish)
showLabelsInEnglish
- boolean true if English labels should be usedpublic AmenityType getAmenityToShow()
public void setAmenityToShow(AmenityType amenityToShow)
amenityToShow
- AmenityType to highlight, or null for no special highlightingpublic java.awt.Color getBuildingColor()
public void setBuildingColor(java.awt.Color buildingColor)
buildingColor
- Color for building fillpublic void regenerateAndRepaint()
public void projectionChanged(ProjectionEvent e)
projectionChanged
in interface ProjectionListener
e
- ProjectionEvent identifying new projectionprotected void paintComponent(java.awt.Graphics g)
paintComponent
in class javax.swing.JComponent
g
- Graphics object to use for paintingpublic void stopRegenerate(int offsetX, int offsetY)
offsetX
- int horizontal pixel offset for painting the last render of the OSM data onto the mapoffsetY
- int vertical pixel offset for painting the last render of the OSM data onto the mappublic void startRegenerate()
public final void run()
run
in interface java.lang.Runnable
public void flushFileCache()
public void componentHidden(java.awt.event.ComponentEvent e)
componentHidden
in interface java.awt.event.ComponentListener
public void componentMoved(java.awt.event.ComponentEvent e)
componentMoved
in interface java.awt.event.ComponentListener
public void componentResized(java.awt.event.ComponentEvent e)
componentResized
in interface java.awt.event.ComponentListener
public void componentShown(java.awt.event.ComponentEvent e)
componentShown
in interface java.awt.event.ComponentListener
public MapMouseListener getMapMouseListener()
getMapMouseListener
in class Layer
public java.lang.String[] getMouseModeServiceList()
getMouseModeServiceList
in interface MapMouseListener
public boolean mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface MapMouseListener
public boolean mousePressed(java.awt.event.MouseEvent mouseEvent)
mousePressed
in interface MapMouseListener
public boolean mouseReleased(java.awt.event.MouseEvent mouseEvent)
mouseReleased
in interface MapMouseListener
public void mouseEntered(java.awt.event.MouseEvent mouseEvent)
mouseEntered
in interface MapMouseListener
public void mouseExited(java.awt.event.MouseEvent mouseEvent)
mouseExited
in interface MapMouseListener
public boolean mouseDragged(java.awt.event.MouseEvent mouseEvent)
mouseDragged
in interface MapMouseListener
public boolean mouseMoved(java.awt.event.MouseEvent mouseEvent)
mouseMoved
in interface MapMouseListener
public void mouseMoved()
mouseMoved
in interface MapMouseListener
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |