Class MainController
java.lang.Object
page.codeberg.friedolyn.gui.controllers.Controller<Friedolyn>
page.codeberg.friedolyn.gui.controllers.MainController
- All Implemented Interfaces:
javafx.fxml.Initializable,Preparable<Friedolyn>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate javafx.scene.layout.BorderPaneprivate javafx.scene.control.Buttonprivate final Countdown.CountdownListenerprivate @NonNull Friedolynprivate javafx.scene.control.MenuItemprivate javafx.scene.control.MenuItemprivate javafx.scene.control.MenuItemprivate javafx.scene.control.MenuItemprivate javafx.scene.control.MenuItemprivate javafx.scene.control.MenuItemprivate javafx.scene.control.MenuItemprivate javafx.scene.control.MenuItemprivate ResourceBundleprivate javafx.scene.text.Textprivate javafx.scene.text.Textprivate javafx.scene.text.Textprivate javafx.scene.text.Text -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Makes the current window or dialog disappear from the user's screen.voidinitialize(URL url, ResourceBundle resourceBundle) private booleanDetermines the current state of the start/stop button.voidlogOut()voidvoidvoidopenFile()voidvoidprivate voidopenSupport(Friedolyn.ContactRequest contactRequestType) private booleanpause()Attempts topauseperiodic grade fetching and changes the appearance of the start/stop button accordingly.voidProvides the dialog or window with all the information that is required for correct operation.private booleanresume()Attempts toresumeperiodic grade fetching and changes the appearance of the start/stop button accordingly.saveCopy()voidsaveTo()private booleanstart()Attempts tostartperiodic grade fetching and changes the appearance of the start/stop button accordingly.private voidInvoked when the user clicks the start/stop button.private voidtoggleStartStopButtonAppearance(boolean isStartButton) Updates the colour and text of the start/stop button.private voidupdateCountdown(Duration duration) Displays the givenDurationin thetextCountdownDays,textCountdownHours,textCountdownMinutesandtextCountdownSecondsTextfields.Methods inherited from class page.codeberg.friedolyn.gui.controllers.Controller
getSuccess
-
Field Details
-
resourceBundle
-
friedolyn
-
COUNTDOWN
-
borderPaneMain
private javafx.scene.layout.BorderPane borderPaneMain -
buttonStartStop
private javafx.scene.control.Button buttonStartStop -
textCountdownDays
private javafx.scene.text.Text textCountdownDays -
textCountdownHours
private javafx.scene.text.Text textCountdownHours -
textCountdownMinutes
private javafx.scene.text.Text textCountdownMinutes -
textCountdownSeconds
private javafx.scene.text.Text textCountdownSeconds
-
-
Constructor Details
-
MainController
public MainController()
-
-
Method Details
-
initialize
-
prepare
Description copied from class:ControllerProvides the dialog or window with all the information that is required for correct operation.- Specified by:
preparein interfacePreparable<Friedolyn>- Overrides:
preparein classController<Friedolyn>- Parameters:
friedolyn- The data needed by the dialog or window.- See Also:
-
toggleStartStop
private void toggleStartStop()Invoked when the user clicks the start/stop button. Will eitherstartorpausethe periodic grade fetching, depending on the current state of Friedolyn and the button. If there's a mismatch between the state of Friedolyn and the appearance of the button, the button's appearance will be updated to reflect the current state of Friedolyn. -
start
private boolean start()Attempts tostartperiodic grade fetching and changes the appearance of the start/stop button accordingly.- Returns:
- True if the periodic grade fetching was successfully started, false otherwise.
-
resume
private boolean resume()Attempts toresumeperiodic grade fetching and changes the appearance of the start/stop button accordingly.- Returns:
- True if the periodic grade fetching was successfully resumed, false otherwise.
-
toggleStartStopButtonAppearance
private void toggleStartStopButtonAppearance(boolean isStartButton) Updates the colour and text of the start/stop button.- Parameters:
isStartButton- True if the button should be styled as a start button, false if it should be styled as a stop button.
-
isStartButton
private boolean isStartButton()Determines the current state of the start/stop button.- Returns:
- True if the button is currently styled as a start button, false if it is styled as a stop button.
-
pause
private boolean pause()Attempts topauseperiodic grade fetching and changes the appearance of the start/stop button accordingly. -
updateCountdown
Displays the givenDurationin thetextCountdownDays,textCountdownHours,textCountdownMinutesandtextCountdownSecondsTextfields.- Parameters:
duration- The new countdown value to display.
-
openFile
public void openFile() -
saveTo
public void saveTo() -
saveCopy
-
openSettings
public void openSettings() -
logOut
public void logOut() -
openSupport
public void openSupport() -
openBugReport
public void openBugReport() -
openFeedback
public void openFeedback() -
openSupport
-
close
public void close()Description copied from class:ControllerMakes the current window or dialog disappear from the user's screen.- Specified by:
closein classController<Friedolyn>
-