Package ntnu.team1.application.main
Class App
java.lang.Object
javafx.application.Application
ntnu.team1.application.main.App
public class App
extends javafx.application.Application
JavaFX App, this is the main class of the application.
Handles storing the register and saving and reading to files.
Also loads fxml file
-
Nested Class Summary
Nested classes/interfaces inherited from class javafx.application.Application
javafx.application.Application.Parameters
-
Field Summary
Fields inherited from class javafx.application.Application
STYLESHEET_CASPIAN, STYLESHEET_MODENA
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Gets called whenever a request is made tro close the application Makes sure that was intended and saves the registerstatic int
Gets the chosen categorystatic MainRegister
Gets the registerstatic void
Main methodstatic void
setChosenCategory(int id)
Sets the chosen categorystatic void
setRegister(MainRegister register)
Sets the registervoid
start(javafx.stage.Stage stage)
Runs on the start of the application.Methods inherited from class javafx.application.Application
getHostServices, getParameters, getUserAgentStylesheet, init, launch, launch, notifyPreloader, setUserAgentStylesheet, stop
-
Constructor Details
-
App
public App()
-
-
Method Details
-
main
Main method- Parameters:
args
- launch arguments
-
start
Runs on the start of the application. Loads the scene and configures it- Specified by:
start
in classjavafx.application.Application
- Parameters:
stage
- main stage- Throws:
IOException
- gets thrown if something fails with loading external files
-
setChosenCategory
public static void setChosenCategory(int id)Sets the chosen category- Parameters:
id
- Integer
-
getChosenCategory
public static int getChosenCategory()Gets the chosen category- Returns:
- Integer
-
setRegister
Sets the register- Parameters:
register
- MainRegister
-
getRegister
Gets the register- Returns:
- Returns the MainRegister
-
alertOnExit
public static void alertOnExit()Gets called whenever a request is made tro close the application Makes sure that was intended and saves the register
-