All Downloads are FREE. Search and download functionalities are using the official Maven repository.

bayern.steinbrecher.screens.ScreenController Maven / Gradle / Ivy

Go to download

An abstract structure for JavaFX based applications for handling dialogs and switching between them.

There is a newer version: 0.2.4
Show newest version
package bayern.steinbrecher.screens;

import javafx.fxml.FXML;
import org.jetbrains.annotations.NotNull;

public abstract class ScreenController {
    private ScreenManager screenManager;

    @NotNull
    protected ScreenManager getScreenManager() {
        if(screenManager == null){
            throw new IllegalStateException("There is no screen manager attached");
        } else {
            return screenManager;
        }
    }

    void setScreenManager(@NotNull ScreenManager screenManager) {
        this.screenManager = screenManager;
    }

    @FXML
    protected void switchToPreviousScreen(){
        getScreenManager().switchBack();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy