Class ComboBoxWidget


public class ComboBoxWidget extends PanelWidget
A customizable ComboBoxWidget. This widget allows users to select a value from a dropdown list.
  • Constructor Details

    • ComboBoxWidget

      public ComboBoxWidget(int x, int y, int width, int height)
      Constructs a new Widget 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
  • Method Details

    • 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
    • getValue

      public String getValue()
      Returns the current value of the ComboBox.
      Returns:
      the currently selected value
    • getValue

      public String getValue(int index)
      Returns the value at the specified index.
      Parameters:
      index - the index of the value to return
      Returns:
      the value at the specified index
    • addValue

      public void addValue(String value)
      Adds a new value to the ComboBox.
      Parameters:
      value - the value to add
    • removeValue

      public void removeValue(String value)
      Remove a value from a ComboBox.
      Parameters:
      value - the value to remove
    • removeValue

      public void removeValue(int index)
      Remove a value from a ComboBox.
      Parameters:
      index - index of the value to be deleted
    • getIconFontName

      public String getIconFontName()
      Gets the name of the icon font.
      Returns:
      the name of the icon font
    • setIconFontName

      public void setIconFontName(String iconFontName)
      Sets the name of the icon font.
      Parameters:
      iconFontName - the new name of the icon font
    • getFontName

      public String getFontName()
      Gets the name of the font.
      Returns:
      the name of the font
    • setFontName

      public void setFontName(String fontName)
      Sets the name of the font.
      Parameters:
      fontName - the new name of the font
    • getDropIcon

      public String getDropIcon()
      Gets the drop icon.
      Returns:
      the drop icon
    • setDropIcon

      public void setDropIcon(String dropIcon)
      Sets the drop icon.
      Parameters:
      dropIcon - the new drop icon
    • getDropButtonWidth

      public int getDropButtonWidth()
      Gets the width of the drop button.
      Returns:
      the width of the drop button
    • setDropButtonWidth

      public void setDropButtonWidth(int dropButtonWidth)
      Sets the width of the drop button.
      Parameters:
      dropButtonWidth - the new width of the drop button
    • getValueIndex

      public int getValueIndex()
      Gets the value index.
      Returns:
      the value index
    • setValueIndex

      public void setValueIndex(int valueIndex)
      Sets the value index.
      Parameters:
      valueIndex - the new value index
    • getPopupHeight

      public int getPopupHeight()
      Gets the popup height.
      Returns:
      the popup height
    • setPopupHeight

      public void setPopupHeight(int popupHeight)
      Sets the popup height.
      Parameters:
      popupHeight - the new popup height
    • getPopupButtonHeight

      public int getPopupButtonHeight()
      Gets the popup button height.
      Returns:
      the popup button height
    • setPopupButtonHeight

      public void setPopupButtonHeight(int popupButtonHeight)
      Sets the popup button height.
      Parameters:
      popupButtonHeight - the new popup button height
    • getFontSize

      public int getFontSize()
      Gets the font size.
      Returns:
      the font size
    • setFontSize

      public void setFontSize(int fontSize)
      Sets the font size.
      Parameters:
      fontSize - the new font size
    • getValueList

      public List<String> getValueList()
      Gets the value list.
      Returns:
      the value list
    • setValueList

      public void setValueList(List<String> valueList)
      Sets the value list.
      Parameters:
      valueList - the new value list
    • getIconColor

      public NanoColor getIconColor()
      Gets the icon color.
      Returns:
      the icon color
    • setIconColor

      public void setIconColor(NanoColor iconColor)
      Sets the icon color.
      Parameters:
      iconColor - the new icon color
    • getTextColor

      public NanoColor getTextColor()
      Gets the text color.
      Returns:
      the text color
    • setTextColor

      public void setTextColor(NanoColor textColor)
      Sets the text color.
      Parameters:
      textColor - the new text color
    • getAccentColor

      public NanoColor getAccentColor()
      Gets the accent color.
      Returns:
      the accent color
    • setAccentColor

      public void setAccentColor(NanoColor accentColor)
      Sets the accent color.
      Parameters:
      accentColor - the new accent color
    • getIconSize

      public int getIconSize()
      Gets the drop icon size.
      Returns:
      the icon size
    • setIconSize

      public void setIconSize(int iconSize)
      Sets the drop icon size.
      Parameters:
      iconSize - the new icon size
    • getBorderOffset

      public int getBorderOffset()
      Gets the border offset.
      Returns:
      the border offset
    • setBorderOffset

      public void setBorderOffset(int borderOffset)
      Sets the border offset.
      Parameters:
      borderOffset - the new border offset
    • render

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