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, fWorkBoundsFields inherited from interface com.luciad.view.gxy.ILcdGXYPainter
BODY, CREATING, DEFAULT, HANDLES, RESHAPING, SELECTED, SNAPS, TRANSLATING -
Constructor Summary
ConstructorsConstructorDescriptionTLcdHypsometricEarthPainter(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 TLcdEarthTileFormatchooseTileFormat(ILcdEarthTileSet aTileSet, ILcdEarthTileSetCoverage aCoverage) Chooses a tile format from the given tile set and coverage to be used for producing tiles.protected ILcdEarthTileSetconfigureBaseTileSet(Object aObject, ILcdEarthTileSet aTileSet) Configures the base tile set.protected ILcdTilecreateRasterTile(ALcdEarthTile aTile) Creates anILcdTilecorresponding to the specifiedALcdEarthTile.protected ILcdTileReturns a representative empty tile for this painter.Returns the hypsometric value providerGets the tile factory set on this hypsometric earth painter.intReturns the unknown value that is used when no result could be determined for the input data.protected booleanisValidCoverage(ILcdEarthTileSetCoverage aCoverage) Returns whether the given coverage can be drawn by this painter.voidpaint(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.doubleretrieveCachedHypsometricValue(ILcdPoint aPoint, ILcdEarthTileSet aTileset) Retrieves a cached hypsometric value from this painter for a given point in model coordinates.voidsetHypsometricValueProvider(ILcdHypsometricValueProvider aHypsometricValueProvider) Sets the hypsometric value providervoidsetTileFactory(ILcdHypsometricTileFactory aTileFactory) Sets the tile factory set on this hypsometric earth painter.voidsetUnknownValue(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, updateTilesMethods inherited from class com.luciad.earth.view.gxy.ALcdEarthGXYPainter
boundsSFCT, getExceptionHandler, getObject, getTileSet, getTileSetCoverage, isAsynchronousTileRequestAllowed, isRepaintViewWhenTileAvailable, isTouchedMethods 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 acceptsTLcdHypsometricTileFactoryand 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:TLcdEarthGXYRasterPainterReturns a representative empty tile for this painter. For example, the tile's default value may be used when painting missing data.- Overrides:
getEmptyTilein 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:ILcdGXYPainterDisplays 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 ofILcdGXYPainterandILcdGXYEditorinterfaces 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 theILcdGXYPainterandILcdGXYEditorinterfaces 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
snapTargetmust 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:
paintin interfaceILcdGXYPainter- Overrides:
paintin 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- theILcdGXYContextthe drawing depends on.
-
configureBaseTileSet
Description copied from class:TLcdEarthGXYRasterPainterConfigures 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:
configureBaseTileSetin 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:TLcdEarthGXYRasterPainterReturns 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 returnstrueif the coverage is araster coverageand the tiles set supports a format withRenderedImageas format class and no format name with the specified coverage.- Overrides:
isValidCoveragein classTLcdEarthGXYRasterPainter- Parameters:
aCoverage- the candidate coverage- Returns:
trueif the given coverage can be painted- See Also:
-
chooseTileFormat
protected TLcdEarthTileFormat chooseTileFormat(ILcdEarthTileSet aTileSet, ILcdEarthTileSetCoverage aCoverage) Description copied from class:TLcdEarthGXYRasterPainterChooses 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 withRenderedImageas format class and no format name.- Overrides:
chooseTileFormatin 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:TLcdEarthGXYRasterPainterCreates anILcdTilecorresponding 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 aRenderedImageas tile data.- Overrides:
createRasterTilein classTLcdEarthGXYRasterPainter- Parameters:
aTile- the tile to convert into a raster tile- Returns:
- a raster tile
-