|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface IIgelView
The GUI for a game of Igel Argern
| Method Summary | |
|---|---|
void |
addCellActionListener(CellActionListener cellActionListener)
Add the specified listener to each cell in the board. |
void |
addMenu(javax.swing.JMenuBar menu)
Add a menu |
void |
addMouseListener(int row,
int col,
java.awt.event.MouseListener listener)
Add the specified mouse listener to the sell at location [row, col] |
void |
addPassSidewaysMovePressedListener(java.awt.event.ActionListener actionListener)
Add a listener to respond when the user presses the "passSidewaysMove" button. |
void |
clearProposedMove()
Cancels any currently displayed proposed moves. |
void |
close()
Close the view (i.e., close and dispose of the underlying JFrame). |
void |
displayDialogMessage(java.lang.String message,
java.lang.String title)
Display a message in a dialog box |
void |
enableSidewaysViewButton(boolean enable)
Enable or disable the "Pass Sideways Move" button |
void |
setProposedMoveSource(int row,
int column)
Mark this cell as the starting point of a proposed move. |
void |
setProposedMoveTarget(int row,
int column,
int player)
Specify that the user has proposed moving a hedgehog into the given cell. |
void |
update(IGameState state)
Update the view to reflect the current game state. |
void |
updateDie(int newValue)
Update the die to show the results of a recent roll |
void |
updateMessage(java.lang.String newMessage)
Updates the message that is displayed. |
| Method Detail |
|---|
void addCellActionListener(CellActionListener cellActionListener)
cellActionListener - the listener
void addMouseListener(int row,
int col,
java.awt.event.MouseListener listener)
[row, col]
row - the rowcol - the columnlistener - a MouseListenervoid update(IGameState state)
state - the current game state
void setProposedMoveTarget(int row,
int column,
int player)
row - the rowcolumn - the columnplayer - the player number
java.lang.IllegalArgumentException - if either row or column are out of range.void clearProposedMove()
void updateMessage(java.lang.String newMessage)
newMessage - the new message to displayvoid updateDie(int newValue)
newValue - the new value for the die
void setProposedMoveSource(int row,
int column)
row - the rowcolumn - the column
java.lang.IllegalArgumentException - if either row or column is not validvoid addPassSidewaysMovePressedListener(java.awt.event.ActionListener actionListener)
actionListener - a listener to respond when the user presses the "passSidewaysMove" button.void enableSidewaysViewButton(boolean enable)
enable - true if the button is to be enabled, false if the button is to be disabled.
void displayDialogMessage(java.lang.String message,
java.lang.String title)
message - the main message (the one that appears in the center of the box)title - the title of the dialog boxvoid close()
JFrame).
void addMenu(javax.swing.JMenuBar menu)
menu - the menu
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||