Class BaseStyles.Builder<Self extends BaseStyles.Builder<Self>>

java.lang.Object
technology.sola.engine.graphics.gui.style.BaseStyles.Builder<Self>
Type Parameters:
Self - this builder type
Direct Known Subclasses:
TextStyles.Builder
Enclosing class:
BaseStyles

@NullMarked public static class BaseStyles.Builder<Self extends BaseStyles.Builder<Self>> extends Object
Builder class for BaseStyles.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • build

      public BaseStyles build()
      Builds a new styles instance based on the builder properties that were set.
      Returns:
      the new styles instance
    • setBackgroundColor

      public Self setBackgroundColor(@Nullable Color backgroundColor)
      Sets the BaseStyles.background() to be the color provided.
      Parameters:
      backgroundColor - the Color of the background
      Returns:
      this
    • setBorderColor

      public Self setBorderColor(@Nullable Color borderColor)
      Sets the BaseStyles.border() to be the color provided with a 1px sizing.
      Parameters:
      borderColor - the Color of the border
      Returns:
      this
    • setWidth

      public Self setWidth(@Nullable String width)
      Parameters:
      width - the width of the element
      Returns:
      this
    • setWidth

      public Self setWidth(int width)
      Parameters:
      width - the width of the element
      Returns:
      this
    • setHeight

      public Self setHeight(@Nullable String height)
      Parameters:
      height - the height of the element
      Returns:
      this
    • setHeight

      public Self setHeight(int height)
      Parameters:
      height - the height of the element
      Returns:
      this
    • setVisibility

      public Self setVisibility(@Nullable Visibility visibility)
      Parameters:
      visibility - the Visibility of the element
      Returns:
      this
    • setGap

      public Self setGap(@Nullable Integer gap)
      Parameters:
      gap - the gap between child elements
      Returns:
      this
    • setDirection

      public Self setDirection(@Nullable Direction direction)
      Parameters:
      direction - the Direction children elements flow
      Returns:
      this
    • setMainAxisChildren

      public Self setMainAxisChildren(@Nullable MainAxisChildren mainAxisChildren)
      Parameters:
      mainAxisChildren - the MainAxisChildren of the element
      Returns:
      this
    • setCrossAxisChildren

      public Self setCrossAxisChildren(@Nullable CrossAxisChildren crossAxisChildren)
      Parameters:
      crossAxisChildren - the CrossAxisChildren of the element
      Returns:
      this
    • setPositionX

      public Self setPositionX(@Nullable String x)
      Sets the BaseStyles.position() to have an absolute value for x (y value remains unchanged).
      Parameters:
      x - the absolute x position
      Returns:
      this
    • setPositionY

      public Self setPositionY(@Nullable String y)
      Sets the BaseStyles.position() to have an absolute value for y (x value remains unchanged).
      Parameters:
      y - the absolute y position
      Returns:
      this
    • setPadding

      public Self setPadding(@Nullable Integer top, @Nullable Integer right, @Nullable Integer bottom, @Nullable Integer left)
      Sets the BaseStyles.padding() to have values for top, right, bottom and left.
      Parameters:
      top - the top padding
      right - the right padding
      bottom - the bottom padding
      left - the left padding
      Returns:
      this
    • setPadding

      public Self setPadding(@Nullable Integer size)
      Sets the BaseStyles.padding() to have the same value for top, right, bottom and left.
      Parameters:
      size - the padding value for all sides
      Returns:
      this
    • setPaddingVertical

      public Self setPaddingVertical(@Nullable Integer topBottom)
      Sets the BaseStyles.padding() to have the same value for top and bottom. Left and right remain unchanged.
      Parameters:
      topBottom - the padding value for top and bottom
      Returns:
      this
    • setPaddingHorizontal

      public Self setPaddingHorizontal(@Nullable Integer leftRight)
      Sets the BaseStyles.padding() to have the same value for left and right. Top and bottom remain unchanged.
      Parameters:
      leftRight - the padding value for left and right
      Returns:
      this
    • setPaddingTop

      public Self setPaddingTop(@Nullable Integer top)
      Sets the BaseStyles.padding() top value only.
      Parameters:
      top - the top padding value
      Returns:
      this
    • setPaddingRight

      public Self setPaddingRight(@Nullable Integer right)
      Sets the BaseStyles.padding() right value only.
      Parameters:
      right - the right padding value
      Returns:
      this
    • setPaddingBottom

      public Self setPaddingBottom(@Nullable Integer bottom)
      Sets the BaseStyles.padding() bottom value only.
      Parameters:
      bottom - the bottom padding value
      Returns:
      this
    • setPaddingLeft

      public Self setPaddingLeft(@Nullable Integer left)
      Sets the BaseStyles.padding() left value only.
      Parameters:
      left - the left padding value
      Returns:
      this