Get RobotChase at SourceForge.net. Fast, secure and Free Open Source software downloads

org.gcs.robot
Class RCTile

java.lang.Object
  extended by org.gcs.robot.RCTile

public class RCTile
extends Object

The RCTile class handles drawing individual tiles on behalf of RCView. Together, tileWidth and tileHeight determine the aspect ratio of the tiles. RCTile also exports static conversion methods for tile geometry.

Author:
John B. Matthews
See Also:
RCView, RCImage

Field Summary
static int tileHeight
          The height of a tile.
static int tileWidth
          The width of a tile.
 
Constructor Summary
RCTile(RCView panel, int row, int col)
          Construct a tile for the given row & column on a panel.
 
Method Summary
 void paint(Graphics g)
          Ask this tile to draw it's current image.
static int pixelX(int col)
          Convert a tile column number into an x pixel coordinate.
static int pixelY(int row)
          Convert a tile row number into a y pixel coordinate.
 void repaint()
           
 void setHilite(boolean hilite)
           
 void setImg(Image image)
          Tell this tile what image it will draw.
static int tileCol(int x)
          Convert an x pixel coordinate into a tile column number.
static int tileRow(int y)
          Convert a y pixel coordinate into a tile row number.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tileWidth

public static final int tileWidth
The width of a tile.

See Also:
Constant Field Values

tileHeight

public static final int tileHeight
The height of a tile.

See Also:
Constant Field Values
Constructor Detail

RCTile

public RCTile(RCView panel,
              int row,
              int col)
Construct a tile for the given row & column on a panel.

Parameters:
panel - this tile's parent panel
row - this tile's row
col - this tile's column
Method Detail

tileCol

public static int tileCol(int x)
Convert an x pixel coordinate into a tile column number.


tileRow

public static int tileRow(int y)
Convert a y pixel coordinate into a tile row number.


pixelX

public static int pixelX(int col)
Convert a tile column number into an x pixel coordinate.


pixelY

public static int pixelY(int row)
Convert a tile row number into a y pixel coordinate.


setImg

public void setImg(Image image)
Tell this tile what image it will draw.


setHilite

public void setHilite(boolean hilite)

repaint

public void repaint()

paint

public void paint(Graphics g)
Ask this tile to draw it's current image.


Get RobotChase at SourceForge.net. Fast, secure and Free Open Source software downloads

Copyright © 2007 Gem City Software. Distributed under the terms of the GPL