Class ScrollbarWidget


public class ScrollbarWidget extends PanelWidget
The ScrollbarWidget class represents a scrollbar component that can be either horizontal or vertical. It extends the PanelWidget class.
  • Constructor Details

    • ScrollbarWidget

      public ScrollbarWidget(boolean horizontal)
      Constructs a ScrollbarWidget with the specified orientation.
      Parameters:
      horizontal - true if the scrollbar should be horizontal, false if it should be vertical.
    • ScrollbarWidget

      public ScrollbarWidget()
      Constructs a ScrollbarWidget with a default vertical orientation.
  • Method Details

    • getThumbColor

      public final NanoColor getThumbColor()
      Gets the color of the scrollbar thumb (the draggable part of the scrollbar).
      Returns:
      the color of the scrollbar thumb as a NanoColor object
    • setThumbColor

      public final void setThumbColor(NanoColor thumbColor)
      Sets the color of the scrollbar thumb (the draggable part of the scrollbar).
      Parameters:
      thumbColor - the color to set for the scrollbar thumb, specified as a NanoColor object
    • getBorderOffset

      public final int getBorderOffset()
      Gets the border offset of the scrollbar.
      Returns:
      the border offset in pixels as an int
    • setBorderOffset

      public final void setBorderOffset(int borderOffset)
      Sets the border offset of the scrollbar.
      Parameters:
      borderOffset - the border offset in pixels to set, specified as an int
    • getCompressedWidth

      public final int getCompressedWidth()
      Gets the compressed width of the scrollbar.
      Returns:
      the compressed width in pixels as an int
    • setCompressedWidth

      public final void setCompressedWidth(int compressedWidth)
      Sets the compressed width of the scrollbar.
      Parameters:
      compressedWidth - the compressed width in pixels to set, specified as an int
    • updatePosition

      public void updatePosition()
      Update the Widget position
    • onLeftMouseDown

      public void onLeftMouseDown(int x, int y)
      Called when the left mouse button is pressed down over the Widget.
      Overrides:
      onLeftMouseDown in class PanelWidget
      Parameters:
      x - relative x-coordinate of the mouse position
      y - relative y-coordinate of the mouse position
    • onLeftMouseUpOutside

      public void onLeftMouseUpOutside(int x, int y)
      Handles the left mouse button up event outside any visible Widget
      Overrides:
      onLeftMouseUpOutside in class PanelWidget
      Parameters:
      x - absolute x-coordinate of the mouse position
      y - absolute y-coordinate of the mouse position
    • onLeftMouseUp

      public void onLeftMouseUp(int x, int y)
      Called when the left mouse button is released over the Widget.
      Overrides:
      onLeftMouseUp in class PanelWidget
      Parameters:
      x - relative x-coordinate of the mouse position
      y - relative y-coordinate of the mouse position
    • update

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

      public void render()
      Renders the Widget
      Overrides:
      render in class PanelWidget