|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.refractions.udig.project.render.TileCalculator
public class TileCalculator
A helper class which divides an area into tiles or a minimum size. Provides a number of convenience methods.
Constructor Summary | |
---|---|
TileCalculator(java.awt.geom.AffineTransform worldToScreen,
java.awt.Dimension tileSize)
Creates a new instance, the bounds must be set before it is ready to be used. |
|
TileCalculator(java.awt.geom.AffineTransform worldToScreen,
java.awt.Dimension tileSize,
Envelope bounds)
Creates a new instance. |
Method Summary | |
---|---|
Envelope |
getBounds()
|
java.awt.Rectangle |
getScreenRandom()
Gets a random tile in screen coordinates. |
java.awt.Rectangle |
getScreenTile(int x,
int y)
Return the Rectangle (screen coordinates) of the tile indexed by x and y. |
java.awt.geom.Dimension2D |
getTileSize()
|
Envelope |
getWorldRandom()
Gets a random tile in world coordinates. |
Envelope |
getWorldTile(int x,
int y)
Return the Envelope (world coordinates) of the tile indexed by x and y. |
java.awt.geom.AffineTransform |
getWorldToScreen()
|
int |
numXTiles()
Returns the number of tiles in the X-direction |
int |
numYTiles()
Returns the number of tiles in the Y-direction |
void |
resetRandomizer()
Resets so that the getRandom() will clear its cache of visited tiles. |
void |
setBounds(Envelope bounds)
|
void |
setTileSize(java.awt.Dimension tileSize)
|
void |
setWorldToScreen(java.awt.geom.AffineTransform worldToScreen)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TileCalculator(java.awt.geom.AffineTransform worldToScreen, java.awt.Dimension tileSize)
worldToScreen
- the transform from world coordinates to screen coordinatestileSize
- the size of the tiles to create.public TileCalculator(java.awt.geom.AffineTransform worldToScreen, java.awt.Dimension tileSize, Envelope bounds)
worldToScreen
- the transform from world coordinates to screen coordinatestileSize
- the size of the tiles to create.Method Detail |
---|
public int numXTiles()
public int numYTiles()
public Envelope getWorldTile(int x, int y)
public java.awt.Rectangle getScreenTile(int x, int y)
public void resetRandomizer()
public Envelope getWorldRandom()
WARNING:
If each tile is visited one and only once regardless of whether getWorldRandom()
or
getScreenRandom()
is used
public java.awt.Rectangle getScreenRandom()
WARNING:
If each tile is visited one and only once regardless of whether getWorldRandom()
or
getScreenRandom()
is used
public Envelope getBounds()
public void setBounds(Envelope bounds)
bounds
- The bounds to set.public java.awt.geom.Dimension2D getTileSize()
public void setTileSize(java.awt.Dimension tileSize)
tileSize
- The tileSize to set.public java.awt.geom.AffineTransform getWorldToScreen()
public void setWorldToScreen(java.awt.geom.AffineTransform worldToScreen)
worldToScreen
- The worldToScreen to set.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |