2021-11-14 23:00:07 +01:00
|
|
|
package client;
|
|
|
|
|
|
|
|
import javafx.fxml.FXML;
|
2021-11-25 11:34:33 +01:00
|
|
|
import javafx.fxml.FXMLLoader;
|
2021-11-25 15:04:40 +01:00
|
|
|
import javafx.scene.Node;
|
2021-11-25 11:34:33 +01:00
|
|
|
import javafx.scene.Scene;
|
2021-11-14 23:00:07 +01:00
|
|
|
import javafx.scene.control.Label;
|
|
|
|
import javafx.scene.layout.GridPane;
|
|
|
|
import javafx.scene.layout.VBox;
|
|
|
|
import javafx.scene.paint.Color;
|
2021-11-25 11:34:33 +01:00
|
|
|
import javafx.stage.Modality;
|
|
|
|
import javafx.stage.Stage;
|
2021-11-14 23:00:07 +01:00
|
|
|
import res.Event;
|
2021-11-15 13:17:43 +01:00
|
|
|
import res.DataController;
|
2021-11-14 23:00:07 +01:00
|
|
|
|
2021-11-25 15:04:40 +01:00
|
|
|
import javafx.event.ActionEvent;
|
2021-11-25 11:34:33 +01:00
|
|
|
import java.io.IOException;
|
|
|
|
import java.util.Objects;
|
|
|
|
|
2021-11-14 23:00:07 +01:00
|
|
|
public class MainController {
|
|
|
|
@FXML
|
|
|
|
private GridPane calendarGrid;
|
|
|
|
|
|
|
|
@FXML
|
|
|
|
private VBox vBoxMon;
|
|
|
|
@FXML
|
|
|
|
private VBox vBoxTue;
|
|
|
|
@FXML
|
|
|
|
private VBox vBoxWen;
|
|
|
|
@FXML
|
|
|
|
private VBox vBoxThu;
|
|
|
|
@FXML
|
|
|
|
private VBox vBoxFri;
|
|
|
|
@FXML
|
|
|
|
private VBox vBoxSat;
|
|
|
|
@FXML
|
|
|
|
private VBox vBoxSun;
|
|
|
|
|
|
|
|
|
|
|
|
@FXML
|
|
|
|
protected void onAddBtnClick(){
|
2021-11-25 11:34:33 +01:00
|
|
|
try{
|
|
|
|
FXMLLoader fxmlLoader = new FXMLLoader(MainApplication.class.getResource("create-event.fxml"));
|
2021-11-25 15:04:40 +01:00
|
|
|
Scene scene = new Scene(fxmlLoader.load(), 700, 500);
|
2021-11-25 11:34:33 +01:00
|
|
|
scene.getStylesheets().add(Objects.requireNonNull(MainApplication.class.getResource("create-event.css")).toExternalForm());
|
|
|
|
Stage stage = new Stage();
|
|
|
|
stage.setTitle("Termin erstellen");
|
|
|
|
stage.setScene(scene);
|
|
|
|
stage.initModality(Modality.APPLICATION_MODAL);
|
2021-11-25 15:04:40 +01:00
|
|
|
stage.setResizable(false);
|
2021-11-25 11:34:33 +01:00
|
|
|
stage.showAndWait();
|
|
|
|
}
|
|
|
|
catch (IOException e){
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-11-15 13:17:43 +01:00
|
|
|
DataController dataController = new DataController();
|
|
|
|
Event[] eventList = dataController.getAllEvents();
|
2021-11-14 23:00:07 +01:00
|
|
|
|
|
|
|
for(Event event : eventList){
|
|
|
|
Label label = new Label();
|
|
|
|
label.setText(event.toString());
|
|
|
|
label.setTextFill(Color.WHITE);
|
|
|
|
vBoxWen.getChildren().add(label);
|
|
|
|
}
|
|
|
|
}
|
2021-11-25 15:04:40 +01:00
|
|
|
|
|
|
|
@FXML
|
|
|
|
protected void createBtnClick(ActionEvent event){
|
|
|
|
Stage stage = (Stage) ((Node) event.getSource()).getScene().getWindow();
|
|
|
|
stage.close();
|
|
|
|
}
|
2021-11-14 23:00:07 +01:00
|
|
|
}
|