|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openstreetmap.gui.jmapviewer.Tile
public class Tile
Holds one map tile. Additionally the code for loading the tile image and painting it is also included in this class.
Field Summary | |
---|---|
static java.awt.image.BufferedImage |
ERROR_IMAGE
|
protected java.awt.image.BufferedImage |
image
|
protected java.lang.String |
key
|
protected boolean |
loaded
|
protected boolean |
loading
|
static java.awt.image.BufferedImage |
LOADING_IMAGE
Hourglass image that is displayed until a map tile has been loaded |
static int |
SIZE
|
protected TileSource |
source
|
protected int |
xtile
|
protected int |
ytile
|
protected int |
zoom
|
Constructor Summary | |
---|---|
Tile(TileSource source,
int xtile,
int ytile,
int zoom)
Creates a tile with empty image. |
|
Tile(TileSource source,
int xtile,
int ytile,
int zoom,
java.awt.image.BufferedImage image)
|
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
|
java.awt.image.BufferedImage |
getImage()
|
java.lang.String |
getKey()
|
TileSource |
getSource()
|
static java.lang.String |
getTileKey(TileSource source,
int xtile,
int ytile,
int zoom)
|
java.lang.String |
getUrl()
|
int |
getXtile()
|
int |
getYtile()
|
int |
getZoom()
|
boolean |
isLoaded()
|
void |
loadImage(java.io.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(java.awt.Graphics g,
int x,
int y)
Paints the tile-image on the Graphics g at the
position x /y . |
void |
setImage(java.awt.image.BufferedImage image)
|
void |
setLoaded(boolean loaded)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static java.awt.image.BufferedImage LOADING_IMAGE
public static java.awt.image.BufferedImage ERROR_IMAGE
protected TileSource source
protected int xtile
protected int ytile
protected int zoom
protected java.awt.image.BufferedImage image
protected java.lang.String key
protected boolean loaded
protected boolean loading
public static final int SIZE
Constructor Detail |
---|
public Tile(TileSource source, int xtile, int ytile, int zoom)
source
- xtile
- ytile
- zoom
- public Tile(TileSource source, int xtile, int ytile, int zoom, java.awt.image.BufferedImage image)
Method Detail |
---|
public void loadPlaceholderFromCache(TileCache cache)
public TileSource getSource()
public int getXtile()
public int getYtile()
public int getZoom()
public java.awt.image.BufferedImage getImage()
public void setImage(java.awt.image.BufferedImage image)
public void loadImage(java.io.InputStream input) throws java.io.IOException
java.io.IOException
public java.lang.String getKey()
public boolean isLoaded()
public void setLoaded(boolean loaded)
public java.lang.String getUrl()
public void paint(java.awt.Graphics g, int x, int y)
Graphics
g
at the
position x
/y
.
g
- x
- x-coordinate in g
y
- y-coordinate in g
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public static java.lang.String getTileKey(TileSource source, int xtile, int ytile, int zoom)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |