Package com.mg105.user_interface
Class SceneController
java.lang.Object
com.mg105.user_interface.SceneController
- All Implemented Interfaces:
Toggler
SceneController acts as the central coordination mechanism for the user interface.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.mg105.interface_adapters.Toggler
Toggler.ToggleableComponent
-
Constructor Summary
ConstructorDescriptionSceneController
(@NotNull javafx.stage.Stage primaryStage, @NotNull Map<Toggler.ToggleableComponent, Toggleable> components, @NotNull Toggler.ToggleableComponent defaultComponent) Create a new scene controller -
Method Summary
Modifier and TypeMethodDescription@NotNull Toggler.ToggleableComponent
Get the current visible component.void
toggle
(@NotNull Toggler.ToggleableComponent component) Toggle the component.
-
Constructor Details
-
SceneController
public SceneController(@NotNull @NotNull javafx.stage.Stage primaryStage, @NotNull @NotNull Map<Toggler.ToggleableComponent, Toggleable> components, @NotNull @NotNull Toggler.ToggleableComponent defaultComponent) Create a new scene controller- Parameters:
primaryStage
- the JavaFX stage to draw on.components
- all the possible components in the system. Components should contain an entry for each item in the ToggleableComponent enum.defaultComponent
- the component that will be shown if there's nothing else to show.
-
-
Method Details
-
toggle
Toggle the component. i.e. switch it between invisible and visible. -
getCurrentComponent
Get the current visible component.- Specified by:
getCurrentComponent
in interfaceToggler
- Returns:
- the current visible component.
-