public interface TileProvider
| Modifier and Type | Method and Description |
|---|---|
void |
addTileListener(TileListener tileListener)
Register a tile listener which will be notified if the contents of a
tile change.
|
Rectangle |
getExtent()
Get the coordinates of the "main area of interest" of this tile provider,
if any, in tile coordinates and disregarding the current zoom level.
|
int |
getTilePriority(int x,
int y)
Get the priority with which a specific tile should be rendered.
|
int |
getTileSize()
Get the width and height of tiles (which must be square) in pixels.
|
int |
getZoom()
Get the zoom as an exponent of two.
|
boolean |
isTilePresent(int x,
int y)
Determines, if possible, if there is a tile present at a specified
location.
|
boolean |
isZoomSupported()
Indicates whether the tile provider implements zooming itself (when
true) or whether the tile consumer should implement it (when
false). |
boolean |
paintTile(Image image,
int x,
int y,
int dx,
int dy)
Paint the tile at the specified tile coordinates to an image.
|
void |
removeTileListener(TileListener tileListener)
Remove a previously registered tile listener.
|
void |
setZoom(int zoom)
Set the zoom as an exponent of two.
|
int getTileSize()
boolean isTilePresent(int x,
int y)
x - The X coordinate (in tiles) to check for the presence of a tile.y - The Y coordinate (in tiles) to check for the presence of a tile.true if there is a tile there.boolean paintTile(Image image, int x, int y, int dx, int dy)
The provider must paint the tile completely. The image is guaranteed to support transparency and the provider may make parts or all of the tile transparent.
The provider may fail to paint the tile for some reason, for example
because a dependency is not met, in which case it should return
false and leave the image unaltered.
image - The image on which to paint the tilex - The X coordinate (in tiles) of the tile to paint.y - The Y coordinate (in tiles) of the tile to paint.dx - The X coordinate at which to paint the tile in the image.dy - The Y coordinate at which to paint the tile in the image.true if the tile was painted; false if
it could not be painted for some reason.int getTilePriority(int x,
int y)
x - The X coordinate (in tiles) of the tile.y - The Y coordinate (in tiles) of the tile.Rectangle getExtent()
void addTileListener(TileListener tileListener)
tileListener - The tile listener to register.void removeTileListener(TileListener tileListener)
tileListener - The tile listener to remove.boolean isZoomSupported()
true) or whether the tile consumer should implement it (when
false). In the latter case getZoom() and
setZoom(int) will never be invoked.true if the tile provider implements zooming.int getZoom()
void setZoom(int zoom)
zoom - The zoom as an exponent of two.Copyright © 2011–2025 pepsoft.org. All rights reserved.