Class Controller<PreparationType>
java.lang.Object
page.codeberg.friedolyn.gui.controllers.Controller<PreparationType>
- Type Parameters:
PreparationType
- The type of the object that is passed to theprepare(Object)
method.
- All Implemented Interfaces:
javafx.fxml.Initializable
,Preparable<PreparationType>
- Direct Known Subclasses:
DialogController
,FirstLaunchController
,MainController
public abstract class Controller<PreparationType>
extends Object
implements javafx.fxml.Initializable, Preparable<PreparationType>
A class that defines the behaviour of a graphical user interface (GUI) window or dialog. It is required to
call the
prepare(PreparationType)
method immediately after Initializable.initialize(java.net.URL, java.util.ResourceBundle)
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract void
close()
Makes the current window or dialog disappear from the user's screen.@NonNull FuzzyBoolean
void
prepare
(PreparationType preparation) Provides the dialog or window with all the information that is required for correct operation.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javafx.fxml.Initializable
initialize
-
Constructor Details
-
Controller
public Controller()
-
-
Method Details
-
prepare
Provides the dialog or window with all the information that is required for correct operation.- Specified by:
prepare
in interfacePreparable<PreparationType>
- Parameters:
preparation
- The data needed by the dialog or window.- Throws:
IllegalArgumentException
- If the data is invalid for some reason. For more information, see the documentation of the specific implementation.- See Also:
-
getSuccess
- Returns:
-
FuzzyBoolean.TRUE
iff the user has entered valid data and closed the window or dialog. -
If
FuzzyBoolean.FALSE
is returned, it means the user has entered invalid data and closed the window or dialog. -
If
FuzzyBoolean.MAYBE
is returned if the window/dialog is still open or if it is unclear whether the user has entered valid data.
-
-
close
public abstract void close()Makes the current window or dialog disappear from the user's screen.
-