Class SceneController

java.lang.Object
com.mg105.user_interface.SceneController
All Implemented Interfaces:
Toggler

public class SceneController extends Object implements Toggler
SceneController acts as the central coordination mechanism for the user interface.
  • 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

      public void toggle(@NotNull @NotNull Toggler.ToggleableComponent component)
      Toggle the component. i.e. switch it between invisible and visible.
      Specified by:
      toggle in interface Toggler
      Parameters:
      component - the component to toggle.
    • getCurrentComponent

      @NotNull public @NotNull Toggler.ToggleableComponent getCurrentComponent()
      Get the current visible component.
      Specified by:
      getCurrentComponent in interface Toggler
      Returns:
      the current visible component.