|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object PuzzleController
Constructor Summary | |
PuzzleController()
Create Controller not bound to any model --- will cause null pointer exceptions if setModel(m) is not called before any Controller methods are called. |
|
PuzzleController(PuzzleModel model)
Create a controller for the designated model. |
Method Summary | |
void |
addView(PuzzleView view)
Add a view to be updated by this controller when the model changes. |
int |
getModelSize()
Returns the size of the model bound to this controller |
void |
makeMove(PuzzleMove move)
Make a move (presumably results in changes to views) |
void |
setModel(PuzzleModel m)
Set the model for this controller |
void |
showBoard(int[] list)
Update view with new "board", called by model |
void |
undoMove()
Undo the last undoable move (just made or uncovered as a result of an undo). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PuzzleController()
PuzzleController(PuzzleModel)
public PuzzleController(PuzzleModel model)
model
- is the model for this controllerMethod Detail |
public void setModel(PuzzleModel m)
public void addView(PuzzleView view)
view
- is the view added to this controllerpublic int getModelSize()
public void makeMove(PuzzleMove move)
move
- is the move madepublic void undoMove()
public void showBoard(int[] list)
list
- is the board, # elements in list is
getModelSize()*getModelSize().
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |