Class TLcdHypsometricEarthPainter
- All Implemented Interfaces:
ILcdCloneable
,ILcdPropertyChangeSource
,ILcdStatusSource
,ILcdGXYPainter
,ILcdGXYPainterProvider
,Serializable
,Cloneable
- Since:
- 2013.1
- See Also:
-
Field Summary
Fields inherited from class com.luciad.view.gxy.ALcdGXYPainter
defaultCreationFillStyle, defaultCreationLineStyle, defaultFillStyle, defaultLineStyle, fWorkBounds
Fields inherited from interface com.luciad.view.gxy.ILcdGXYPainter
BODY, CREATING, DEFAULT, HANDLES, RESHAPING, SELECTED, SNAPS, TRANSLATING
-
Constructor Summary
ConstructorDescriptionTLcdHypsometricEarthPainter
(ILcdHypsometricTileFactory aTileFactory, ILcdHypsometricValueProvider aHypsometricValueProvider, int aUnknownValue) Creates a new hypsometric earth painter with the given hypsometric tile factory.TLcdHypsometricEarthPainter
(TLcdHypsometricTileFactory aTileFactory) Creates a new hypsometric earth painter with the given hypsometric tile factory. -
Method Summary
Modifier and TypeMethodDescriptionprotected TLcdEarthTileFormat
chooseTileFormat
(ILcdEarthTileSet aTileSet, ILcdEarthTileSetCoverage aCoverage) Chooses a tile format from the given tile set and coverage to be used for producing tiles.protected ILcdEarthTileSet
configureBaseTileSet
(Object aObject, ILcdEarthTileSet aTileSet) Configures the base tile set.protected ILcdTile
createRasterTile
(ALcdEarthTile aTile) Creates anILcdTile
corresponding to the specifiedALcdEarthTile
.protected ILcdTile
Returns a representative empty tile for this painter.Returns the hypsometric value providerGets the tile factory set on this hypsometric earth painter.int
Returns the unknown value that is used when no result could be determined for the input data.protected boolean
isValidCoverage
(ILcdEarthTileSetCoverage aCoverage) Returns whether the given coverage can be drawn by this painter.void
paint
(Graphics aGraphics, int aMode, ILcdGXYContext aContext) Displays the representation of the object in the given mode on the Graphics passed, taking into account the supplied context.double
retrieveCachedHypsometricValue
(ILcdPoint aPoint, ILcdEarthTileSet aTileset) Retrieves a cached hypsometric value from this painter for a given point in model coordinates.void
setHypsometricValueProvider
(ILcdHypsometricValueProvider aHypsometricValueProvider) Sets the hypsometric value providervoid
setTileFactory
(ILcdHypsometricTileFactory aTileFactory) Sets the tile factory set on this hypsometric earth painter.void
setUnknownValue
(int aUnknownValue) Sets the unknown value when no result could be determined for the input data.Methods inherited from class com.luciad.earth.view.gxy.TLcdEarthGXYRasterPainter
addStatusListener, chooseTileSetCoverage, chooseTileSetLevel, clearCache, clearCache, clone, createAsynchronousTileSet, getBoundsFillStyle, getBoundsLineStyle, getBrightness, getCacheSize, getColorModel, getContrast, getDisplayName, getOversamplingRate, getPaintCache, getPixelDensity, getQuality, getRequestFormat, getRGBImageFilter, getStartResolutionFactor, getTileContext, getTileSet, getTransparency, getUpdateInterval, getWarpBlockSize, isAllowOutdatedTiles, isAutoIncreaseCacheSize, isPaintBoundsFill, isPaintBoundsOutline, isParentTileRequestAllowed, isSoftCachingEnabled, releaseHardReferencedCache, releaseHardReferencedCache, removeStatusListener, setAllowOutdatedTiles, setAsynchronousTileRequestAllowed, setAutoIncreaseCacheSize, setBoundsFillStyle, setBoundsLineStyle, setBrightness, setCacheSize, setColorModel, setContrast, setExceptionHandler, setObject, setOversamplingRate, setPaintBoundsFill, setPaintBoundsOutline, setPaintCache, setParentTileRequestAllowed, setQuality, setRepaintViewWhenTileAvailable, setRGBImageFilter, setSoftCachingEnabled, setStartResolutionFactor, setTransparency, setUpdateInterval, setWarpBlockSize, updateTiles, updateTiles
Methods inherited from class com.luciad.earth.view.gxy.ALcdEarthGXYPainter
boundsSFCT, getExceptionHandler, getObject, getTileSet, getTileSetCoverage, isAsynchronousTileRequestAllowed, isRepaintViewWhenTileAvailable, isTouched
Methods inherited from class com.luciad.view.gxy.ALcdGXYPainter
addPropertyChangeListener, anchorPointSFCT, firePropertyChangeEvent, firePropertyChangeEvent, getCursor, getGXYPainter, isTraceOn, removePropertyChangeListener, setClassTraceOn, setDisplayName, setTraceOn, snapTarget, supportSnap
-
Constructor Details
-
TLcdHypsometricEarthPainter
public TLcdHypsometricEarthPainter(ILcdHypsometricTileFactory aTileFactory, ILcdHypsometricValueProvider aHypsometricValueProvider, int aUnknownValue) Creates a new hypsometric earth painter with the given hypsometric tile factory.- Parameters:
aTileFactory
- the hypsometric tile factory to use for creating hypsometric tiles based on an earth tileset.aHypsometricValueProvider
- The hypsometric value provider to use for calculating hypsometric values in an earth tilesetaUnknownValue
- The value to use when no value could be determined in the earth tileset.
-
TLcdHypsometricEarthPainter
Creates a new hypsometric earth painter with the given hypsometric tile factory. This convenience constructor only acceptsTLcdHypsometricTileFactory
and is equivalent to calling:new TLcdHypsometricEarthPainter( tileFactory, tileFactory.getHypsometricValueProvider(), tileFactory.getHypsometricColorModel(), tileFactory.getUnknownValue() )
- Parameters:
aTileFactory
- the hypsometric tile factory to use for creating hypsometric tiles
-
-
Method Details
-
getEmptyTile
Description copied from class:TLcdEarthGXYRasterPainter
Returns a representative empty tile for this painter. For example, the tile's default value may be used when painting missing data.- Overrides:
getEmptyTile
in classTLcdEarthGXYRasterPainter
- Returns:
- an empty tile.
-
getTileFactory
Gets the tile factory set on this hypsometric earth painter.- Returns:
- the hypsometric tile factory on this earth painter
-
setTileFactory
Sets the tile factory set on this hypsometric earth painter.- Parameters:
aTileFactory
- the hypsometric tile factory on this earth painter
-
getHypsometricValueProvider
Returns the hypsometric value provider- Returns:
- the hypsoemtric value provider
-
setHypsometricValueProvider
Sets the hypsometric value provider- Parameters:
aHypsometricValueProvider
- a hypsometric value provider
-
getUnknownValue
public int getUnknownValue()Returns the unknown value that is used when no result could be determined for the input data.- Returns:
- the unknown value
-
setUnknownValue
public void setUnknownValue(int aUnknownValue) Sets the unknown value when no result could be determined for the input data.- Parameters:
aUnknownValue
- the unknown value
-
paint
Description copied from interface:ILcdGXYPainter
Displays the representation of the object in the given mode on the Graphics passed, taking into account the supplied context.The visual representation of an object depends on the context. Depending on the context (e.g. is the location covered by the view), an object may or may not have a representation. The context contains:
- transformations which allow to compute the location in view space of points and bounds given in model, space
- a pen which can connect points with a line or create arcs around a point,
- the view for which the object's representation must be painted. This can be useful when the painted object depends on the scale of the view, or the presence of other layers in the view.
- the current location(s) of the mouse or input device and the last location(s) the mouse or input device was pressed.
The mode passed in this method indicates what part of the object must be painted, whether it should be painted as selected or not, and whether user interaction (via mouse movements) must be taken into account.
When the mode passed contains either TRANSLATING, RESHAPING or CREATING, this method is also responsible for interpreting interaction on the representation of an object and modifying the representation of the object accordingly. The painter is not responsible for modifying the object itself, this is done by a corresponding
ILcdGXYEditor
. Implementations ofILcdGXYPainter
andILcdGXYEditor
interfaces must be consistent for an object: the painter must display the result of the user interaction on the object, while the editor is responsible for modifying the object as a result of the user interaction. A good practice to ensure a consistent implementation is to implement both theILcdGXYPainter
andILcdGXYEditor
interfaces in a single class.When the mode passed includes SNAPS, the part of the representation which corresponds to the object returned as snap target by the method
snapTarget
must be painted in order to provide the user with a visual indication of the snap target.The Graphics passed in this method can be different from the Graphics returned by a view due to techniques such as double buffering (as applied in Swing). Basic drawing operations must always be performed on the Graphics passed as an argument in this method.
- Specified by:
paint
in interfaceILcdGXYPainter
- Overrides:
paint
in classTLcdEarthGXYRasterPainter
- Parameters:
aGraphics
- the Graphics on which the representation of the object is paintedaMode
- the mode the object is represented in (see class documentation).aContext
- theILcdGXYContext
the drawing depends on.
-
configureBaseTileSet
Description copied from class:TLcdEarthGXYRasterPainter
Configures the base tile set. The default implementation just returns the base tile set. This method can be overridden to add custom tile set wrappers to the tile set.- Overrides:
configureBaseTileSet
in classTLcdEarthGXYRasterPainter
- Parameters:
aObject
- the object being paintedaTileSet
- the base tile set- Returns:
- the configured tile set
- See Also:
-
retrieveCachedHypsometricValue
Retrieves a cached hypsometric value from this painter for a given point in model coordinates. This method will only return a valid value if the hypsometry layer is visible and has been painted for the given region.- Parameters:
aPoint
- The point for which to retrieve the value in model coordinates. The reference of this point should be the same as the earth tileset.aTileset
- the tileset for which to retrieve the value. This tileset needs to be an element of the model that is being painted. ( In other words "ILcdModel.elements()" should contain the given aTileset ). It is the same tileset that is set on this painter whenTLcdEarthGXYRasterPainter.setObject(Object)
is called before a paint operation.- Returns:
- Can return one of the following:
- The cached hypsometric value at the given point (aPoint). The accuracy of this value will depend on the cache of the painter. This method will try to return the most detailed available values that were calculated with a paint operation.
-
The unknown value:
This value will be returned if the given point is out of bounds, the given point is not in the painted (cached) region of the painter, or if the tileset does not contain elevation data in the given point.
-
isValidCoverage
Description copied from class:TLcdEarthGXYRasterPainter
Returns whether the given coverage can be drawn by this painter. The returned coverage should support a format that can be handled byTLcdEarthGXYRasterPainter.createRasterTile(com.luciad.earth.tileset.ALcdEarthTile)
. The default implementation returnstrue
if the coverage is araster coverage
and the tiles set supports a format withRenderedImage
as format class and no format name with the specified coverage.- Overrides:
isValidCoverage
in classTLcdEarthGXYRasterPainter
- Parameters:
aCoverage
- the candidate coverage- Returns:
true
if the given coverage can be painted- See Also:
-
chooseTileFormat
protected TLcdEarthTileFormat chooseTileFormat(ILcdEarthTileSet aTileSet, ILcdEarthTileSetCoverage aCoverage) Description copied from class:TLcdEarthGXYRasterPainter
Chooses a tile format from the given tile set and coverage to be used for producing tiles. The format should be supported byTLcdEarthGXYRasterPainter.createRasterTile(com.luciad.earth.tileset.ALcdEarthTile)
. The default implementation returns a format withRenderedImage
as format class and no format name.- Overrides:
chooseTileFormat
in classTLcdEarthGXYRasterPainter
- Parameters:
aTileSet
- the tile set whose tiles are being paintedaCoverage
- the coverage whose tiles are being painted.- Returns:
- the format in which tiles should be obtained
-
createRasterTile
Description copied from class:TLcdEarthGXYRasterPainter
Creates anILcdTile
corresponding to the specifiedALcdEarthTile
. The resulting raster tile is used in order to draw the output of a tile set usingTLcdRasterPainter
. The default implementation can only create a tile for tiles with aRenderedImage
as tile data.- Overrides:
createRasterTile
in classTLcdEarthGXYRasterPainter
- Parameters:
aTile
- the tile to convert into a raster tile- Returns:
- a raster tile
-