Package org.geotools.tile
Class Tile
- Object
-
- Tile
-
- All Implemented Interfaces:
ImageLoader
public abstract class Tile extends Object implements 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 Classes Modifier and Type Class Description static classTile.ContextStateThese states represent the state of the context.static classTile.RenderStateThese are the states of the tile.static classTile.ScreenStateThese states represent if the tile is on or off screen.static classTile.ValidatedStateThese states represent if the tile has been validated in response to a user event.
-
Field Summary
Fields Modifier and Type Field Description static StringDEBUG_FLAGprotected static LoggerLOGGERprotected TileServiceserviceThe initiating service
-
Constructor Summary
Constructors Constructor Description Tile(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
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected BufferedImagecreateErrorImage(String message)Gets an image showing an error, possibly indicating a failure to load the tile image.voiddispose()Disposes of the tile.booleanequals(Object other)BufferedImagegetBufferedImage()Tile.ContextStategetContextState()This function returns the state of the tile render stack.ReferencedEnvelopegetExtent()StringgetId()Diese Methode wird verwendet um...Tile.RenderStategetRenderState()Gets the state of the tiled image.Tile.ScreenStategetScreenState()Sets if the tile is on screen or not.TileIdentifiergetTileIdentifier()Diese Methode wird verwendet um...intgetTileSize()Tile.ValidatedStategetTileState()Gets the validation state.abstract URLgetUrl()A unique url for every tileinthashCode()BufferedImageloadImageTileImage(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.voidsetStateChangedListener(TileStateChangedListener listener)voidsetTileState(Tile.ValidatedState newState)Sets the validation state.StringtoString()
-
-
-
Field Detail
-
LOGGER
protected static final Logger LOGGER
-
DEBUG_FLAG
public static final String DEBUG_FLAG
- See Also:
- Constant Field Values
-
service
protected TileService service
The initiating service
-
-
Constructor Detail
-
Tile
public Tile(TileIdentifier tileId, ReferencedEnvelope env, int tileSize)
Creates a tile for the identity given by tileId. Will use this instance as imageLoader.
-
Tile
public Tile(TileIdentifier tileId, ReferencedEnvelope env, int tileSize, TileService service)
Creates a new tile. This constructor will use the service as imageLoader.
-
-
Method Detail
-
setImageLoader
public void setImageLoader(ImageLoader imageLoader)
-
setStateChangedListener
public void setStateChangedListener(TileStateChangedListener listener)
-
dispose
public void dispose()
Disposes of the tile.
-
getBufferedImage
public BufferedImage getBufferedImage()
-
loadImageTileImage
public BufferedImage loadImageTileImage(Tile tile) throws IOException
Implementation of ImageLoader. Has been moved to {@link- Specified by:
loadImageTileImagein interfaceImageLoader- Returns:
- an image
- Throws:
IOException- See Also:
}
-
createErrorImage
protected BufferedImage createErrorImage(String message)
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
public ReferencedEnvelope getExtent()
- Returns:
- the bounds of the tile
-
setRenderState
public void setRenderState(Tile.RenderState newState)
Sets the state of the tiles image.See getRenderState() for a description of the valid states.
-
getRenderState
public Tile.RenderState 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
public Tile.ContextState 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
public void setContextState(Tile.ContextState newState)
Sets the state of the tile rendering stack.See getContextState() for valid value descriptions.
-
getScreenState
public Tile.ScreenState 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
public void setScreenState(Tile.ScreenState newState)
Sets the screen state.See getScreenState() for a description of the valid values.
-
getTileState
public Tile.ValidatedState 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
public void setTileState(Tile.ValidatedState newState)
Sets the validation state.See getTileState() for a description of valid values.
-
getId
public String getId()
Diese Methode wird verwendet um... TODO.
-
getTileIdentifier
public TileIdentifier getTileIdentifier()
Diese Methode wird verwendet um... TODO.
-
getUrl
public abstract URL getUrl()
A unique url for every tile
-
-