Package org.geotools.tile
Class Tile
Object
Tile
- All Implemented Interfaces:
ImageLoader
At tile represents a single space on the map within a specific ReferencedEnvelope. It holds a RenderExecutorComposite
for fetching its image, and an SWTImage (which is disposed at various times). It listens to events for when to fetch,
dispose, and construct new images. From
- Since:
- 12
- Author:
- GDavis, Ugo Taddei
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThese states represent the state of the context.static enumThese are the states of the tile.static enumThese states represent if the tile is on or off screen.static enumThese states represent if the tile has been validated in response to a user event. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected static final Loggerprotected TileServiceThe initiating service -
Constructor Summary
ConstructorsConstructorDescriptionTile(TileIdentifier tileId, ReferencedEnvelope env, int tileSize) Creates a tile for the identity given by tileId.Tile(TileIdentifier tileId, ReferencedEnvelope env, int tileSize, TileService service) Creates a new tile. -
Method Summary
Modifier and TypeMethodDescriptionprotected BufferedImagecreateErrorImage(String message) Gets an image showing an error, possibly indicating a failure to load the tile image.voiddispose()Disposes of the tile.booleanThis function returns the state of the tile render stack.getId()Diese Methode wird verwendet um...Gets the state of the tiled image.Sets if the tile is on screen or not.Diese Methode wird verwendet um...intGets the validation state.abstract URLgetUrl()A unique url for every tileinthashCode()loadImageTileImage(Tile tile) Implementation of ImageLoader.voidsetContextState(Tile.ContextState newState) Sets the state of the tile rendering stack.voidsetImageLoader(ImageLoader imageLoader) voidsetRenderState(Tile.RenderState newState) Sets the state of the tiles image.voidsetScreenState(Tile.ScreenState newState) Sets the screen state.voidvoidsetTileState(Tile.ValidatedState newState) Sets the validation state.toString()
-
Field Details
-
LOGGER
-
DEBUG_FLAG
- See Also:
-
service
The initiating service
-
-
Constructor Details
-
Tile
Creates a tile for the identity given by tileId. Will use this instance as imageLoader. -
Tile
Creates a new tile. This constructor will use the service as imageLoader.
-
-
Method Details
-
setImageLoader
-
setStateChangedListener
-
dispose
public void dispose()Disposes of the tile. -
getBufferedImage
-
loadImageTileImage
Implementation of ImageLoader. Has been moved to {@link- Specified by:
loadImageTileImagein interfaceImageLoader- Returns:
- an image
- Throws:
IOException- See Also:
-
createErrorImage
Gets an image showing an error, possibly indicating a failure to load the tile image. -
getTileSize
public int getTileSize()- Returns:
- The size of the tile in pixels.
-
getExtent
- Returns:
- the bounds of the tile
-
setRenderState
Sets the state of the tiles image.See getRenderState() for a description of the valid states.
-
getRenderState
Gets the state of the tiled image.One Of:
- RenderState.NEW - a new tile that needs to be rendered
- RenderState.Renderer - the tile has been rendered or is in the state of being rendered
- RenderState.Invalid - something has changed and the tile's rendered image is not longer valid and needs to be re-rendered
-
getContextState
This function returns the state of the tile render stack. If the context is invalid then the context needs to be updated before the tile is rendered.Should be one of:
- INVALID - The context needs to be updated.
- OKAY - The context is okay and does not need updating.
- Returns:
- the state of the tiles rendering stack
-
setContextState
Sets the state of the tile rendering stack.See getContextState() for valid value descriptions.
-
getScreenState
Sets if the tile is on screen or not.This is used with other information to determine if a tile can be disposed of. Valid values include:
- ONSCREEN - the tile has been requested by the viewport therefore we assume it is on screen
- OFFSCREEN - this tile was not requested by the viewport
-
setScreenState
Sets the screen state.See getScreenState() for a description of the valid values.
-
getTileState
Gets the validation state.This is used in conjunction with the screen state to determine it a tile can be disposed of. This state is set during a refresh event that is triggered from some gui event. Valid values include:
- VALIDATED - The tile is validated and ready to be used for painting on the screen. Don't remove this tile.
- OLD - This tile is an old tile that if off screen can be removed.
-
setTileState
Sets the validation state.See getTileState() for a description of valid values.
-
getId
Diese Methode wird verwendet um... TODO. -
getTileIdentifier
Diese Methode wird verwendet um... TODO. -
hashCode
public int hashCode() -
equals
-
toString
-
getUrl
A unique url for every tile
-