de.yaina.trackrenderer
Class TileCollection

java.lang.Object
  extended by de.yaina.trackrenderer.TileCollection
Direct Known Subclasses:
TileCanvas

public class TileCollection
extends java.lang.Object

A HashMaped collection of tiles. New tiles get created on the fly.


Constructor Summary
TileCollection(int tileDimX, int tileDimY)
          Create a new hash map of tiles
 
Method Summary
 java.util.Collection getCollection()
          Return the actual collection of hashed rasters, which is iterable
 int getDimensionX()
          Get horizontal size of tiles
 int getDimensionY()
          Get vertical size of tiles
 java.awt.image.BufferedImage getImage(int tilex, int tiley)
          Return an ARGB image from the raster referenced by tile, suitable for further processing by AWT
 byte getPoint(TileCoordinates point)
          Get a point (a single dot) from the image
 TileRaster getTile(int tilex, int tiley)
          Return a tile from the map
 void setPoint(TileCoordinates point, byte colour)
          Set a point (a single dot) on the image
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TileCollection

public TileCollection(int tileDimX,
                      int tileDimY)
Create a new hash map of tiles

Parameters:
tileDimX - vertical size of a single tile
tileDimY - horizontal size of a single tile
Method Detail

getTile

public TileRaster getTile(int tilex,
                          int tiley)
Return a tile from the map

Parameters:
tilex - horizontal number of the tile
tiley - vertical number of the tile
Returns:
raster image

getDimensionX

public int getDimensionX()
Get horizontal size of tiles

Returns:
horizontal size of tiles

getDimensionY

public int getDimensionY()
Get vertical size of tiles

Returns:
vertical size

setPoint

public void setPoint(TileCoordinates point,
                     byte colour)
Set a point (a single dot) on the image

Parameters:
point - tile and coordinates of the point
colour - colour index of the point

getPoint

public byte getPoint(TileCoordinates point)
Get a point (a single dot) from the image

Parameters:
point - tile and coordinates of the point
Returns:
colour index of the point

getImage

public java.awt.image.BufferedImage getImage(int tilex,
                                             int tiley)
Return an ARGB image from the raster referenced by tile, suitable for further processing by AWT

Parameters:
tilex - horizontal tile
tiley - vertical tile
Returns:
image

getCollection

public java.util.Collection getCollection()
Return the actual collection of hashed rasters, which is iterable

Returns:
collection