org.jdesktop.swingx.mapviewer
Class Tile

java.lang.Object
  extended by org.jdesktop.beans.AbstractBean
      extended by org.jdesktop.swingx.mapviewer.Tile

public class Tile
extends org.jdesktop.beans.AbstractBean

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


Nested Class Summary
static class Tile.Priority
           
 
Constructor Summary
Tile(int x, int y, int zoom)
          Create a new Tile at the specified tile point and zoom level
 
Method Summary
 void addUniquePropertyChangeListener(String propertyName, PropertyChangeListener listener)
          Adds a single property change listener.
 Throwable getError()
           
 BufferedImage getImage()
          Returns the Image associated with this Tile.
 Throwable getLoadingError()
          Returns the Throwable tied to any error that may have ocurred while loading the tile.
 Tile.Priority getPriority()
          Gets the loading priority of this tile.
 Throwable getUnrecoverableError()
          Returns the last error in a possible chain of errors that occured during the loading of the tile
 String getURL()
          Gets the URL of this tile.
 int getX()
           
 int getY()
           
 int getZoom()
           
 boolean isLoaded()
          Indicates if this tile's underlying image has been successfully loaded yet.
 boolean isLoading()
           
 void setError(Throwable error)
           
 void setLoading(boolean isLoading)
           
 void setPriority(Tile.Priority priority)
          Set the loading priority of this tile.
 
Methods inherited from class org.jdesktop.beans.AbstractBean
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, clone, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, getVetoableChangeListeners, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Tile

public Tile(int x,
            int y,
            int zoom)
Create a new Tile at the specified tile point and zoom level

Parameters:
location -
zoom -
Method Detail

isLoaded

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

Returns:

getUnrecoverableError

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


getLoadingError

public 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

Returns:

getImage

public BufferedImage 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.


getZoom

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

addUniquePropertyChangeListener

public void addUniquePropertyChangeListener(String propertyName,
                                            PropertyChangeListener listener)
Adds a single property change listener. If a listener has been previously added then it will be replaced by the new one.

Parameters:
propertyName -
listener -

getError

public Throwable getError()
Returns:
the error

setError

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

isLoading

public boolean isLoading()
Returns:
the isLoading

setLoading

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

getPriority

public Tile.Priority getPriority()
Gets the loading priority of this tile.

Returns:

setPriority

public void setPriority(Tile.Priority priority)
Set the loading priority of this tile.

Parameters:
priority - the priority to set

getURL

public String getURL()
Gets the URL of this tile.

Returns:

getX

public int getX()

getY

public int getY()