Package visualizationElements
Klasse ChessBoard
java.lang.Object
visualizationElements.VisualizationElement
visualizationElements.Table
visualizationElements.ChessBoard
Represents a chess board.
-
Feldübersicht
Modifizierer und TypFeldBeschreibungprivate boolean[][]
private static final int
private int
private int
private String
private int
private static final int
private static final int
Von Klasse geerbte Felder visualizationElements.Table
CELL_HEIGHT, CELL_WIDTH, numberOfColumns, numberOfRows, valueTable
-
Konstruktorübersicht
KonstruktorBeschreibungChessBoard
(boolean[][] board, int width, int height, String marking) Creates a new ChessBoard. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprivate void
calculateCellHeigth
(int width, int height, int size) Calculates the height and width of a cell dependent of the height and width of the whole chess board and the number of cells.void
Draws the visualization element.boolean[][]
getBoard()
int
int
int
getSize()
void
setBoard
(boolean[][] board) void
setCellHeight
(int cellHeight) void
setCellWidth
(int cellWidth) void
setMarking
(String marking) void
setSize
(int size) Von Klasse geerbte Methoden visualizationElements.Table
getColumnCaptions, getHeight, getValues, getWidth, setColumnCaptions, setHeight, setValues, setWidth
-
Felddetails
-
START_X_POS
private static final int START_X_POS- Siehe auch:
-
START_Y_POS
private static final int START_Y_POS- Siehe auch:
-
BORDER
private static final int BORDER- Siehe auch:
-
board
private boolean[][] board -
size
private int size -
cellWidth
private int cellWidth -
cellHeight
private int cellHeight -
marking
-
-
Konstruktordetails
-
ChessBoard
Creates a new ChessBoard.- Parameter:
board
- The 2-dimensional array which represents the chess board.width
- Width of the whole chess board.height
- Height of the whole chess board.
-
-
Methodendetails
-
calculateCellHeigth
private void calculateCellHeigth(int width, int height, int size) Calculates the height and width of a cell dependent of the height and width of the whole chess board and the number of cells.- Parameter:
width
- Width of the chess board.height
- Height of the chess board.size
- Number of cells in one row/column
-
draw
Beschreibung aus Klasse kopiert:VisualizationElement
Draws the visualization element. -
setBoard
public void setBoard(boolean[][] board) - Parameter:
board
- the board to set
-
getBoard
public boolean[][] getBoard()- Gibt zurück:
- the board
-
setSize
public void setSize(int size) - Parameter:
size
- the size to set
-
getSize
public int getSize()- Gibt zurück:
- the size
-
getCellWidth
public int getCellWidth()- Gibt zurück:
- the width of a cell
-
setCellWidth
public void setCellWidth(int cellWidth) - Parameter:
cellWidth
-
-
getCellHeight
public int getCellHeight()- Gibt zurück:
- the height of a cell
-
setCellHeight
public void setCellHeight(int cellHeight) - Parameter:
cellHeight
-
-
getMarking
- Gibt zurück:
- the marking
-
setMarking
- Parameter:
marking
- The marking of the chess board.
-