| java.lang.Object net.refractions.udig.project.render.TileCalculator
TileCalculator | public class TileCalculator (Code) | | A helper class which divides an area into tiles or a minimum size. Provides a
number of convenience methods.
author: jones |
TileCalculator | public TileCalculator(AffineTransform worldToScreen, Dimension tileSize)(Code) | | Creates a new instance, the bounds must be set before it is ready to be used.
Parameters: worldToScreen - the transform from world coordinates to screen coordinates Parameters: tileSize - the size of the tiles to create. |
TileCalculator | public TileCalculator(AffineTransform worldToScreen, Dimension tileSize, Envelope bounds)(Code) | | Creates a new instance. It is ready to be queried immediately.
Parameters: worldToScreen - the transform from world coordinates to screen coordinates Parameters: tileSize - the size of the tiles to create. |
getBounds | public Envelope getBounds()(Code) | | Returns the bounds. |
getScreenTile | public Rectangle getScreenTile(int x, int y)(Code) | | Return the Rectangle (screen coordinates) of the tile indexed by x and y.
the Rectangle (screen coordinates) of the tile indexed by x and y. |
getWorldRandom | public Envelope getWorldRandom()(Code) | | Gets a random tile in world coordinates. Each tile is visited only once and after all the tiles
have been visited null will be returned.
WARNING:
If each tile is visited one and only once regardless of whether
TileCalculator.getWorldRandom() or
TileCalculator.getScreenRandom() is used
a random tile in world coordinates. |
getWorldTile | public Envelope getWorldTile(int x, int y)(Code) | | Return the Envelope (world coordinates) of the tile indexed by x and y.
the Envelope (world coordinates) of the tile indexed by x and y. |
numXTiles | public int numXTiles()(Code) | | Returns the number of tiles in the X-direction
|
numYTiles | public int numYTiles()(Code) | | Returns the number of tiles in the Y-direction
|
resetRandomizer | public void resetRandomizer()(Code) | | Resets so that the getRandom() will clear its cache of visited tiles.
|
setBounds | public void setBounds(Envelope bounds)(Code) | | Parameters: bounds - The bounds to set. |
setTileSize | public void setTileSize(Dimension tileSize)(Code) | | Parameters: tileSize - The tileSize to set. |
setWorldToScreen | public void setWorldToScreen(AffineTransform worldToScreen)(Code) | | Parameters: worldToScreen - The worldToScreen to set. |
|
|