Class WalkingMenu

java.lang.Object
com.mg105.user_interface.WalkingMenu
All Implemented Interfaces:
Toggleable, EventListener, javafx.event.EventHandler<javafx.event.ActionEvent>

public class WalkingMenu extends Object implements javafx.event.EventHandler<javafx.event.ActionEvent>, Toggleable
This class uses JavaFX and is displayed when the user wants to change the walking character sprite.
  • Constructor Details

    • WalkingMenu

      public WalkingMenu(WalkVisController controller)
      Creates a new WalkingMenu with reference to a controller class. Sets up UI elements.
      Parameters:
      controller - the WalkVisController to be referred to.
  • Method Details

    • handle

      public void handle(javafx.event.ActionEvent event)
      Handles button events. Pressing the select button updates the WalkingCharacter to represent the desired walking character sprite.
      Specified by:
      handle in interface javafx.event.EventHandler<javafx.event.ActionEvent>
      Parameters:
      event - the event which occurred.
    • getScene

      @NotNull public @NotNull javafx.scene.Scene getScene()
      Get the scene of this toggleable object. It is this scene that will be displayed.
      Specified by:
      getScene in interface Toggleable
      Returns:
      the scene to be displayed.
    • toggle

      public void toggle(boolean isVisible)
      Set the visibility of this component.
      Specified by:
      toggle in interface Toggleable
      Parameters:
      isVisible - true if the Toggleable is now visible, false otherwise. If false the Toggleable is expected to do nothing on ANY user inputs.