Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7dea7919c5 | ||
|
|
55517a531e |
@@ -252,7 +252,7 @@ public class Tournament implements Serializable {
|
||||
* (In the Prototype only the KO-System has full functionality
|
||||
*/
|
||||
public enum Type {
|
||||
KO("KO-System"); //GROUPS("Gruppenspiele"); //Type GROUPS is not implemented in this prototype.
|
||||
KO("KO-System"), GROUPS("Gruppenspiele");
|
||||
|
||||
private String name;
|
||||
|
||||
|
||||
@@ -32,8 +32,6 @@ public class MainWindow extends Application {
|
||||
|
||||
Scene scene = new Scene(pane);
|
||||
primaryStage.setScene(scene);
|
||||
primaryStage.setMinHeight(600);
|
||||
primaryStage.setMinWidth(800);
|
||||
primaryStage.setMaximized(true);
|
||||
primaryStage.setResizable(true);
|
||||
primaryStage.setFullScreen(false);
|
||||
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package ch.zhaw.projekt2.turnierverwaltung.main.gameScheduleView;
|
||||
|
||||
import javafx.scene.control.Alert;
|
||||
import javafx.scene.control.ButtonBar;
|
||||
import javafx.scene.control.ButtonType;
|
||||
|
||||
public class AlertNewSchedule extends Alert {
|
||||
private ButtonType yesButton = new ButtonType("Ja", ButtonBar.ButtonData.YES);
|
||||
private ButtonType noButton = new ButtonType("Nein", ButtonBar.ButtonData.NO);
|
||||
private boolean result;
|
||||
|
||||
public AlertNewSchedule() {
|
||||
super(AlertType.WARNING);
|
||||
setTitle("Neu erstellen");
|
||||
setHeaderText("Spielplan neu erstellen?");
|
||||
setContentText("Sind Sie sicher, dass Sie den Spielplan neu erstellen moechten?\nAlle Spielfortschritte gehen daraufhin verloren!");
|
||||
getButtonTypes().setAll(yesButton,noButton);
|
||||
}
|
||||
|
||||
public boolean showAndGetResult() {
|
||||
showAndWait().ifPresent(input -> {
|
||||
result = input == yesButton;
|
||||
});
|
||||
return result;
|
||||
}
|
||||
}
|
||||
+8
-2
@@ -1,7 +1,6 @@
|
||||
package ch.zhaw.projekt2.turnierverwaltung.main.gameScheduleView;
|
||||
|
||||
import ch.zhaw.projekt2.turnierverwaltung.FXController;
|
||||
import ch.zhaw.projekt2.turnierverwaltung.Tournament;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.Button;
|
||||
@@ -30,7 +29,14 @@ public class GameScheduleController extends FXController {
|
||||
|
||||
@FXML
|
||||
void createNewSchedule(ActionEvent event) {
|
||||
getTournamentDecorator().createNewGameSchedule();
|
||||
if (getTournamentDecorator().getTournament().getGameList().size() > 0) {
|
||||
AlertNewSchedule alert = new AlertNewSchedule();
|
||||
if (alert.showAndGetResult()) {
|
||||
getTournamentDecorator().createNewGameSchedule();
|
||||
}
|
||||
} else {
|
||||
getTournamentDecorator().createNewGameSchedule();
|
||||
}
|
||||
}
|
||||
|
||||
@FXML
|
||||
|
||||
+1
-3
@@ -21,9 +21,7 @@ public class AlertDelete extends Alert {
|
||||
public boolean showAndGetResult() {
|
||||
result = false;
|
||||
showAndWait().ifPresent(type -> {
|
||||
if (type == yesButton) {
|
||||
result = true;
|
||||
}
|
||||
result = type == yesButton;
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
+16
-24
@@ -1,29 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.CheckBox?>
|
||||
<?import javafx.scene.control.ScrollPane?>
|
||||
<?import javafx.scene.layout.BorderPane?>
|
||||
<?import javafx.scene.layout.HBox?>
|
||||
<?import javafx.geometry.*?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
|
||||
<BorderPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/18" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ch.zhaw.projekt2.turnierverwaltung.main.gameScheduleView.GameScheduleController">
|
||||
<center>
|
||||
<ScrollPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="200.0" prefWidth="200.0" BorderPane.alignment="CENTER">
|
||||
<content>
|
||||
<HBox fx:id="hBoxCenter" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="324.0" prefWidth="600.0" />
|
||||
</content>
|
||||
</ScrollPane>
|
||||
</center>
|
||||
<BorderPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/11.0.2" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ch.zhaw.projekt2.turnierverwaltung.main.gameScheduleView.GameScheduleController">
|
||||
<top>
|
||||
<HBox alignment="CENTER_LEFT" prefHeight="100.0" prefWidth="200.0" BorderPane.alignment="CENTER">
|
||||
<HBox alignment="TOP_RIGHT" prefHeight="100.0" prefWidth="200.0" BorderPane.alignment="CENTER">
|
||||
<children>
|
||||
<CheckBox fx:id="treeView" mnemonicParsing="false" onAction="#changeView" selected="true" text="Baumansicht">
|
||||
<HBox.margin>
|
||||
<Insets left="20.0" right="20.0" />
|
||||
</HBox.margin>
|
||||
</CheckBox>
|
||||
<Button fx:id="createScheduleBtn" mnemonicParsing="false" onAction="#createNewSchedule" text="Spielplan neu erstellen">
|
||||
<CheckBox fx:id="treeView" mnemonicParsing="false" onAction="#changeView" selected="true" text="Baumansicht" />
|
||||
<Button fx:id="createScheduleBtn" mnemonicParsing="false" onAction="#createNewSchedule" text="Create New Game Schedule">
|
||||
<HBox.margin>
|
||||
<Insets right="20.0" />
|
||||
</HBox.margin>
|
||||
@@ -38,12 +24,18 @@
|
||||
<Insets right="20.0" />
|
||||
</HBox.margin>
|
||||
</Button>
|
||||
<Button fx:id="closeTournamentBtn" mnemonicParsing="false" onAction="#closeTournament" text="Close Tournament">
|
||||
<Button fx:id="closeTournamentBtn" layoutX="470.0" layoutY="10.0" mnemonicParsing="false" onAction="#closeTournament" text="Close Tournament">
|
||||
<HBox.margin>
|
||||
<Insets right="20.0" />
|
||||
</HBox.margin>
|
||||
</Button>
|
||||
</HBox.margin></Button>
|
||||
</children>
|
||||
</HBox>
|
||||
</top>
|
||||
<center>
|
||||
<ScrollPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="200.0" prefWidth="200.0" BorderPane.alignment="CENTER">
|
||||
<content>
|
||||
<HBox fx:id="hBoxCenter" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="324.0" prefWidth="600.0" />
|
||||
</content>
|
||||
</ScrollPane>
|
||||
</center>
|
||||
</BorderPane>
|
||||
|
||||
Reference in New Issue
Block a user