|
Method Summary
|
|
void
|
clear()
Clears
the color and characters of all cells in the board.
|
|
void
|
fillCell(int x,
int y, Color c)
Sets
the color of the cell at coordinate (x,y) to the color c.
|
|
void
|
fillCells(int xStart,
int yStart, int xEnd, int yEnd, Color c)
Fills
cells within the rectangle defined by (xStart, yStart) and (xEnd,
yEnd) with the color c, where (xStart, yStart) is the coordinate
of the top left-hand coordinate of the rectangle and (xEnd, yEnd)
is that of the bottom right-hand corner.
|
|
Cell[]
|
getCells()
Returns
a single-dimensional array of cell objects making up the board
object.
|
|
Cell[][]
|
getCells2D()
Returns
a two-dimensional array of cell objects making up the board
object.
|
|
char
|
getChar(int x,
int y) Returns
the character drawn at coordinate (x,y).
|
|
char[]
|
getChars()
Returns
the characters stored in the board object as a single-dimensional
array.
|
|
char[][]
|
getChars2D()
Returns
the characters stored in the board object as a two-dimensional
array.
|
|
int
|
getCols()
Returns
number of columns in the board object.
|
|
Color
|
getLineColor()
Returns
the current color of the grid line pen.
|
|
int
|
getRows()
Returns
number of rows in the board object.
|
|
boolean
|
isMarked(int x,
int y) Returns
true if a cell (x,y) is marked, false otherwise.
|
|
boolean
|
isOn(int x,
int y) Returns
true if cell (x,y) has a color attribute, false otherwise.
|
|
void
|
mark(int x,
int y) Marks
a cell with a boolean flag to allow for more complex operations on
a board object.
|
|
void
|
pause()
Pauses
the repainting of the board object for 10 milliseconds.
|
|
void
|
pause(int msec)
Pauses
the repainting of the board for msec
number of milliseconds.
|
|
void
|
repaint()
Repaints
the graphics of the board object.
|
|
void
|
setChar(int x,
int y, char c) Draws
character c in the cell with coordinate (x,y).
|
|
void
|
setDimension(int c,
int r) Modifies
the dimension of the board according to c and r.
|
|
void
|
setLineColor(Color c)
Sets
the current color of the grid line pen to c.
|
|
String
|
toString()
Return
a string representation of the board object made up of a
sequencing of its characters.
|
|
void
|
turnOff(int x,
int y) Removes
the color attribute of cell (x,y).
|
|
void
|
turnOn(int x,
int y) Sets
the color of cell (x,y) to black.
|
|
void
|
unmark(int x,
int y) Removes
the boolean marking from a cell object at coordinate (x, y).
|
|
void
|
unmarkAll()
Removes
the boolean markings of all cells in the board object.
|