Added GameSchedule View
when open tournament GameSchedule.fxml gets loaded
This commit is contained in:
@@ -46,6 +46,14 @@ public class Factory {
|
||||
setCenterOfBorderPane(pane, getClass().getResource("participantAddFormular/participantFormular.fxml"), factoryDecorator);
|
||||
}
|
||||
|
||||
public void loadPlacesFormular(BorderPane pane, FactoryDecorator factoryDecorator) {
|
||||
setCenterOfBorderPane(pane, getClass().getResource("placesAddFormular/PlacesFormular.fxml"), factoryDecorator);
|
||||
}
|
||||
|
||||
public void loadGameScheduler(BorderPane pane, FactoryDecorator factoryDecorator) {
|
||||
setCenterOfBorderPane(pane, getClass().getResource("gameScheduleView/GameSchedule.fxml"), factoryDecorator);
|
||||
}
|
||||
|
||||
private FXController setCenterOfBorderPane(BorderPane pane, URL location, FactoryDecorator factoryDecorator) {
|
||||
FXController controller = null;
|
||||
try {
|
||||
|
||||
@@ -44,7 +44,7 @@ public class FactoryDecorator implements IsObservable{
|
||||
public void openTournament(FileIO.TournamentFile tournamentFile){
|
||||
try {
|
||||
factory.setTournament(fileIO.loadTournament(tournamentFile));
|
||||
factory.loadParticipantFormular((BorderPane) pane, this); //TODO load TournamentView instead of ParticipantFormular?
|
||||
factory.loadGameScheduler((BorderPane) pane, this);
|
||||
informListener();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
@@ -53,6 +53,13 @@ public class FactoryDecorator implements IsObservable{
|
||||
} //TODO handle and logging
|
||||
}
|
||||
|
||||
public void openParticipantFormular() {
|
||||
factory.loadParticipantFormular((BorderPane) pane, this);
|
||||
}
|
||||
|
||||
public void openPlacesFormular() {
|
||||
factory.loadPlacesFormular((BorderPane) pane, this);
|
||||
}
|
||||
|
||||
public void informListener() {
|
||||
for(IsObserver observer : listener) {
|
||||
|
||||
@@ -107,7 +107,7 @@ public class FileIO {
|
||||
ObjectOutputStream out = null;
|
||||
|
||||
try {
|
||||
newSave.createNewFile();
|
||||
boolean newFile = newSave.createNewFile();
|
||||
out = new ObjectOutputStream(new FileOutputStream(newSave));
|
||||
out.writeObject(tournament);
|
||||
System.out.println("Save File" + tournament.getName() + ".txt being saved to " + saves.getAbsolutePath());
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package ch.zhaw.projekt2.turnierverwaltung.main.gameScheduleView;
|
||||
|
||||
import ch.zhaw.projekt2.turnierverwaltung.FXController;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.ChoiceBox;
|
||||
|
||||
public class GameController extends FXController {
|
||||
|
||||
@FXML
|
||||
private ChoiceBox<?> placesChoiceBox;
|
||||
|
||||
@Override
|
||||
public void loadContent() {
|
||||
|
||||
}
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package ch.zhaw.projekt2.turnierverwaltung.main.gameScheduleView;
|
||||
|
||||
import ch.zhaw.projekt2.turnierverwaltung.FXController;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXML;
|
||||
|
||||
public class GameScheduleController extends FXController {
|
||||
|
||||
@FXML
|
||||
void openPlacesFormular(ActionEvent event) {
|
||||
getFactoryDecorator().openPlacesFormular();
|
||||
}
|
||||
|
||||
@FXML
|
||||
void openParticipantFormular(ActionEvent event) {
|
||||
getFactoryDecorator().openParticipantFormular();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadContent() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
package ch.zhaw.projekt2.turnierverwaltung.main.placesAddFormular;
|
||||
|
||||
import ch.zhaw.projekt2.turnierverwaltung.FXController;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.ListView;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.input.MouseEvent;
|
||||
import javafx.scene.layout.GridPane;
|
||||
|
||||
public class PlacesFormularController extends FXController {
|
||||
|
||||
@FXML
|
||||
private Label AddListTitle;
|
||||
|
||||
@FXML
|
||||
private Button closeBtn;
|
||||
|
||||
@FXML
|
||||
private Button deleteBtn;
|
||||
|
||||
@FXML
|
||||
private GridPane grid;
|
||||
|
||||
@FXML
|
||||
private ListView<?> locationListView;
|
||||
|
||||
@FXML
|
||||
private Label locationNameLabel;
|
||||
|
||||
@FXML
|
||||
private TextField locationNameTextField;
|
||||
|
||||
@FXML
|
||||
private Label newLocationFormularTitle;
|
||||
|
||||
@FXML
|
||||
private Button saveBtn;
|
||||
|
||||
@FXML
|
||||
void changedSelection(MouseEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@FXML
|
||||
void closeFormular(ActionEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@FXML
|
||||
void deleteSelectedPlace(ActionEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@FXML
|
||||
void saveLocation(ActionEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadContent() {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user