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.EventBusgetEventBus()Get the global eventbusjavafx.application.HostServicesgetHostServices()Get the global Host Services APIjava.util.List<Controller>getInnerControllers()voidhandle(ExitApplicationEvent event)Handle an exit request for the whole program.voidhandle(LanguageChangedEvent event)Change the CSS according to which language is being usedvoidhandle(OpenLinkInBrowserEvent event)Open a link in the browser.voidhandle(ThemeChangedEvent event)Change the CSS according to which theme the user choosesvoidinitialize(java.net.URL url, java.util.ResourceBundle resourceBundle)voidsetHostServices(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:
initializein 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-
-