B C D G I M P R S T U X Y

B

Board - Class in <Unnamed>
A generic board that, together with Piece, can be used to display board games.
Board(int, int) - Constructor for class Board
Creates a playing board with the given number of rows and columns.

C

canMove(int, int) - Method in class Piece
Determines whether this piece can be moved to the new location.
canMoveTo(int, int) - Method in class Piece
Determines whether this piece can be moved to the specified location.
clear() - Method in class Board
Removes all Pieces from this Board.
columnToX(int) - Method in class Board
Returns the X coordinate of the left side of cells in the given column of this Board.

D

dump() - Method in class Piece
Debugging method to print out the status of this Piece.

G

getBoard() - Method in class Piece
 
getColumn() - Method in class Piece
Returns the column that this piece is in, or -1 if this piece is not on the board.
getColumns() - Method in class Board
Returns the number of columns in this Board.
getJPanel() - Method in class Board
Returns the JPanel on which this board is displayed.
getPiece(int, int) - Method in class Board
Returns the topmost piece at the given row and column in this Board, or null if the given location is empty.
getPieces(int, int) - Method in class Board
Returns a (possibly empty) Stack of all the pieces in the given position.
getRow() - Method in class Piece
Returns the row that this piece is in, or -1 if this piece is not on the board.
getRows() - Method in class Board
Returns the number of rows in this Board.
getSelectedColumn() - Method in class Board
Returns the column number (counting from zero) of the currently selected square, or -1 if none is selected.
getSelectedPiece() - Method in class Board
Returns the currently selected Piece, or null if no Piece has been selected on this Board.
getSelectedRow() - Method in class Board
Returns the row number (counting from zero) of the currently selected square, or -1 if none is selected.
getSpeed() - Method in class Board
Returns the default speed (in squares per second) of pieces on this board.
getSpeed() - Method in class Piece
Get the speed (in pixels/redraw) at which this piece will move.

I

isDraggable() - Method in class Piece
Returns true if the piece can be dragged by the mouse.
isEmpty(int, int) - Method in class Board
Returns true if the given row and column on this board contains no Pieces.
isLegalPosition(int, int) - Method in class Board
Determines whether the given row and column denote a legal position on this Board.
isSelectable(int, int) - Method in class Board
Returns true to indicate that this square of the board can be selected; override this method to provide different behavior.
isSelectable() - Method in class Piece
Returns true if the piece can be selected by the mouse.

M

move(int, int) - Method in class Piece
Moves this piece the given number of rows and columns.
moveTo(int, int) - Method in class Piece
Moves this piece to a new position on the board.
moveToTop() - Method in class Piece
Ensures that this piece will be drawn on top of any other pieces in the same array location.

P

paint(Graphics) - Method in class Board
Paints this board, not including the pieces.
paint(Graphics, Rectangle) - Method in class Piece
Paints this piece on the board within the given rectangle; must be implemented by a subclass.
Piece - Class in <Unnamed>
An abstract class that represents a playing piece.
Piece() - Constructor for class Piece
Creates a Piece.
place(Piece, int, int) - Method in class Board
Places the given piece at the given location in this board.
place(Board, int, int) - Method in class Piece
Places this piece at the given row and column on the board.

R

redraw() - Method in class Piece
Causes this piece to be redrawn.
redraw(Rectangle) - Method in class Piece
Causes the given rectangle to be redrawn.
remove(int, int) - Method in class Board
Removes the top piece at the given row and column on this Board.
remove(Piece) - Method in class Board
Removes this piece from the board.
remove() - Method in class Piece
Removes this piece from whatever board it may be on, but does not delete the piece itself.
rowToY(int) - Method in class Board
Returns the Y coordinate of the top side of cells in the given column of this Board.

S

setDraggable(boolean) - Method in class Piece
Determines whether the piece can be dragged by the mouse.
setSelectable(boolean) - Method in class Piece
Determines whether the piece can be selected by the mouse.
setSelectedPiece(Piece) - Method in class Board
Mark the given Piece as the selected one; unmark any previously selected Piece.
setSelectedSquare(int, int) - Method in class Board
If the given square is selectable, select it, otherwise do nothing.
setSpeed(int) - Method in class Board
Sets the default speed of movement for pieces on this board, in squares per second.
setSpeed(int) - Method in class Piece
Sets the speed of movement (in squares/second) for this piece.

T

toString() - Method in class Piece
Returns a printable String representing this Piece.

U

unselectPiece() - Method in class Board
Causes no piece on this Board to be selected.
unselectSquare() - Method in class Board
Unselects the currently selected square, if any.
update(Observable, Object) - Method in class Board
Redraws this Board whenever a Piece is modified.

X

xToColumn(int) - Method in class Board
Given an x coordinate, determines which column it is in.

Y

yToRow(int) - Method in class Board
Given a y coordinate, determines which row it is in.

B C D G I M P R S T U X Y