org.epseelon.mobimap.tiles
Class Tile

java.lang.Object
  extended by org.epseelon.mobimap.tiles.Tile

public class Tile
extends java.lang.Object

The Tile class represents a particular square image piece of the world bitmap at a particular zoom level.

Author:
sarbogast

Constructor Summary
Tile(int x, int y, int zoom, java.lang.String url, TileFactory dtf)
          Create a new Tile that loads its data from the given URL.
 
Method Summary
 java.lang.Throwable getError()
           
 javax.microedition.lcdui.Image getImage()
           
 java.lang.Throwable getLoadingError()
           
 java.lang.Throwable getUnrecoverableError()
          Returns the last error in a possible chain of errors that occured during the loading of the tile
 java.lang.String getURL()
           
 int getX()
           
 int getY()
           
 int getZoom()
           
 boolean isLoaded()
          Indicates if this tile's underlying image has been successfully loaded yet.
 boolean isLoading()
           
 void setError(java.lang.Throwable error)
           
 void setImage(javax.microedition.lcdui.Image image)
           
 void setLoading(boolean isLoading)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Tile

public Tile(int x,
            int y,
            int zoom,
            java.lang.String url,
            TileFactory dtf)
Create a new Tile that loads its data from the given URL. The URL must resolve to an image

Method Detail

isLoading

public boolean isLoading()
Returns:
the isLoading

setLoading

public void setLoading(boolean isLoading)
Parameters:
isLoading - the isLoading to set

getError

public java.lang.Throwable getError()
Returns:
the error

setError

public void setError(java.lang.Throwable error)
Parameters:
error - the error to set

getURL

public java.lang.String getURL()
Returns:
the URL of this tile.

isLoaded

public boolean isLoaded()
Indicates if this tile's underlying image has been successfully loaded yet.

Returns:
true if the Tile has been loaded

getX

public int getX()
Returns:
The abscissa of this tile on the map

getY

public int getY()
Returns:
The ordinate of this tile on the map

getZoom

public int getZoom()
Returns:
the zoom level that this tile belongs in

getImage

public javax.microedition.lcdui.Image getImage()
Returns:
the Image associated with this Tile. This is a read only property This may return null at any time, however if this returns null, a load operation will automatically be started for it.

setImage

public void setImage(javax.microedition.lcdui.Image image)
Parameters:
image - The loaded image for this tile

getUnrecoverableError

public java.lang.Throwable getUnrecoverableError()
Returns the last error in a possible chain of errors that occured during the loading of the tile


getLoadingError

public java.lang.Throwable getLoadingError()
Returns:
the Throwable tied to any error that may have ocurred while loading the tile. This error may change several times if multiple errors occur


Copyright © 2008 Epseelon. All Rights Reserved.