package playerWindow; import java.awt.event.*; /** * PlayerWindowListener - an interface which Player implementations * must implement in order to handle the events generated by the * PlayerWindow. See the documentation of PlayerWindow and * PlayerWindowEvent. **/ public interface PlayerWindowListener { /** * onExitGame must be implemented by the Player implementation. * * The contents should be what happens when the player presses the * "Exit"-button (and what should happen is obvious) **/ public void onExitGame(PlayerWindowEvent e); /** * onNewGame must be implemented by the Player implementation. * * The contents should be what happens when the player presses the * "New Game"-button. Note that "New Game" may be pressed anytime * while the window is up, including while waiting for the server, * waiting for a playmate, in the middle of a game and, of course, * when one game is over. **/ public void onNewGame(PlayerWindowEvent e); /** * onBoardClicked must be implemented by the Player * implementation. * * The contents should be what happens when the player clicks in a * square in the board. It is possible to disable and enable * board clicking (see the documentation of PlayerWindow), and * the Player implementation is responsible of doing this at the * right moments, or take the consequences of non-disabled boards. **/ public void onBoardClicked(PlayerWindowEvent e); }