package comp1110.ass2.gui; import javafx.application.Application; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.control.TextField; import javafx.scene.layout.HBox; import javafx.stage.Stage; public class Viewer extends Application { private static final int VIEWER_WIDTH = 1200; private static final int VIEWER_HEIGHT = 700; private final Group root = new Group(); private final Group controls = new Group(); private TextField stateTextField; /** * Given a state string, draw a representation of the state * on the screen. *
* This may prove useful for debugging complex states.
*
* @param stateString a string representing a game state
*/
void displayState(String stateString) {
// FIXME Task 5
}
/**
* Create a basic text field for input and a refresh button.
*/
private void makeControls() {
Label playerLabel = new Label("Game State:");
stateTextField = new TextField();
stateTextField.setPrefWidth(200);
Button button = new Button("Refresh");
button.setOnAction(new EventHandler