add: change Scenes
This commit is contained in:
parent
c57e65fadb
commit
1c85261c7b
@ -26,12 +26,8 @@ public class LoginController {
|
|||||||
String email = tfEmail.getText();
|
String email = tfEmail.getText();
|
||||||
String password = pfPassword.getText();
|
String password = pfPassword.getText();
|
||||||
if(benutzerMap.containsKey(email) && benutzerMap.containsValue(password)){
|
if(benutzerMap.containsKey(email) && benutzerMap.containsValue(password)){
|
||||||
FXMLLoader fxmlLoader = new FXMLLoader(StartViewApplication.class.getResource("menue-view.fxml"));
|
// if user is worker: StartViewApplication.changeScene("workerMenu-view.fxml");
|
||||||
Scene scene = new Scene(fxmlLoader.load(), 950,480);
|
StartViewApplication.changeScene("parentMenu-view.fxml");
|
||||||
Stage stage = new Stage();
|
|
||||||
stage.setTitle("Essen Bestellung im Kindergarten");
|
|
||||||
stage.setScene(scene);
|
|
||||||
stage.show();
|
|
||||||
}else {
|
}else {
|
||||||
Alert alert = new Alert(Alert.AlertType.ERROR,"Email oder Passwort ist falsch");
|
Alert alert = new Alert(Alert.AlertType.ERROR,"Email oder Passwort ist falsch");
|
||||||
alert.showAndWait();
|
alert.showAndWait();
|
||||||
@ -42,12 +38,6 @@ public class LoginController {
|
|||||||
}
|
}
|
||||||
@FXML
|
@FXML
|
||||||
protected void changeToSignUp() throws IOException {
|
protected void changeToSignUp() throws IOException {
|
||||||
FXMLLoader fxmlLoader = new FXMLLoader(StartViewApplication.class.getResource("signUp-view.fxml"));
|
StartViewApplication.changeScene("signUp-view.fxml");
|
||||||
Scene scene = new Scene(fxmlLoader.load(), 950,480);
|
|
||||||
Stage stage = new Stage();
|
|
||||||
stage.setTitle("Essen Bestellung im Kindergarten");
|
|
||||||
stage.setScene(scene);
|
|
||||||
stage.show();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -55,8 +55,7 @@ public class ParentMenuController {
|
|||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
public void onAusloggenClick(MouseEvent mouseEvent) throws IOException {
|
public void onAusloggenClick(MouseEvent mouseEvent) throws IOException {
|
||||||
Parent p = FXMLLoader.load(StartViewApplication.class.getResource("workerMenu-view.fxml"));
|
StartViewApplication.changeScene("workerMenu-view.fxml");
|
||||||
StartViewApplication.primary.getScene().setRoot(p);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void changePage(String page) {
|
private void changePage(String page) {
|
||||||
|
@ -0,0 +1,11 @@
|
|||||||
|
package com.bib.essensbestellungsverwaltung;
|
||||||
|
|
||||||
|
import javafx.event.ActionEvent;
|
||||||
|
|
||||||
|
public class SingUpController {
|
||||||
|
public void onKontoErstellenBtClick(ActionEvent actionEvent) {
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onAnmeldenBtClick(ActionEvent actionEvent) {
|
||||||
|
}
|
||||||
|
}
|
@ -7,6 +7,7 @@ package com.bib.essensbestellungsverwaltung;
|
|||||||
|
|
||||||
import javafx.application.Application;
|
import javafx.application.Application;
|
||||||
import javafx.fxml.FXMLLoader;
|
import javafx.fxml.FXMLLoader;
|
||||||
|
import javafx.scene.Parent;
|
||||||
import javafx.scene.Scene;
|
import javafx.scene.Scene;
|
||||||
import javafx.stage.Stage;
|
import javafx.stage.Stage;
|
||||||
|
|
||||||
@ -14,6 +15,7 @@ import java.io.IOException;
|
|||||||
|
|
||||||
public class StartViewApplication extends Application {
|
public class StartViewApplication extends Application {
|
||||||
public static Stage primary;
|
public static Stage primary;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void start(Stage stage) throws IOException {
|
public void start(Stage stage) throws IOException {
|
||||||
FXMLLoader fxmlLoader = new FXMLLoader(StartViewApplication.class.getResource("login-view.fxml"));
|
FXMLLoader fxmlLoader = new FXMLLoader(StartViewApplication.class.getResource("login-view.fxml"));
|
||||||
@ -34,4 +36,9 @@ public class StartViewApplication extends Application {
|
|||||||
//Database.deleteSample();
|
//Database.deleteSample();
|
||||||
launch();
|
launch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void changeScene(String scene) throws IOException {
|
||||||
|
Parent p = FXMLLoader.load(StartViewApplication.class.getResource(scene));
|
||||||
|
primary.getScene().setRoot(p);
|
||||||
|
}
|
||||||
}
|
}
|
@ -40,6 +40,7 @@ public class WorkerMenuController {
|
|||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
public void onWochenplanClick(MouseEvent mouseEvent) {
|
public void onWochenplanClick(MouseEvent mouseEvent) {
|
||||||
|
changePage("createFoodplan-view.fxml");
|
||||||
setButtonActive(wochenplanButton);
|
setButtonActive(wochenplanButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,6 +60,7 @@ public class WorkerMenuController {
|
|||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
public void onMahlzeitClick(MouseEvent mouseEvent) {
|
public void onMahlzeitClick(MouseEvent mouseEvent) {
|
||||||
|
changePage("createFood-view.fxml");
|
||||||
setButtonActive(mahlzeitButton);
|
setButtonActive(mahlzeitButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,8 +71,7 @@ public class WorkerMenuController {
|
|||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
public void onAusloggenClick(MouseEvent mouseEvent) throws IOException {
|
public void onAusloggenClick(MouseEvent mouseEvent) throws IOException {
|
||||||
Parent p = FXMLLoader.load(StartViewApplication.class.getResource("parentMenu-view.fxml"));
|
StartViewApplication.changeScene("parentMenu-view.fxml");
|
||||||
StartViewApplication.primary.getScene().setRoot(p);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void changePage(String page) {
|
private void changePage(String page) {
|
||||||
|
Loading…
Reference in New Issue
Block a user