Interface BoardListener
- public interface BoardListener
Interface for receiving GraphicalBoard events. Note that the events
must first be enabled using setResizable() and setClickable().
- See Also:
- GraphicalBoard
-
boardClicked(int, int)
- Invoked when the user clicks on a square inside the board.
-
boardResized(int, int)
- Invoked after the user has dragged the board to a new size.
boardResized
public abstract void boardResized(int new_width,
int new_height)
- Invoked after the user has dragged the board to a new size. The size
of a KnightBoard object cannot be changed, so the current board should
be dispensed with and a new one of the correct size created.
- Parameters:
- new_width - new width of the board in squares.
- new_height - new height of the board in squares.
- See Also:
- setResizable
boardClicked
public abstract void boardClicked(int squarex,
int squarey)
- Invoked when the user clicks on a square inside the board.
- Parameters:
- squarex - x-index of the selected square.
- squarey - y-index of the selected square.
- See Also:
- setClickable