Class WidgetPageSelection

java.lang.Object
app.ui.widgets.Widget
app.ui.widgets.WidgetPageSelection
All Implemented Interfaces:
IDrawable

public class WidgetPageSelection extends Widget
WidgetPageSelection represents a paginated selection widget in a UI. This widget allows displaying a list of options spread across multiple pages.
  • Constructor Details

    • WidgetPageSelection

      public WidgetPageSelection(int x, int y, int len, int height, String text, ArrayList<ArrayList<String>> selections, Window mainWindow)
      Constructor for creating a WidgetPageSelection.
      Parameters:
      x - The x-coordinate of the widget.
      y - The y-coordinate of the widget.
      len - Length of the widget.
      height - Height of the widget.
      text - Text associated with the widget.
      selections - List of selection options.
      mainWindow - The main window in which the widget is displayed.
  • Method Details

    • updateList

      public void updateList(ArrayList<ArrayList<String>> selections)
      Updates the list of selections in the widget.
      Parameters:
      selections - New list of selections to be updated.
    • getSelectedOption

      public int getSelectedOption()
      Gets the index of the currently selected option.
      Returns:
      Index of selected option.
    • clearSelectedOption

      public void clearSelectedOption()
      Clears the currently selected option.
    • getSelectionsButton

      public List<List<WidgetButton>> getSelectionsButton()
      Gets the list of buttons in the widget.
      Returns:
      List of buttons in the widget.
    • addSelections

      public void addSelections(ArrayList<ArrayList<String>> selections)
      Adds the list of selections to the widget.
      Parameters:
      selections - List of selections to be added.
    • draw

      public void draw(char[][] buffer, com.googlecode.lanterna.TextColor[][] printColor, com.googlecode.lanterna.TextColor[][] backColor)
      Draws the widget on the screen.
      Specified by:
      draw in interface IDrawable
      Specified by:
      draw in class Widget
      Parameters:
      buffer - Buffer to draw on.
      printColor - Color of the text.
      backColor - Color of the background.