From da8e4e764c4aa51a8439afac926ff37ea512bdd0 Mon Sep 17 00:00:00 2001 From: Hassan Date: Thu, 3 Nov 2022 19:59:52 +0100 Subject: [PATCH 01/11] Added: admin space views, controllers and necessary entities --- .../com/example/werkplekkenfrontend/Main.java | 3 +- .../AdminEditMeetingroomViewController.java | 28 ++++++++ .../AdminEditWorkspaceViewController.java | 27 ++++++++ .../controllers/AdminViewSpaceController.java | 41 +++++++++++ .../werkplekkenfrontend/models/Facility.java | 35 ++++++++++ .../werkplekkenfrontend/models/Floor.java | 37 ++++++++++ .../werkplekkenfrontend/models/Space.java | 37 ++++++++++ .../werkplekkenfrontend/admin-space-view.fxml | 64 +++++++++++++++++ .../space-view-edit-meetingroom.fxml | 68 +++++++++++++++++++ .../space-view-edit-workspace.fxml | 48 +++++++++++++ 10 files changed, 386 insertions(+), 2 deletions(-) create mode 100644 src/main/java/com/example/werkplekkenfrontend/controllers/AdminEditMeetingroomViewController.java create mode 100644 src/main/java/com/example/werkplekkenfrontend/controllers/AdminEditWorkspaceViewController.java create mode 100644 src/main/java/com/example/werkplekkenfrontend/controllers/AdminViewSpaceController.java create mode 100644 src/main/java/com/example/werkplekkenfrontend/models/Facility.java create mode 100644 src/main/java/com/example/werkplekkenfrontend/models/Floor.java create mode 100644 src/main/java/com/example/werkplekkenfrontend/models/Space.java create mode 100644 src/main/resources/com/example/werkplekkenfrontend/admin-space-view.fxml create mode 100644 src/main/resources/com/example/werkplekkenfrontend/space-view-edit-meetingroom.fxml create mode 100644 src/main/resources/com/example/werkplekkenfrontend/space-view-edit-workspace.fxml diff --git a/src/main/java/com/example/werkplekkenfrontend/Main.java b/src/main/java/com/example/werkplekkenfrontend/Main.java index 5286aa5..218a132 100644 --- a/src/main/java/com/example/werkplekkenfrontend/Main.java +++ b/src/main/java/com/example/werkplekkenfrontend/Main.java @@ -2,7 +2,6 @@ import com.example.werkplekkenfrontend.controllers.*; import javafx.application.Application; -import javafx.scene.Scene; import javafx.stage.Stage; public class Main extends Application { @@ -11,7 +10,7 @@ public class Main extends Application { @Override public void start(Stage stage) { Main.sceneController.setStage(stage); - ViewController controller = sceneController.showView("admin-view.fxml"); + ViewController controller = sceneController.showView("admin-buildings-view.fxml"); controller.updateView(); // testAdminBuildingsViewController(); // testAdminEditBuildingViewController(); diff --git a/src/main/java/com/example/werkplekkenfrontend/controllers/AdminEditMeetingroomViewController.java b/src/main/java/com/example/werkplekkenfrontend/controllers/AdminEditMeetingroomViewController.java new file mode 100644 index 0000000..73941cf --- /dev/null +++ b/src/main/java/com/example/werkplekkenfrontend/controllers/AdminEditMeetingroomViewController.java @@ -0,0 +1,28 @@ +package com.example.werkplekkenfrontend.controllers; + +import com.example.werkplekkenfrontend.Main; +import javafx.event.ActionEvent; +import javafx.fxml.FXML; + +public class AdminEditMeetingroomViewController implements ViewController{ + + @FXML + void onApplyClick(ActionEvent event) { + ViewController controller = Main.sceneController.showView("admin-space-view.fxml"); + controller.updateView(); + + } + + @FXML + void onCancelClick(ActionEvent event) { + ViewController controller = Main.sceneController.showView("admin-space-view.fxml"); + controller.updateView(); + + } + + @Override + public void updateView() { + + } + +} diff --git a/src/main/java/com/example/werkplekkenfrontend/controllers/AdminEditWorkspaceViewController.java b/src/main/java/com/example/werkplekkenfrontend/controllers/AdminEditWorkspaceViewController.java new file mode 100644 index 0000000..6f0f0a8 --- /dev/null +++ b/src/main/java/com/example/werkplekkenfrontend/controllers/AdminEditWorkspaceViewController.java @@ -0,0 +1,27 @@ +package com.example.werkplekkenfrontend.controllers; + +import com.example.werkplekkenfrontend.Main; +import javafx.event.ActionEvent; +import javafx.fxml.FXML; + +public class AdminEditWorkspaceViewController implements ViewController{ + + + @FXML + void onApplyClick(ActionEvent event) { + ViewController controller = Main.sceneController.showView("admin-space-view.fxml"); + controller.updateView(); + + } + + @FXML + void onCancelClick(ActionEvent event) { + ViewController controller = Main.sceneController.showView("admin-space-view.fxml"); + controller.updateView(); + } + + @Override + public void updateView() { + + } +} diff --git a/src/main/java/com/example/werkplekkenfrontend/controllers/AdminViewSpaceController.java b/src/main/java/com/example/werkplekkenfrontend/controllers/AdminViewSpaceController.java new file mode 100644 index 0000000..edf555c --- /dev/null +++ b/src/main/java/com/example/werkplekkenfrontend/controllers/AdminViewSpaceController.java @@ -0,0 +1,41 @@ +package com.example.werkplekkenfrontend.controllers; + +import com.example.werkplekkenfrontend.Main; +import javafx.event.ActionEvent; +import javafx.fxml.FXML; + +public class AdminViewSpaceController implements ViewController { + + @FXML + void OnNewMeetingroomButtonClick(ActionEvent event) { + ViewController controller = Main.sceneController.showView("space-view-edit-meetingroom.fxml"); + controller.updateView(); + + } + + @FXML + void OnNewWorkspaceButtonClick(ActionEvent event) { + ViewController controller = Main.sceneController.showView("space-view-edit-workspace.fxml"); + controller.updateView(); + + + } + + @FXML + void onEditMeetingRoomButtonClick(ActionEvent event) { + ViewController controller = Main.sceneController.showView("space-view-edit-meetingroom.fxml"); + controller.updateView(); + + } + + @FXML + void onEditWorkspaceButtonClick(ActionEvent event) { + ViewController controller = Main.sceneController.showView("space-view-edit-workspace.fxml"); + controller.updateView(); + + } + @Override + public void updateView() { + + } +} diff --git a/src/main/java/com/example/werkplekkenfrontend/models/Facility.java b/src/main/java/com/example/werkplekkenfrontend/models/Facility.java new file mode 100644 index 0000000..fa1080c --- /dev/null +++ b/src/main/java/com/example/werkplekkenfrontend/models/Facility.java @@ -0,0 +1,35 @@ +package com.example.werkplekkenfrontend.models; + +public class Facility { + + String id; + + String name; + + int quantity; + + Building building; + + public Facility(String id, String name, int quantity, Building building) { + this.id = id; + this.name = name; + this.quantity = quantity; + this.building = building; + } + + public String getId() { + return id; + } + + public String getName() { + return name; + } + + public int getQuantity() { + return quantity; + } + + public Building getBuilding() { + return building; + } +} diff --git a/src/main/java/com/example/werkplekkenfrontend/models/Floor.java b/src/main/java/com/example/werkplekkenfrontend/models/Floor.java new file mode 100644 index 0000000..81bccd3 --- /dev/null +++ b/src/main/java/com/example/werkplekkenfrontend/models/Floor.java @@ -0,0 +1,37 @@ +package com.example.werkplekkenfrontend.models; + +import java.util.Set; + +public class Floor { + + String id; + + String Designation; + + Building building; + + Set spaces; + + public Floor(String id, String designation, Building building, Set spaces) { + this.id = id; + Designation = designation; + this.building = building; + this.spaces = spaces; + } + + public String getId() { + return id; + } + + public String getDesignation() { + return Designation; + } + + public Building getBuilding() { + return building; + } + + public Set getSpaces() { + return spaces; + } +} diff --git a/src/main/java/com/example/werkplekkenfrontend/models/Space.java b/src/main/java/com/example/werkplekkenfrontend/models/Space.java new file mode 100644 index 0000000..5ba84b0 --- /dev/null +++ b/src/main/java/com/example/werkplekkenfrontend/models/Space.java @@ -0,0 +1,37 @@ +package com.example.werkplekkenfrontend.models; + +import java.util.Set; +import java.util.UUID; + +public class Space { + UUID id; + + int capacity; + + Floor floor; + + Set Facilities; + + public Space(UUID id, int capacity, Floor floor, Set facilities) { + this.id = id; + this.capacity = capacity; + this.floor = floor; + Facilities = facilities; + } + + public UUID getId() { + return id; + } + + public int getCapacity() { + return capacity; + } + + public Floor getFloor() { + return floor; + } + + public Set getFacilities() { + return Facilities; + } +} diff --git a/src/main/resources/com/example/werkplekkenfrontend/admin-space-view.fxml b/src/main/resources/com/example/werkplekkenfrontend/admin-space-view.fxml new file mode 100644 index 0000000..1040f4a --- /dev/null +++ b/src/main/resources/com/example/werkplekkenfrontend/admin-space-view.fxml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/com/example/werkplekkenfrontend/space-view-edit-meetingroom.fxml b/src/main/resources/com/example/werkplekkenfrontend/space-view-edit-meetingroom.fxml new file mode 100644 index 0000000..5c5dc4e --- /dev/null +++ b/src/main/resources/com/example/werkplekkenfrontend/space-view-edit-meetingroom.fxml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/com/example/werkplekkenfrontend/space-view-edit-workspace.fxml b/src/main/resources/com/example/werkplekkenfrontend/space-view-edit-workspace.fxml new file mode 100644 index 0000000..349890a --- /dev/null +++ b/src/main/resources/com/example/werkplekkenfrontend/space-view-edit-workspace.fxml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/com/example/werkplekkenfrontend/admin-space-view.fxml b/src/main/resources/com/example/werkplekkenfrontend/admin-space-view.fxml index 1040f4a..c7e2021 100644 --- a/src/main/resources/com/example/werkplekkenfrontend/admin-space-view.fxml +++ b/src/main/resources/com/example/werkplekkenfrontend/admin-space-view.fxml @@ -2,63 +2,33 @@ - - - - - - - + + + + - - - - - - - - diff --git a/src/main/resources/com/example/werkplekkenfrontend/admin-workspace-view.fxml b/src/main/resources/com/example/werkplekkenfrontend/admin-workspace-view.fxml new file mode 100644 index 0000000..47647e1 --- /dev/null +++ b/src/main/resources/com/example/werkplekkenfrontend/admin-workspace-view.fxml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/com/example/werkplekkenfrontend/space-edit-meetingroom.fxml b/src/main/resources/com/example/werkplekkenfrontend/space-edit-meetingroom.fxml new file mode 100644 index 0000000..1dafd82 --- /dev/null +++ b/src/main/resources/com/example/werkplekkenfrontend/space-edit-meetingroom.fxml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + diff --git a/src/main/resources/com/example/werkplekkenfrontend/admin-space-view.fxml b/src/main/resources/com/example/werkplekkenfrontend/admin-space-view.fxml index e510885..acdba52 100644 --- a/src/main/resources/com/example/werkplekkenfrontend/admin-space-view.fxml +++ b/src/main/resources/com/example/werkplekkenfrontend/admin-space-view.fxml @@ -10,23 +10,19 @@ fx:controller="com.example.werkplekkenfrontend.controllers.AdminViewSpaceController"> - - diff --git a/src/main/resources/com/example/werkplekkenfrontend/admin-workspace-view.fxml b/src/main/resources/com/example/werkplekkenfrontend/admin-workspace-view.fxml index 0e3cc21..6f73411 100644 --- a/src/main/resources/com/example/werkplekkenfrontend/admin-workspace-view.fxml +++ b/src/main/resources/com/example/werkplekkenfrontend/admin-workspace-view.fxml @@ -8,6 +8,7 @@ +