Modifier and Type | Field and Description |
---|---|
protected boolean |
error |
static BufferedImage |
ERROR_IMAGE
Red cross image that is displayed after a loading error, except for overlay sources
|
protected String |
error_message |
protected BufferedImage |
image |
protected String |
key |
protected boolean |
loaded |
protected boolean |
loading |
static BufferedImage |
LOADING_IMAGE
Hourglass image that is displayed until a map tile has been loaded, except for overlay sources
|
protected Map<String,String> |
metadata
TileLoader-specific tile metadata
|
protected TileSource |
source |
protected int |
xtile |
protected int |
ytile |
protected int |
zoom |
Constructor and Description |
---|
Tile(TileSource source,
int xtile,
int ytile,
int zoom)
Creates a tile with empty image.
|
Tile(TileSource source,
int xtile,
int ytile,
int zoom,
BufferedImage image)
Creates a tile with specified image.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
|
void |
finishLoading() |
String |
getErrorMessage() |
BufferedImage |
getImage() |
String |
getKey() |
Map<String,String> |
getMetadata() |
TileSource |
getSource() |
String |
getStatus() |
static String |
getTileKey(TileSource source,
int xtile,
int ytile,
int zoom) |
String |
getUrl() |
String |
getValue(String key) |
int |
getXtile()
Returns the X coordinate.
|
int |
getYtile()
Returns the Y coordinate.
|
int |
getZoom()
Returns the zoom level.
|
boolean |
hasError() |
int |
hashCode()
Note that the hash code does not include the
source . |
void |
initLoading() |
boolean |
isLoaded() |
boolean |
isLoading() |
void |
loadImage(InputStream input) |
void |
loadPlaceholderFromCache(TileCache cache)
Tries to get tiles of a lower or higher zoom level (one or two level
difference) from cache and use it as a placeholder until the tile has
been loaded.
|
void |
paint(Graphics g,
int x,
int y)
|
void |
putValue(String key,
String value)
Puts the given key/value pair to the metadata of the tile.
|
void |
setError(String message) |
void |
setImage(BufferedImage image) |
void |
setLoaded(boolean loaded) |
String |
toString() |
public static BufferedImage LOADING_IMAGE
public static BufferedImage ERROR_IMAGE
protected TileSource source
protected int xtile
protected int ytile
protected int zoom
protected BufferedImage image
protected boolean loaded
protected boolean loading
protected boolean error
protected String error_message
public Tile(TileSource source, int xtile, int ytile, int zoom)
source
- Tile sourcextile
- X coordinateytile
- Y coordinatezoom
- Zoom levelpublic Tile(TileSource source, int xtile, int ytile, int zoom, BufferedImage image)
source
- Tile sourcextile
- X coordinateytile
- Y coordinatezoom
- Zoom levelimage
- Image contentpublic void loadPlaceholderFromCache(TileCache cache)
public TileSource getSource()
public int getXtile()
public int getYtile()
public int getZoom()
public BufferedImage getImage()
public void setImage(BufferedImage image)
public void loadImage(InputStream input) throws IOException
IOException
public boolean isLoaded()
public boolean isLoading()
public void setLoaded(boolean loaded)
public String getUrl() throws IOException
IOException
public void paint(Graphics g, int x, int y)
g
- the Graphics objectx
- x-coordinate in g
y
- y-coordinate in g
public int hashCode()
public static String getTileKey(TileSource source, int xtile, int ytile, int zoom)
public boolean hasError()
public String getErrorMessage()
public void putValue(String key, String value)
key
- Keyvalue
- Valuepublic Map<String,String> getMetadata()
public void initLoading()
public void finishLoading()