Class Tile
- Direct Known Subclasses:
ProxyHttpTile
-
Constructor Summary
ConstructorsConstructorDescriptionTile(Dimension dimension, BoundingBox boundingBox, Image image) Creates a new Tile. -
Method Summary
Modifier and TypeMethodDescriptionGets the tile dimensionprotected voidinform the TileReadyListener that this tile is ready to be paintedGets the tile bounding box.booleanPaints the tile on the Graphics ObjectvoidPaints the tile on the Graphics Object translated to the given x, y, This method paints the tile image if available or will call paintTileLoadingvoidThis method paints a "tile loading" on the Graphics if boolean paint(Graphics g) returned false.pointPosition(Coord point) Returns the x, y point of the given coordinate relative to this tileposition(int posX, int posY) Returns the Coordinate of the given x, y position on the tilestatic voidsetPaintLoading(boolean toPaint) This flag indicates if the Tile should paint a Loading image or Text or simply not do any painting if a map image is not ready for paintingvoidsetsTileReadyListener(ActionListener listener) Sets a Listener to be notified when the tile is fireReady to be paintedstatic voidsetTileLoadingImage(Image tileLoadingImage) Sets a static image that will be drawn on the map if the tile image is not available yet.static voidsetTileLoadingText(String tileLoadingText) Sets a static text to paint.toString()
-
Constructor Details
-
Tile
Creates a new Tile.
Parameters
-
dimension: the tile Dimensions (usually 256x256) -
getBoundingBox: the bounding box this tile is showing -
image: the map image or null.
-
-
-
Method Details
-
setPaintLoading
public static void setPaintLoading(boolean toPaint) This flag indicates if the Tile should paint a Loading image or Text or simply not do any painting if a map image is not ready for painting
Parameters
if: @param if true a Loading rect is displayed when map image is being downloaded
-
setTileLoadingImage
Sets a static image that will be drawn on the map if the tile image is not available yet.
Parameters
tileLoadingImage
-
setTileLoadingText
Sets a static text to paint. This will be used if the map if the tile image is not available yet and the tileLoadingImage is null
Parameters
tileLoadingText
-
pointPosition
-
position
Returns the Coordinate of the given x, y position on the tile
Parameters
-
posX -
posY
Returns
a Coordinate that was created from the given x, y position
-
-
dimension
Gets the tile dimension
Returns
the tile dimension
-
getBoundingBox
Gets the tile bounding box.
Returns
the tile bounding box.
-
paint
Paints the tile on the Graphics Object
Parameters
g: Graphics object to paint on.
Returns
true if painting succeeded.
-
paint
Paints the tile on the Graphics Object translated to the given x, y, This method paints the tile image if available or will call paintTileLoading
Parameters
-
g: Graphics object to paint on. -
x: translate to x before painting -
y: translate to y before painting
-
-
paintTileLoading
This method paints a "tile loading" on the Graphics if boolean paint(Graphics g) returned false.
Parameters
g: Graphics object to paint on.
-
setsTileReadyListener
Sets a Listener to be notified when the tile is fireReady to be painted
Parameters
listener
-
fireReady
protected void fireReady()inform the TileReadyListener that this tile is ready to be painted -
toString
-