public class BoggleController extends Object implements ActionListener
| Modifier and Type | Field and Description |
|---|---|
private Boggle |
model |
private BoggleView |
view |
| Constructor and Description |
|---|
BoggleController()
Creates a controller with no model and no view.
|
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(ActionEvent event)
Responds to events from the view.
|
void |
setModel(Boggle model)
Sets the controller to use the given model.
|
void |
setView(BoggleView view)
Sets the controller to use the given view.
|
private Boggle model
private BoggleView view
public BoggleController()
public void setModel(Boggle model)
model - the model that the controller should usemodel must not be nullpublic void setView(BoggleView view)
view - the view that the controller should useview must not be nullpublic void actionPerformed(ActionEvent event)
BoggleView.ROLL_COMMAND or
BoggleView.SUBMIT_COMMAND.actionPerformed in interface ActionListenerActionListener.actionPerformed(java.awt.event.ActionEvent)event - an event emitted by the view