Class MapComponent
- All Implemented Interfaces:
Animation, Editable, StyleListener, Iterable<Component>
-
Field Summary
Fields inherited from class Component
BASELINE, BOTTOM, BRB_CENTER_OFFSET, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_OTHER, CENTER, CROSSHAIR_CURSOR, DEFAULT_CURSOR, DRAG_REGION_IMMEDIATELY_DRAG_X, DRAG_REGION_IMMEDIATELY_DRAG_XY, DRAG_REGION_IMMEDIATELY_DRAG_Y, DRAG_REGION_LIKELY_DRAG_X, DRAG_REGION_LIKELY_DRAG_XY, DRAG_REGION_LIKELY_DRAG_Y, DRAG_REGION_NOT_DRAGGABLE, DRAG_REGION_POSSIBLE_DRAG_X, DRAG_REGION_POSSIBLE_DRAG_XY, DRAG_REGION_POSSIBLE_DRAG_Y, E_RESIZE_CURSOR, HAND_CURSOR, LEFT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NW_RESIZE_CURSOR, RIGHT, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, TOP, W_RESIZE_CURSOR, WAIT_CURSOR -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Empty constructor creates a map with OpenStreetMapProvider on the Last known Location of the LocationManagerMapComponent(MapProvider provider) Deprecated.Constructor with a given providerMapComponent(MapProvider provider, Location centerPosition, int zoomLevel) Deprecated.ConstructorMapComponent(MapProvider provider, Location centerPosition, int zoomLevel, boolean cacheEnabled) Deprecated.ConstructorMapComponent(MapProvider provider, Coord centerPosition, int zoomLevel) Deprecated.ConstructorMapComponent(MapProvider provider, Coord centerPosition, int zoomLevel, boolean cacheEnabled) Deprecated.Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidDeprecated.Adds a layer to the mapvoidDeprecated.Adds a layer to the mapvoidaddMapListener(MapListener listener) Deprecated.Adds a listener to map panning/zoomingprotected DimensionDeprecated.Calculates the preferred size based on component content.center()Deprecated.Gets the center of the map.static longdistance(double latitude1, double longitude1, double latitude2, double longitude2) Deprecated.Returns the distance between 2 points in metersprotected voidDeprecated.Callback allowing a developer to track when the component gains focusDeprecated.Gets the center location of the map in WGS84 format.getCoordFromPosition(int x, int y) Deprecated.Gets the Coord location on the map from a x, y position.getLayerAt(int index) Deprecated.Returns Layer at indexintDeprecated.Returns layers countintDeprecated.Returns the max zoom level of the mapintDeprecated.Returns the min zoom level of the mapgetPointFromCoord(Coord coord) Deprecated.Gets the screen coordinates of a specific CoordString[]Deprecated.A component may expose mutable property names for a UI designer to manipulate, this API is designed for usage internally by the GUI builder codeClass[]Deprecated.Matches the property names method (see that method for further details).getPropertyValue(String name) Deprecated.Returns the current value of the property name, this method is used by the GUI builderDeprecated.Gets the map providerintDeprecated.Returns the current zoom level of the map.protected booleanisDownKey(int keyCode) Deprecated.Returns true if this is a down keycodeprotected booleanisLeftKey(int keyCode) Deprecated.Checks if key code is left keycode.protected booleanisRightKey(int keyCode) Deprecated.Returns true if this is a right keycodeprotected booleanisUpKey(int keyCode) Deprecated.Returns true if this is a up keycodeprotected booleanisZoomInKey(int keyCode) Deprecated.Returns true if this is a zoom in keycodeprotected booleanisZoomOutKey(int keyCode) Deprecated.Returns true if this is a zoom out keycodeprotected booleanisZoomToLayersKey(int keyCode) Deprecated.Returns true if this is a zoom to layers keycodevoidkeyPressed(int keyCode) Deprecated.If this Component is focused, the key pressed event will call this methodprotected voidlaidOut()Deprecated.This is a callback method to inform the Component when it's been laidout on the parent ContainervoidmoveDown()Deprecated.move the map 25% downvoidmoveLeft()Deprecated.move the map 25% leftvoidDeprecated.move the map 25% rightvoidmoveUp()Deprecated.move the map 25% upvoidDeprecated.This method paints the Component background, it should be overriden by subclasses to perform custom background drawing.voidpointerDragged(int[] x, int[] y) Deprecated.If this Component is focused, the pointer dragged event will call this methodvoidpointerDragged(int x, int y) Deprecated.If this Component is focused, the pointer dragged event will call this methodvoidpointerPressed(int x, int y) Deprecated.If this Component is focused, the pointer pressed event will call this methodvoidpointerReleased(int x, int y) Deprecated.If this Component is focused, the pointer released event will call this methodprotected voidpointerTapped(int x, int y, int tapCount) Deprecated.voidDeprecated.Removes all layers from the mapvoidremoveLayer(Layer layer) Deprecated.Removes a Layer from the mapvoidremoveMapListener(MapListener listener) Deprecated.Removes the map listener callbackvoidrepaint()Deprecated.Repaint this Component, the repaint call causes a callback of the paint method on the event dispatch thread.setPropertyValue(String name, Object value) Deprecated.Sets a new value to the given property, returns an error message if failed and null if successful.voidsetZoomLevel(int zoom) Deprecated.Sets the current zoom level of the map.protected booleanDeprecated.A component that might need side swipe such as the slider could block it from being used for some other purpose when on top of said component.voidzoomIn()Deprecated.zoom in the map one level if possiblevoidzoomOut()Deprecated.zoom out the map one level if possiblevoidzoomTo(BoundingBox boundingBox) Deprecated.Zoom the map the the giving bounding boxvoidDeprecated.Zoom map to the center of the given coordinate with the given zoom levelvoidDeprecated.zoom map to largest zoom while all Layers are containedMethods inherited from class Container
add, add, add, add, add, add, addAll, addComponent, addComponent, addComponent, addComponent, animateHierarchy, animateHierarchyAndWait, animateHierarchyFade, animateHierarchyFadeAndWait, animateLayout, animateLayoutAndWait, animateLayoutFade, animateLayoutFadeAndWait, animateUnlayout, animateUnlayoutAndWait, applyRTL, cancelRepaints, clearClientProperties, constrainHeightWhenScrollable, constrainWidthWhenScrollable, contains, createAnimateHierarchy, createAnimateHierarchyFade, createAnimateLayout, createAnimateLayoutFade, createAnimateLayoutFadeAndWait, createAnimateMotion, createAnimateUnlayout, createReplaceTransition, dragInitiated, drop, encloseIn, encloseIn, findDropTargetAt, findFirstFocusable, fireClicked, flushReplace, forceRevalidate, getBottomGap, getChildrenAsList, getClosestComponentTo, getComponentAt, getComponentAt, getComponentCount, getComponentIndex, getGridPosX, getGridPosY, getLayout, getLayoutHeight, getLayoutWidth, getLeadComponent, getLeadParent, getResponderAt, getSafeAreaRoot, getScrollIncrement, getSideGap, getUIManager, initLaf, invalidate, isEnabled, isSafeArea, isSafeAreaRoot, isScrollableX, isScrollableY, isSelectableInteraction, isSurface, iterator, iterator, keyReleased, layoutContainer, morph, morphAndWait, paint, paintComponentBackground, paintGlass, paramString, refreshTheme, removeAll, removeComponent, replace, replace, replaceAndWait, replaceAndWait, replaceAndWait, revalidate, revalidateLater, revalidateWithAnimationSafety, scrollComponentToVisible, setCellRenderer, setEnabled, setLayout, setLeadComponent, setSafeArea, setSafeAreaRoot, setScrollable, setScrollableX, setScrollableY, setScrollIncrement, setShouldCalcPreferredSize, setShouldLayout, setUIManager, updateTabIndicesMethods inherited from class Component
addDragFinishedListener, addDragOverListener, addDropListener, addFocusListener, addLongPressListener, addPointerDraggedListener, addPointerPressedListener, addPointerReleasedListener, addPullToRefresh, addScrollListener, addStateChangeListener, animate, announceForAccessibility, bindProperty, blocksSideSwipe, calcScrollSize, contains, containsOrOwns, createStyleAnimation, deinitialize, deinitializeCustomStyle, dragEnter, dragExit, dragFinished, draggingOver, drawDraggedImage, focusLost, getAbsoluteX, getAbsoluteY, getAccessibilityText, getAllStyles, getAnimationManager, getBaseline, getBaselineResizeBehavior, getBindablePropertyNames, getBindablePropertyTypes, getBorder, getBoundPropertyValue, getBounds, getBounds, getClientProperty, getCloudBoundProperty, getCloudDestinationProperty, getComponentForm, getComponentState, getCursor, getDefaultDragTransparency, getDirtyRegion, getDisabledStyle, getDraggedx, getDraggedy, getDragImage, getDragRegionStatus, getDragSpeed, getDragTransparency, getEditingDelegate, getHeight, getInlineAllStyles, getInlineDisabledStyles, getInlinePressedStyles, getInlineSelectedStyles, getInlineStylesTheme, getInlineUnselectedStyles, getInnerHeight, getInnerPreferredH, getInnerPreferredW, getInnerWidth, getInnerX, getInnerY, getLabelForComponent, getName, getNativeOverlay, getNextFocusDown, getNextFocusLeft, getNextFocusRight, getNextFocusUp, getOuterHeight, getOuterPreferredH, getOuterPreferredW, getOuterWidth, getOuterX, getOuterY, getOwner, getParent, getPreferredH, getPreferredSize, getPreferredSizeStr, getPreferredTabIndex, getPreferredW, getPressedStyle, getPropertyTypeNames, getSameHeight, getSameWidth, getScrollable, getScrollAnimationSpeed, getScrollDimension, getScrollOpacity, getScrollOpacityChangeSpeed, getScrollX, getScrollY, getSelectCommandText, getSelectedRect, getSelectedStyle, getStyle, getTabIndex, getTensileLength, getTextSelectionSupport, getTooltip, getUIID, getUnselectedStyle, getVisibleBounds, getVisibleBounds, getWidth, getX, getY, growShrink, handlesInput, hasFixedPreferredSize, hasFocus, hideNativeOverlay, initComponent, initCustomStyle, initDisabledStyle, initPressedStyle, initSelectedStyle, initUnselectedStyle, installDefaultPainter, isAlwaysTensile, isBlockLead, isCellRenderer, isChildOf, isDragActivated, isDragAndDropOperation, isDraggable, isDragRegion, isDropTarget, isEditable, isEditing, isFlatten, isFocusable, isGrabsPointerEvents, isHidden, isHidden, isHideInLandscape, isHideInPortrait, isHScrollThumbGrabbed, isHScrollThumbHover, isIgnorePointerEvents, isInClippingRegion, isInitialized, isOpaque, isOwnedBy, isPinchBlocksDragAndDrop, isRippleEffect, isRTL, isScrollable, isScrollVisible, isSetCursorSupported, isSmoothScrolling, isSnapToGrid, isStickyDrag, isTactileTouch, isTactileTouch, isTensileDragEnabled, isTraversable, isVisible, isVScrollThumbGrabbed, isVScrollThumbHover, keyRepeated, longKeyPress, longPointerPress, onScrollX, onScrollY, onSetFocusable, paintBackgrounds, paintBorder, paintBorderBackground, paintComponent, paintComponent, paintIntersectingComponentsAbove, paintLock, paintLockRelease, paintRippleOverlay, paintScrollbars, paintScrollbarX, paintScrollbarY, paintShadows, parsePreferredSize, pinch, pinch, pinchReleased, pointerHover, pointerHoverPressed, pointerHoverReleased, pointerPressed, pointerReleased, putClientProperty, refreshTheme, refreshTheme, remove, removeDragFinishedListener, removeDragOverListener, removeDropListener, removeFocusListener, removeLongPressListener, removePointerDraggedListener, removePointerPressedListener, removePointerReleasedListener, removeScrollListener, removeStateChangeListener, repaint, requestFocus, resetFocusable, respondsToPointerEvents, scrollRectToVisible, scrollRectToVisible, setAccessibilityText, setAlwaysTensile, setBlockLead, setBoundPropertyValue, setCloudBoundProperty, setCloudDestinationProperty, setComponentState, setCursor, setDefaultDragTransparency, setDirtyRegion, setDisabledStyle, setDraggable, setDragTransparency, setDropTarget, setEditingDelegate, setFlatten, setFocus, setFocusable, setGrabsPointerEvents, setHandlesInput, setHeight, setHidden, setHidden, setHideInLandscape, setHideInPortrait, setHorizontalScrollBounds, setIgnorePointerEvents, setInitialized, setInlineAllStyles, setInlineDisabledStyles, setInlinePressedStyles, setInlineSelectedStyles, setInlineStylesTheme, setInlineUnselectedStyles, setIsScrollVisible, setLabelForComponent, setName, setNextFocusDown, setNextFocusLeft, setNextFocusRight, setNextFocusUp, setOpaque, setOwner, setPinchBlocksDragAndDrop, setPreferredH, setPreferredSize, setPreferredSizeStr, setPreferredTabIndex, setPreferredW, setPressedStyle, setPullToRefresh, setRippleEffect, setRTL, setSameHeight, setSameSize, setSameWidth, setScrollAnimationSpeed, setScrollOpacityChangeSpeed, setScrollSize, setScrollVisible, setScrollX, setScrollY, setSelectCommandText, setSelectedStyle, setSize, setSmoothScrolling, setSnapToGrid, setTabIndex, setTactileTouch, setTensileDragEnabled, setTensileLength, setTooltip, setTraversable, setUIID, setUIID, setUIIDFinal, setUnselectedStyle, setVerticalScrollBounds, setVisible, setWidth, setX, setY, shouldBlockSideSwipeLeft, shouldBlockSideSwipeRight, shouldRenderComponentSelection, showNativeOverlay, startEditingAsync, stopEditing, stripMarginAndPadding, styleChanged, toImage, toString, unbindProperty, updateNativeOverlay, visibleBoundsContains
-
Constructor Details
-
MapComponent
public MapComponent()Deprecated.Empty constructor creates a map with OpenStreetMapProvider on the Last known Location of the LocationManager -
MapComponent
Deprecated.Constructor with a given provider
Parameters
provider: map provider
-
MapComponent
Deprecated.Constructor
Parameters
-
provider: map provider -
centerPosition: center position -
zoomLevel: zoom level
-
-
MapComponent
public MapComponent(MapProvider provider, Location centerPosition, int zoomLevel, boolean cacheEnabled) Deprecated.Constructor
Parameters
-
provider: map provider -
centerPosition: center position -
zoomLevel: zoom level -
cacheEnabled: is cache enabled
-
-
MapComponent
Deprecated.Constructor
Parameters
-
provider: map provider -
centerPosition: center position -
zoomLevel: zoom level
-
-
MapComponent
public MapComponent(MapProvider provider, Coord centerPosition, int zoomLevel, boolean cacheEnabled) Deprecated.Constructor
Parameters
-
provider: map provider -
centerPosition: center position -
zoomLevel: zoom level -
cacheEnabled: is cache enabled
-
-
-
Method Details
-
distance
public static long distance(double latitude1, double longitude1, double latitude2, double longitude2) Deprecated.Returns the distance between 2 points in meters
Parameters
-
latitude1 -
longitude1 -
latitude2 -
longitude2
Returns
distance in meters
-
-
paintBackground
Deprecated.This method paints the Component background, it should be overriden by subclasses to perform custom background drawing.
Parameters
g: the component graphics
- Overrides:
paintBackgroundin classComponent
-
laidOut
-
shouldBlockSideSwipe
protected boolean shouldBlockSideSwipe()Deprecated.A component that might need side swipe such as the slider could block it from being used for some other purpose when on top of said component.- Overrides:
shouldBlockSideSwipein classComponent
-
calcPreferredSize
Deprecated.Calculates the preferred size based on component content. This method is invoked lazily by getPreferred size.
Returns
the calculated preferred size based on component content
- Overrides:
calcPreferredSizein classContainer
-
focusGained
protected void focusGained()Deprecated.Callback allowing a developer to track when the component gains focus- Overrides:
focusGainedin classComponent
-
pointerDragged
public void pointerDragged(int x, int y) Deprecated.If this Component is focused, the pointer dragged event will call this method
Parameters
-
x: the pointer x coordinate -
y: the pointer y coordinate
- Overrides:
pointerDraggedin classComponent
-
-
pointerPressed
public void pointerPressed(int x, int y) Deprecated.If this Component is focused, the pointer pressed event will call this method
Parameters
-
x: the pointer x coordinate -
y: the pointer y coordinate
- Overrides:
pointerPressedin classContainer
-
-
pointerDragged
public void pointerDragged(int[] x, int[] y) Deprecated.If this Component is focused, the pointer dragged event will call this method
Parameters
-
x: the pointer x coordinate -
y: the pointer y coordinate
- Overrides:
pointerDraggedin classComponent
-
-
pointerTapped
protected void pointerTapped(int x, int y, int tapCount) Deprecated. -
pointerReleased
public void pointerReleased(int x, int y) Deprecated.If this Component is focused, the pointer released event will call this method
Parameters
-
x: the pointer x coordinate -
y: the pointer y coordinate
- Overrides:
pointerReleasedin classComponent
-
-
getCoordFromPosition
Deprecated.Gets the Coord location on the map from a x, y position.
Parameters
-
x: X-coordinate -
y: Y-coordinate
Returns
a Coord Object.
-
-
getPointFromCoord
-
keyPressed
public void keyPressed(int keyCode) Deprecated.If this Component is focused, the key pressed event will call this method
Parameters
keyCode: the key code value to indicate a physical key.
- Overrides:
keyPressedin classContainer
-
addLayer
-
addLayer
Deprecated.Adds a layer to the map
Parameters
-
layer: to add -
minZoomLevel: min zoom level of this Layer -
maxZoomLevel: max zoom level of this Layer
-
-
removeLayer
Deprecated.Removes a Layer from the map
Parameters
layer: to remove
-
removeAllLayers
public void removeAllLayers()Deprecated.Removes all layers from the map -
getLayersConut
public int getLayersConut()Deprecated.Returns layers count
Returns
The number of layers.
-
getLayerAt
Deprecated.Returns Layer at index
Parameters
index: the index of the layer
Returns
The layer at the given index.
Throws
ArrayIndexOutOfBoundsException: @throws ArrayIndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size())
-
getProvider
-
repaint
-
moveLeft
public void moveLeft()Deprecated.move the map 25% left -
moveRight
public void moveRight()Deprecated.move the map 25% right -
moveUp
public void moveUp()Deprecated.move the map 25% up -
moveDown
public void moveDown()Deprecated.move the map 25% down -
zoomIn
public void zoomIn()Deprecated.zoom in the map one level if possible -
zoomOut
public void zoomOut()Deprecated.zoom out the map one level if possible -
zoomTo
Deprecated.Zoom the map the the giving bounding box
Parameters
boundingBox: to zoom to
Throws
IllegalArgumentException: if the boundingBox is not wg84 format
-
zoomTo
Deprecated.Zoom map to the center of the given coordinate with the given zoom level
Parameters
-
coord: @param coord center map to this coordinate, coord should be in wg84 format -
zoomLevel: zoom map to this level;
Throws
IllegalArgumentException: if the coord is not wg84 format
-
-
zoomToLayers
public void zoomToLayers()Deprecated.zoom map to largest zoom while all Layers are contained -
getCenter
Deprecated.Gets the center location of the map in WGS84 format.
Returns
Coordinate of center location of map.
-
getZoomLevel
public int getZoomLevel()Deprecated.Returns the current zoom level of the map.
Returns
zoom level
-
setZoomLevel
public void setZoomLevel(int zoom) Deprecated.Sets the current zoom level of the map.
Parameters
zoom: Zoom level
-
getMaxZoomLevel
public int getMaxZoomLevel()Deprecated.Returns the max zoom level of the map
Returns
max zoom level
-
getMinZoomLevel
public int getMinZoomLevel()Deprecated.Returns the min zoom level of the map
Returns
min zoom level
-
center
-
isLeftKey
protected boolean isLeftKey(int keyCode) Deprecated.Checks if key code is left keycode.
Parameters
keyCode: The key-code to check.
Returns
true if this is a left keycode
-
isRightKey
protected boolean isRightKey(int keyCode) Deprecated.Returns true if this is a right keycode
Parameters
keyCode: The key code to check
Returns
true if this is a right keycode.
-
isDownKey
protected boolean isDownKey(int keyCode) Deprecated.Returns true if this is a down keycode
Parameters
keyCode: The key code to check.
Returns
True if key code is down key.
-
isUpKey
protected boolean isUpKey(int keyCode) Deprecated.Returns true if this is a up keycode
Parameters
keyCode: The key code to check.
Returns
true if key code is up key.
-
isZoomInKey
protected boolean isZoomInKey(int keyCode) Deprecated.Returns true if this is a zoom in keycode
Parameters
keyCode: The key code to check
Returns
true if key code is zoom-in key.
-
isZoomOutKey
protected boolean isZoomOutKey(int keyCode) Deprecated.Returns true if this is a zoom out keycode
Parameters
keyCode: The key code to check.
Returns
true if the key code for the zoom-out key.
-
isZoomToLayersKey
protected boolean isZoomToLayersKey(int keyCode) Deprecated.Returns true if this is a zoom to layers keycode
Parameters
keyCode: The key-code to check.
Returns
true if the key code is for the zoom to layers key.
-
addMapListener
Deprecated.Adds a listener to map panning/zooming
Parameters
listener: the listener callback
-
removeMapListener
Deprecated.Removes the map listener callback
Parameters
listener: the listener
-
getPropertyNames
Deprecated.A component may expose mutable property names for a UI designer to manipulate, this API is designed for usage internally by the GUI builder code
Returns
the property names allowing mutation
- Overrides:
getPropertyNamesin classComponent
-
getPropertyTypes
Deprecated.Matches the property names method (see that method for further details).
Returns
the types of the properties
- Overrides:
getPropertyTypesin classComponent
-
getPropertyValue
Deprecated.Returns the current value of the property name, this method is used by the GUI builder
Parameters
name: the name of the property
Returns
the value of said property
- Overrides:
getPropertyValuein classComponent
-
setPropertyValue
Deprecated.Sets a new value to the given property, returns an error message if failed and null if successful. Notice that some builtin properties such as "$designMode" might be sent to components to indicate application state.
Parameters
-
name: the name of the property -
value: new value for the property
Returns
error message or null
- Overrides:
setPropertyValuein classComponent
-
-