Class ScrollPanelWidget

Direct Known Subclasses:
PopupWidget, TableWidget, WindowWidget

public class ScrollPanelWidget extends PanelWidget
The ScrollPanelWidget class represents a panel widget that supports scrolling. It extends the PanelWidget class and adds functionality for managing scrollbars.
  • Constructor Details

    • ScrollPanelWidget

      public ScrollPanelWidget(int x, int y, int width, int height)
      Constructs a new ScrollPanelWidget with the specified position and size.
      Parameters:
      x - the x-coordinate of the Widget's position
      y - the y-coordinate of the Widget's position
      width - the width of the Widget
      height - the height of the Widget
    • ScrollPanelWidget

      public ScrollPanelWidget(int x, int y, int width, int height, int borderRadius, NanoColor backgroundColor)
      Constructs a new ScrollPanelWidget with the specified position, size, border radius, and background color.
      Parameters:
      x - the X-coordinate of the Widget's position
      y - the Y-coordinate of the Widget's position
      width - the width of the widget
      height - the height of the widget
      borderRadius - the radius of the corner rounding in pixels
      backgroundColor - the background color of the widget, specified in NanoColor
  • Method Details

    • getVerticalScrollbar

      public final ScrollbarWidget getVerticalScrollbar()
      Returns the vertical scrollbar Widget associated with this container.
      Returns:
      the vertical scrollbar Widget
    • getHorizontalScrollbar

      public final ScrollbarWidget getHorizontalScrollbar()
      Returns the horizontal scrollbar Widget associated with this container.
      Returns:
      the horizontal scrollbar Widget
    • onInitialize

      public void onInitialize()
      Initializes the Widget
      Overrides:
      onInitialize in class Widget
    • removeChild

      public void removeChild(Widget widget)
      Removes a child widget from this Widget's list of children.
      Overrides:
      removeChild in class Widget
      Parameters:
      widget - the widget to remove from the list of children
    • addChild

      public void addChild(Widget widget)
      Adds a child widget to this Widget's list of children.
      Overrides:
      addChild in class Widget
      Parameters:
      widget - the widget to add as a child
    • renderChildren

      public void renderChildren()
      Updates and renders all child widgets of this Widget. This method recursively calls the update and render methods on each child Widget, ensuring that the rendering order respects the hierarchy of Widgets.
      Overrides:
      renderChildren in class Widget
    • setMaxScrollX

      public void setMaxScrollX(int maxScrollX)
      Sets the maximum horizontal scroll offset of the widget. This value determines the limit for horizontal scrolling based on the content width.
      Overrides:
      setMaxScrollX in class Widget
      Parameters:
      maxScrollX - the new maximum horizontal scroll offset
    • setMaxScrollY

      public void setMaxScrollY(int maxScrollY)
      Sets the maximum vertical scroll offset of the widget. This value determines the limit for vertical scrolling based on the content height.
      Overrides:
      setMaxScrollY in class Widget
      Parameters:
      maxScrollY - the new maximum vertical scroll offset
    • update

      public void update()
      Updates the Widget
      Overrides:
      update in class PanelWidget