Package com.luciad.view.map
Class TLcdMapCanvas
java.lang.Object
java.awt.Component
java.awt.Canvas
com.luciad.view.gxy.TLcdGXYViewCanvas
com.luciad.view.map.TLcdMapCanvas
- All Implemented Interfaces:
ILcdAWTEventSource,ILcdModelProducerListener,ILcdPropertyChangeSource,ILcdRotationCapable,ILcdStatusSource,ILcdGXYView,ILcdGXYViewXYWorldTransformationProvider,ILcdRotationCapableGXYView,ILcdLayered,ILcdTreeLayered,ILcdView,ImageObserver,MenuContainer,Serializable,EventListener,Accessible
TLcdGXYViewCanvas extension suited for displaying maps.
It adds the following extra behavior:
- a grid layer (a longitude/latitude grid by default) that can be
enabled or disabledand/orreplaced. - a WGS 84 based grid reference with an equidistant cylindrical projection and a default scale that fits the entire world
- a redefined
setXYWorldReferencemethod that keeps the map centered on the same model point. This behavior is enabled by default but can bedeactivatedif needed. - a controller to pan and zoom
- sensible default minimum and maximum scale values so you can't zoom in or out too far
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.awt.Canvas
Canvas.AccessibleAWTCanvasNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface com.luciad.view.gxy.ILcdGXYView
CENTER, LOWERLEFT, LOWERRIGHT, UPPERLEFT, UPPERRIGHTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newTLcdGXYViewCanvas-basedILcdGXYViewwith a longitude/latitude grid and aTLcdGridReferencethat has an instance ofTLcdEquidistantCylindricalasILcdProjection.TLcdMapCanvas(boolean aRegisterInstance) Deprecated.Use the default constructor.TLcdMapCanvas(ILcdTreeLayeredSupport aTreeLayeredSupport) Constructs a newTLcdGXYViewCanvas-basedILcdGXYViewwith a longitude/latitude grid and aTLcdGridReferencethat has an instance ofTLcdEquidistantCylindricalasILcdProjection. -
Method Summary
Modifier and TypeMethodDescriptionReturns the grid layer that was configured usingsetGridLayer(com.luciad.view.gxy.ILcdGXYLayer), if any.booleanbooleanDeprecated.This method has been deprecated.booleanReturns whether or not the map includes a configured grid layer.voidsetAutoAdjustOnSetXYWorldReference(boolean aBoolean) voidsetGridLayer(ILcdGXYLayer aGridLayer) Configures the given layer as the grid layer of this map.voidsetTraceOn(boolean aTraceOn) Deprecated.This method has been deprecated.voidsetWithGridLayer(boolean aWithGridLayer) Enables or disables the configured grid layer.voidsetXYWorldReference(ILcdXYWorldReference aXYWorldReference) Sets the property of XYWorldReference to aXYWorldReference.Methods inherited from class com.luciad.view.gxy.TLcdGXYViewCanvas
addAWTEventListener, addGXYLayer, addGXYLayer, addLayeredListener, addLayerSelectionListener, addModel, addModelListener, addNotify, addPropertyChangeListener, addStatusListener, addViewInvalidationListener, asGXYView, containsLayer, getBackground, getCornerIcon, getDefaultPen, getDisplayName, getGXYController, getGXYLayerFactory, getGXYViewLabelPainter, getGXYViewLabelPlacer, getGXYViewXYWorldTransformation, getHeight, getImage, getLayer, getMaximumSize, getMaxScale, getMinimumSize, getMinScale, getNumberOfCachedBackgroundLayers, getPaintExceptionHandler, getPaintingMode, getPreferredSize, getRootNode, getRotation, getScale, getViewOrigin, getWidth, getWorldOrigin, getXYWorldReference, hasValidImage, indexOf, invalidate, invalidateAndWait, invalidateGXYLayer, invalidateGXYLayerAndWait, invalidateRegion, invalidateRegionAndWait, invalidateRegionSelection, invalidateRegionSelectionAndWait, invalidateSelection, invalidateSelectionAndWait, invokeLater, isAntiAliased, isAsynchronousAllowed, isAutoUpdate, isDoubleBuffered, isDrawOffScreenImageOnPaint, isPaintInBackground, isSmartPan, isUpdateLabelsOnSelectionChanged, isWaitCursorOn, layerCount, layerOf, layers, layersBackwards, modelProduced, moveLayerAt, paint, paintGXYView, pan, print, processEvent, putCornerIcon, registerInstance, removeAllLayers, removeAWTEventListener, removeLayer, removeLayeredListener, removeLayerSelectionListener, removeModel, removeModelListener, removePropertyChangeListener, removeStatusListener, removeViewInvalidationListener, setAntiAliased, setAsynchronousAllowed, setAutoUpdate, setBackground, setClassTraceOn, setDefaultPen, setDisplayName, setDrawOffScreenImageOnPaint, setGXYController, setGXYLayerFactory, setGXYViewLabelPainter, setGXYViewLabelPlacer, setMaximumSize, setMaxScale, setMinimumSize, setMinScale, setNumberOfCachedBackgroundLayers, setPaintExceptionHandler, setPaintInBackground, setPaintingMode, setPreferredSize, setRotation, setRotation, setRotation, setScale, setScale, setScale, setScale, setSmartPan, setUpdateLabelsOnSelectionChanged, setViewOrigin, setViewOrigin, setViewOrigin, setWaitCursorOn, setWorldOrigin, setWorldOrigin, setWorldOrigin, setXYWorldReference, setXYWorldReference, updateMethods inherited from class java.awt.Canvas
createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategyMethods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, revalidate, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.luciad.view.gxy.ILcdGXYView
getForeground, getGraphics, getLayers, getMapScale, getMapScaleRange, repaint, repaint, setCursor, setForeground, setMapScale, setMapScaleRangeMethods inherited from interface com.luciad.view.ILcdLayered
addLayeredListener, removeLayeredListener
-
Constructor Details
-
TLcdMapCanvas
public TLcdMapCanvas()Constructs a newTLcdGXYViewCanvas-basedILcdGXYViewwith a longitude/latitude grid and aTLcdGridReferencethat has an instance ofTLcdEquidistantCylindricalasILcdProjection. The scale is set to make the earth fit in thisILcdGXYView. -
TLcdMapCanvas
public TLcdMapCanvas(boolean aRegisterInstance) Deprecated.Use the default constructor.Constructs a newTLcdGXYViewCanvas-basedILcdGXYView.- Parameters:
aRegisterInstance- if true, registers the view withTLcdBeanManager- See Also:
-
TLcdMapCanvas
Constructs a newTLcdGXYViewCanvas-basedILcdGXYViewwith a longitude/latitude grid and aTLcdGridReferencethat has an instance ofTLcdEquidistantCylindricalasILcdProjection. The scale is set to make the earth fit in thisILcdGXYView.- Parameters:
aTreeLayeredSupport- an instance ofILcdTreeLayeredSupportused to store the layers
-
-
Method Details
-
setTraceOn
public void setTraceOn(boolean aTraceOn) Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Enables tracing for this class instance. Calling this method with eithertrueorfalseas argument automatically turns off tracing for all other class instances for whichsetTraceOnhas not been called. If the argument isfalsethen only the informative, warning and error log messages are recorded.- Overrides:
setTraceOnin classTLcdGXYViewCanvas- Parameters:
aTraceOn- if true then all log messages are recorded for this instance. If false, then only the informative, warning and error log messages are recorded.
-
isTraceOn
public boolean isTraceOn()Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Returnstrueif tracing is enabled for this class.- Overrides:
isTraceOnin classTLcdGXYViewCanvas- Returns:
- true if tracing is enabled for this class, false otherwise.
-
getGridLayer
Returns the grid layer that was configured usingsetGridLayer(com.luciad.view.gxy.ILcdGXYLayer), if any.- Returns:
- the grid layer of this map, or
nullif no grid layer was configured
-
setGridLayer
Configures the given layer as the grid layer of this map. The previously configured grid layer (if any) is removed and the layer is added to the top of the view, or to the position of the previously configured grid layer.- Parameters:
aGridLayer- the new layer to configure as grid layer
-
isWithGridLayer
public boolean isWithGridLayer()Returns whether or not the map includes a configured grid layer.- Returns:
trueif the map has a configured and enabled grid layer,falseotherwise.- See Also:
-
setWithGridLayer
public void setWithGridLayer(boolean aWithGridLayer) Enables or disables the configured grid layer. Iftrue, a grid layer is created (if needed) and added to the view. Iffalse, the configured grid layer (if any) is removed from the view.- Parameters:
aWithGridLayer-trueif the map has a configured grid layer,falseotherwise.- See Also:
-
setAutoAdjustOnSetXYWorldReference
public void setAutoAdjustOnSetXYWorldReference(boolean aBoolean) - Parameters:
aBoolean- if true the setXYWorldReference method will be redefined in order to keep thisILcdGXYViewstill centered on the same model point, when setting a newILcdProjection. If false the setXYWorldReference will call super.setXYWorldReference.
-
isAutoAdjustOnSetXYWorldReference
public boolean isAutoAdjustOnSetXYWorldReference()- See Also:
-
setXYWorldReference
Sets the property of XYWorldReference to aXYWorldReference. If isAutoAdjustOnSetXYWorldReference returns true, it tries to adapt the properties viewOrigin and worldOrigin to the newILcdXYWorldReferencesuch that the view is still centered on the same model point.- Specified by:
setXYWorldReferencein interfaceILcdGXYView- Overrides:
setXYWorldReferencein classTLcdGXYViewCanvas- Parameters:
aXYWorldReference- the newILcdXYWorldReferenceassociated to this view- See Also:
-