Package Controllers
Class LoginController
java.lang.Object
Controllers.LoginController
- All Implemented Interfaces:
javafx.fxml.Initializable
Controller class for the Login.fmxl form.
Implements Initializable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddisplayError(String text) Utility function that is used to display errorsstatic Stringstatic ResourceBundlegetRb()static TimeZonestatic UsergetUser()voidhandleLogin(javafx.event.ActionEvent actionEvent) Function that handles authenticationvoidinitialize(URL url, ResourceBundle resourceBundle) Initializes the FXML ScreenvoidlogAuthentication(Boolean valid, String username) Utility function that is used to log any sign in attemptsvoidFunction that correctly maps all the labels to the correct languagevoidMaps the language from the systemvoidUtility function that is used to switch between pages
-
Constructor Details
-
LoginController
public LoginController()
-
-
Method Details
-
getTimezone
- Returns:
- [TimeZone] timezone of the system
-
getLanguage
- Returns:
- [String] language of the system
-
getUser
- Returns:
- [User] user that has loggged in
-
getRb
- Returns:
- [ResourceBundle] rb for the labels
-
logAuthentication
Utility function that is used to log any sign in attempts- Parameters:
valid- Boolean value representing a successful log inusername- String value representing the username being attempted
-
handleLogin
Function that handles authentication- Parameters:
actionEvent- ActionEvent object that triggered this function- Throws:
IOException
-
mapLabels
public void mapLabels()Function that correctly maps all the labels to the correct language -
mapLanguage
public void mapLanguage()Maps the language from the system -
initialize
Initializes the FXML Screen- Specified by:
initializein interfacejavafx.fxml.Initializable- Parameters:
url- parameter for the FXML ScreenresourceBundle- parameter for the FXML Screen
-
openPage
Utility function that is used to switch between pages- Parameters:
actionEvent- JavaFX action event- Throws:
IOException
-
displayError
Utility function that is used to display errors- Parameters:
text- String value text of the main text
-