Package com.luciad.view.map
Class TLcdMapBufferedImage
java.lang.Object
com.luciad.view.gxy.TLcdGXYViewBufferedImage
com.luciad.view.map.TLcdMapBufferedImage
- All Implemented Interfaces:
ILcdModelProducerListener,ILcdPropertyChangeSource,ILcdRotationCapable,ILcdStatusSource,ILcdGXYView,ILcdGXYViewXYWorldTransformationProvider,ILcdRotationCapableGXYView,ILcdLayered,ILcdTreeLayered,ILcdView,Serializable,EventListener
TLcdGXYViewBufferedImage 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.
- See Also:
-
Field Summary
Fields inherited from interface com.luciad.view.gxy.ILcdGXYView
CENTER, LOWERLEFT, LOWERRIGHT, UPPERLEFT, UPPERRIGHT -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new, emptyBufferedImagebasedILcdGXYView.TLcdMapBufferedImage(boolean aRegisterInstance) Deprecated.This class does not support bean registering.TLcdMapBufferedImage(int aBufferedImageType) Constructs a new, emptyBufferedImagebasedILcdGXYViewof the given image type.TLcdMapBufferedImage(int aBufferedImageType, ILcdTreeLayeredSupport aTreeLayeredSupport) Constructs a new, emptyBufferedImagebasedILcdGXYViewof the given image type.TLcdMapBufferedImage(int aBufferedImageType, IndexColorModel aIndexColorModel) Constructs a new, emptyBufferedImagebasedILcdGXYViewof the given image type, with a givenIndexColorModel.TLcdMapBufferedImage(int aBufferedImageType, IndexColorModel aIndexColorModel, ILcdTreeLayeredSupport aTreeLayeredSupport) Constructs a new, emptyBufferedImagebasedILcdGXYViewof the given image type, with a givenIndexColorModel. -
Method Summary
Modifier and TypeMethodDescriptionReturns the grid layer that was configured usingsetGridLayer(com.luciad.view.gxy.ILcdGXYLayer), if any.booleanbooleanReturns 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.voidsetWithGridLayer(boolean aWithGridLayer) Enables or disables the configured grid layer.voidsetXYWorldReference(ILcdXYWorldReference aXYWorldReference) Sets the property of XYWorlReference to aXYWorldReference.Methods inherited from class com.luciad.view.gxy.TLcdGXYViewBufferedImage
addGXYLayer, addGXYLayer, addLayeredListener, addLayerSelectionListener, addModel, addModelListener, addPropertyChangeListener, addStatusListener, addViewInvalidationListener, asGXYView, containsLayer, getBackground, getCornerIcon, getDefaultPen, getDisplayName, getForeground, getGraphics, getGXYController, getGXYLayerFactory, getGXYViewLabelPainter, getGXYViewLabelPlacer, getGXYViewXYWorldTransformation, getHeight, getImage, getLayer, getMaximumSize, getMaxScale, getMinimumSize, getMinScale, getName, getNumberOfCachedBackgroundLayers, getPaintExceptionHandler, getPaintExecutorService, getPaintingMode, getPreferredSize, getRootNode, getRotation, getScale, getScaleX, getScaleY, getViewOrigin, getWidth, getWorldOrigin, getXYWorldReference, hasValidImage, indexOf, invalidate, invalidateAndWait, invalidateGXYLayer, invalidateGXYLayerAndWait, invalidateRegion, invalidateRegionAndWait, invalidateRegionSelection, invalidateRegionSelectionAndWait, invalidateSelection, invalidateSelectionAndWait, isAntiAliased, isAsynchronousAllowed, isAutoUpdate, isCopyrightNoticeEnabled, isDoubleBuffered, isDrawOffScreenImageOnPaint, isPaintInBackground, isTraceOn, isUpdateLabelsOnSelectionChanged, isWaitCursorOn, layerCount, layerOf, layers, layersBackwards, modelProduced, moveLayerAt, paint, paintGXYView, pan, print, putCornerIcon, removeAllLayers, removeLayer, removeLayeredListener, removeLayerSelectionListener, removeModel, removeModelListener, removePropertyChangeListener, removeStatusListener, removeViewInvalidationListener, repaint, repaint, setAntiAliased, setAsynchronousAllowed, setAutoUpdate, setBackground, setClassTraceOn, setCopyrightNoticeEnabled, setCursor, setDefaultPen, setDisplayName, setDrawOffScreenImageOnPaint, setForeground, setGXYController, setGXYLayerFactory, setGXYViewLabelPainter, setGXYViewLabelPlacer, setHeight, setMaximumSize, setMaxScale, setMinimumSize, setMinScale, setName, setNumberOfCachedBackgroundLayers, setPaintExceptionHandler, setPaintExecutorService, setPaintInBackground, setPaintingMode, setPreferredSize, setRotation, setRotation, setRotation, setScale, setScale, setScale, setScale, setTraceOn, setUpdateLabelsOnSelectionChanged, setViewOrigin, setViewOrigin, setViewOrigin, setWaitCursorOn, setWidth, setWorldOrigin, setWorldOrigin, setWorldOrigin, setXYWorldReference, setXYWorldReference, updateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.luciad.view.gxy.ILcdGXYView
getLayers, getMapScale, getMapScaleRange, setMapScale, setMapScaleRangeMethods inherited from interface com.luciad.view.ILcdLayered
addLayeredListener, removeLayeredListener
-
Constructor Details
-
TLcdMapBufferedImage
public TLcdMapBufferedImage()Constructs a new, emptyBufferedImagebasedILcdGXYView. The internal image is of typeBufferedImage.TYPE_INT_RGB. Auto-update is activated by default, no background layers are cached, and no default user interaction is provided.The map has a
TLcdGridReferenceasILcdXYWorldReference, with an instance ofTLcdEquidistantCylindricalasILcdProjection,- See Also:
-
TLcdMapBufferedImage
public TLcdMapBufferedImage(int aBufferedImageType) Constructs a new, emptyBufferedImagebasedILcdGXYViewof the given image type. Auto-update is activated by default, no background layers are cached, and no default user interaction is provided.The map has a
TLcdGridReferenceasILcdXYWorldReference, with an instance ofTLcdEquidistantCylindricalasILcdProjection,- Parameters:
aBufferedImageType- the type of theBufferedImage.- See Also:
-
TLcdMapBufferedImage
Constructs a new, emptyBufferedImagebasedILcdGXYViewof the given image type. Auto-update is activated by default, no background layers are cached, and no default user interaction is provided.The map has a
TLcdGridReferenceasILcdXYWorldReference, with an instance ofTLcdEquidistantCylindricalasILcdProjection,- Parameters:
aBufferedImageType- the type of theBufferedImage.aTreeLayeredSupport- an instance ofILcdTreeLayeredSupportused to store the layers- See Also:
-
TLcdMapBufferedImage
Constructs a new, emptyBufferedImagebasedILcdGXYViewof the given image type, with a givenIndexColorModel. All colors that are used when painting on this view are approximated by colors from the given color model. Auto-update is activated by default, no background layers are cached, and no default user interaction is provided.The map has a
TLcdGridReferenceasILcdXYWorldReference, with an instance ofTLcdEquidistantCylindricalasILcdProjection,- Parameters:
aBufferedImageType- the type of theBufferedImageaIndexColorModel- the index color model- See Also:
-
TLcdMapBufferedImage
public TLcdMapBufferedImage(int aBufferedImageType, IndexColorModel aIndexColorModel, ILcdTreeLayeredSupport aTreeLayeredSupport) Constructs a new, emptyBufferedImagebasedILcdGXYViewof the given image type, with a givenIndexColorModel. All colors that are used when painting on this view are approximated by colors from the given color model. Auto-update is activated by default, no background layers are cached, and no default user interaction is provided.The map has a
TLcdGridReferenceasILcdXYWorldReference, with an instance ofTLcdEquidistantCylindricalasILcdProjection,- Parameters:
aBufferedImageType- the type of theBufferedImageaIndexColorModel- the index color modelaTreeLayeredSupport- an instance ofILcdTreeLayeredSupportused to store the layers- See Also:
-
TLcdMapBufferedImage
public TLcdMapBufferedImage(boolean aRegisterInstance) Deprecated.This class does not support bean registering. Use the default constructor instead.
-
-
Method Details
-
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 XYWorlReference 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 classTLcdGXYViewBufferedImage- Parameters:
aXYWorldReference- the newILcdXYWorldReferenceassociated to this view- See Also:
-