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 class
Tile.ContextState
These states represent the state of the context.static class
Tile.RenderState
These are the states of the tile.static class
Tile.ScreenState
These states represent if the tile is on or off screen.static class
Tile.ValidatedState
These states represent if the tile has been validated in response to a user event.
-
Field Summary
Fields Modifier and Type Field Description static String
DEBUG_FLAG
protected static Logger
LOGGER
protected TileService
service
The 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 BufferedImage
createErrorImage(String message)
Gets an image showing an error, possibly indicating a failure to load the tile image.void
dispose()
Disposes of the tile.boolean
equals(Object other)
BufferedImage
getBufferedImage()
Tile.ContextState
getContextState()
This function returns the state of the tile render stack.ReferencedEnvelope
getExtent()
String
getId()
Diese Methode wird verwendet um...Tile.RenderState
getRenderState()
Gets the state of the tiled image.Tile.ScreenState
getScreenState()
Sets if the tile is on screen or not.TileIdentifier
getTileIdentifier()
Diese Methode wird verwendet um...int
getTileSize()
Tile.ValidatedState
getTileState()
Gets the validation state.abstract URL
getUrl()
A unique url for every tileint
hashCode()
BufferedImage
loadImageTileImage(Tile tile)
Implementation of ImageLoader.void
setContextState(Tile.ContextState newState)
Sets the state of the tile rendering stack.void
setImageLoader(ImageLoader imageLoader)
void
setRenderState(Tile.RenderState newState)
Sets the state of the tiles image.void
setScreenState(Tile.ScreenState newState)
Sets the screen state.void
setStateChangedListener(TileStateChangedListener listener)
void
setTileState(Tile.ValidatedState newState)
Sets the validation state.String
toString()
-
-
-
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:
loadImageTileImage
in 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
-
-