|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.gridworld.gui.GUIController<T>
public class GUIController<T>
The GUIController controls the behavior in a WorldFrame.
This code is not tested on the AP CS A and AB exams. It contains GUI
implementation details that are not intended to be understood by AP CS
students.
| Field Summary | |
|---|---|
static int |
FIXED_STEPS
|
static int |
INDEFINITE
|
static int |
PROMPT_STEPS
|
| Constructor Summary | |
|---|---|
GUIController(WorldFrame<T> parent,
GridPanel disp,
DisplayMap displayMap,
java.util.ResourceBundle res)
Creates a new controller tied to the specified display and gui frame. |
|
| Method Summary | |
|---|---|
javax.swing.JComponent |
controlPanel()
Returns the panel containing the controls. |
void |
deleteLocation()
Edits the contents of the current location, by displaying the constructor or method menu. |
void |
editLocation()
Edits the contents of the current location, by displaying the constructor or method menu. |
boolean |
isRunning()
|
void |
run()
Starts a timer to repeatedly carry out steps at the speed currently indicated by the speed slider up Depending on the run option, it will either carry out steps for some fixed number or indefinitely until stopped. |
void |
step()
Advances the world one step. |
void |
stop()
Stops any existing timer currently carrying out steps. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int INDEFINITE
public static final int FIXED_STEPS
public static final int PROMPT_STEPS
| Constructor Detail |
|---|
public GUIController(WorldFrame<T> parent,
GridPanel disp,
DisplayMap displayMap,
java.util.ResourceBundle res)
parent - the frame for the world windowdisp - the panel that displays the griddisplayMap - the map for occupant displaysres - the resource bundle for message display| Method Detail |
|---|
public void step()
public void run()
public void stop()
public boolean isRunning()
public javax.swing.JComponent controlPanel()
public void editLocation()
public void deleteLocation()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||