new home screen, tutorial fxml file and missing javadoc

This commit is contained in:
giavaphi
2022-11-20 21:10:55 +01:00
parent e96280cd0c
commit 7920bdff28
9 changed files with 347 additions and 35 deletions
@@ -4,7 +4,6 @@ import ch.zhaw.gartenverwaltung.bootstrap.AfterInject;
import ch.zhaw.gartenverwaltung.bootstrap.AppLoader;
import ch.zhaw.gartenverwaltung.bootstrap.ChangeViewEvent;
import ch.zhaw.gartenverwaltung.bootstrap.Inject;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.scene.control.*;
@@ -41,26 +40,39 @@ public class MainFXMLController {
@FXML
private Button tutorial_button;
/**
* go to home pane
*/
@FXML
void goToHome() {
showPaneAsMainView("Home.fxml");
styleChangeButton(home_button);
}
/**
* go to my garden pane
*/
@FXML
void goToMyPlants() {
showPaneAsMainView("MyGarden.fxml");
styleChangeButton(myGarden_button);
}
/**
* go to the schedule pane
*/
@FXML
void goToMySchedule() {
showPaneAsMainView("MySchedule.fxml");
styleChangeButton(mySchedule_button);
}
/**
* open dialog of the settings
* @throws IOException exception
*/
@FXML
public void openSettings(ActionEvent actionEvent) throws IOException {
public void openSettings() throws IOException {
Dialog<ButtonType> dialog = new Dialog<>();
dialog.setTitle("Settings");
dialog.setHeaderText("Settings");
@@ -82,8 +94,11 @@ public class MainFXMLController {
}
}
public void goToTutorial(ActionEvent actionEvent) {
//showPaneAsMainView("Tutorial.fxml");
/**
* go to Tutorial pane
*/
public void goToTutorial() {
showPaneAsMainView("Tutorial.fxml");
styleChangeButton(tutorial_button);
}
@@ -109,10 +124,15 @@ public class MainFXMLController {
private final EventHandler<ChangeViewEvent> changeMainViewHandler = (ChangeViewEvent event) -> showPaneAsMainView(event.view());
/**
* preload all menu bar panes
* @throws IOException exception
*/
private void preloadPanes() throws IOException {
appLoader.loadAndCacheFxml("MyGarden.fxml");
appLoader.loadAndCacheFxml("MySchedule.fxml");
appLoader.loadAndCacheFxml("Plants.fxml");
appLoader.loadAndCacheFxml("Tutorial.fxml");
}
private void styleChangeButton(Button button) {
@@ -142,7 +162,7 @@ public class MainFXMLController {
}
/**
* adds icon to button
* adds icon to given button
* @param button the button which get the icon
* @param iconFileName file name of icon
*/