org.almacha.achamaze
Class DrawMaze

java.lang.Object
  extended by 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

Field Summary
private  Maze maze
           
private  java.awt.Color mazeBackgroundColor
           
private  java.awt.Color mazeFilledCellColor
           
private  java.awt.Color mazeWallColor
           
 
Constructor Summary
DrawMaze(Maze maze)
          Constructor for DrawMaze.
 
Method Summary
 void draw(java.awt.Graphics g, java.awt.Dimension displayAreaSize)
          This method draws the maze on g, using a surface of size displayAreaSize.
 java.awt.Color getColorOfPlayer(int n)
          This method returns the color of the n-th player.
 java.awt.Color getMazeBackgroundColor()
           
 java.awt.Color getMazeFilledCellColor()
           
 java.awt.Color getMazeWallColor()
           
 void setMazeBackgroundColor(java.awt.Color mazeBackgroundColor)
           
 void setMazeFilledCellColor(java.awt.Color mazeFilledCellColor)
           
 void setMazeWallColor(java.awt.Color mazeWallColor)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mazeBackgroundColor

private java.awt.Color mazeBackgroundColor

mazeWallColor

private java.awt.Color mazeWallColor

mazeFilledCellColor

private java.awt.Color mazeFilledCellColor

maze

private Maze maze
Constructor Detail

DrawMaze

public DrawMaze(Maze maze)
Constructor for DrawMaze.

Parameters:
maze - The maze to draw.
Method Detail

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 maze
displayAreaSize - 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