org.almacha.achamaze
Class DrawMaze
java.lang.Object
org.almacha.achamaze.DrawMaze
public class DrawMaze
- extends java.lang.Object
This class enables you to display a maze (class Maze) on the screen.
- Author:
- Raphael Champeimont
|
Constructor Summary |
DrawMaze(Maze maze)
Constructor for DrawMaze. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
mazeBackgroundColor
private java.awt.Color mazeBackgroundColor
mazeWallColor
private java.awt.Color mazeWallColor
mazeFilledCellColor
private java.awt.Color mazeFilledCellColor
maze
private Maze maze
DrawMaze
public DrawMaze(Maze maze)
- Constructor for DrawMaze.
- Parameters:
maze - The maze to draw.
draw
public void draw(java.awt.Graphics g,
java.awt.Dimension displayAreaSize)
- This method draws the maze on g, using a surface of size displayAreaSize.
- Parameters:
g - the Graphics object to use to draw the mazedisplayAreaSize - the size of the rectangle on which the maze will be drawn
getMazeBackgroundColor
public java.awt.Color getMazeBackgroundColor()
setMazeBackgroundColor
public void setMazeBackgroundColor(java.awt.Color mazeBackgroundColor)
getMazeFilledCellColor
public java.awt.Color getMazeFilledCellColor()
setMazeFilledCellColor
public void setMazeFilledCellColor(java.awt.Color mazeFilledCellColor)
getMazeWallColor
public java.awt.Color getMazeWallColor()
setMazeWallColor
public void setMazeWallColor(java.awt.Color mazeWallColor)
getColorOfPlayer
public java.awt.Color getColorOfPlayer(int n)
- This method returns the color of the n-th player.
If player n does not exist, the returned color is unspecified.
- Returns:
- color of n-th player