Package app
Class MainController
java.lang.Object
app.MainController
- All Implemented Interfaces:
javafx.fxml.Initializable
public class MainController
extends java.lang.Object
implements javafx.fxml.Initializable
An FXML controller that controls the application and all subcontrollers
-
Constructor Summary
Constructors Constructor Description MainController()
-
Method Summary
Modifier and Type Method Description com.google.common.eventbus.EventBus
getEventBus()
Get the global eventbusjavafx.application.HostServices
getHostServices()
Get the global Host Services APIjava.util.List<Controller>
getInnerControllers()
void
handle(ExitApplicationEvent event)
Handle an exit request for the whole program.void
handle(LanguageChangedEvent event)
Change the CSS according to which language is being usedvoid
handle(OpenLinkInBrowserEvent event)
Open a link in the browser.void
handle(ThemeChangedEvent event)
Change the CSS according to which theme the user choosesvoid
initialize(java.net.URL url, java.util.ResourceBundle resourceBundle)
void
setHostServices(javafx.application.HostServices hostServices)
Set a reference to the global Host Services APIMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
MainController
public MainController()
-
-
Method Details
-
initialize
public void initialize(java.net.URL url, java.util.ResourceBundle resourceBundle)- Specified by:
initialize
in interfacejavafx.fxml.Initializable
-
getEventBus
public com.google.common.eventbus.EventBus getEventBus()Get the global eventbus- Returns:
- The EventBus object
-
getHostServices
public javafx.application.HostServices getHostServices()Get the global Host Services API- Returns:
- The JavaFX HostServices object
- See Also:
setHostServices(HostServices)
-
getInnerControllers
- Returns:
- All subcontrollers of this controller
-
setHostServices
public void setHostServices(javafx.application.HostServices hostServices)Set a reference to the global Host Services API- Parameters:
hostServices
- The JavaFX HostServices object- See Also:
getHostServices()
-
handle
Change the CSS according to which language is being used- Parameters:
event
-
-
handle
Change the CSS according to which theme the user chooses- Parameters:
event
-
-
handle
Open a link in the browser.- Parameters:
event
-
-
handle
Handle an exit request for the whole program. Checking if all is saved before closing the app. The user can either choose to exit or go back to the application and save.- Parameters:
event
-
-