Issue #83: Server creation dialog need to be polished

- rearranged the layout of all the nodes
- set CSS files for the dialog
- added close button

tags: #story[1273]
This commit is contained in:
Haoming Yin
2017-09-28 11:13:02 +13:00
parent 8b7407bf89
commit 37e4fe4ce7
3 changed files with 100 additions and 54 deletions
@@ -28,12 +28,12 @@ public class ServerCreationController implements Initializable {
@FXML
private JFXSlider maxPlayersSlider;
@FXML
private Label maxPlayersLabel;
@FXML
private JFXButton submitBtn;
@FXML
private Label closeLabel;
@FXML
private Label maxPlayersLabel;
@FXML
private JFXButton nextMapButton;
@FXML
private JFXButton lastMapButton;
@@ -47,11 +47,10 @@ public class ServerCreationController implements Initializable {
private JFXCheckBox pickupsCheckBox;
@FXML
private AnchorPane mapHolder;
//---------FXML END---------//
private MapMaker mapMaker = MapMaker.getInstance();
//---------FXML END---------//
private List<ServerCreationDialogListener> serverCreationDialogListeners;
public void initialize(URL location, ResourceBundle resources) {
@@ -96,7 +95,7 @@ public class ServerCreationController implements Initializable {
mapHolder.getChildren().setAll(mapMaker.getCurrentGameView());
mapNameLabel.setText(mapMaker.getCurrentRegatta().getCourseName());
pickupsCheckBox.setSelected(true);
//closeLabel.setOnMouseClicked(event -> notifyListeners());
closeLabel.setOnMouseClicked(event -> notifyListeners());
}
/**
@@ -134,7 +133,8 @@ public class ServerCreationController implements Initializable {
*/
private void updateMaxPlayerLabel() {
maxPlayersSlider.setValue(Math.floor(maxPlayersSlider.getValue()));
maxPlayersLabel.setText(String.format("Max players: %.0f", maxPlayersSlider.getValue()));
maxPlayersLabel.setText(String
.format("Only %.0f players are allowed into the game", maxPlayersSlider.getValue()));
}
private void updateLegSliderLabel() {