Class Scale.Builder<B extends Scale.Builder<B>>

Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
Accessible.Builder<B>, Orientable.Builder<B>, BuilderInterface
Enclosing class:
Scale

public static class Scale.Builder<B extends Scale.Builder<B>> extends Range.Builder<B> implements Accessible.Builder<B>, Orientable.Builder<B>
Inner class implementing a builder pattern to construct a GObject with properties.
  • Constructor Details

    • Builder

      protected Builder()
      Default constructor for a Builder object.
  • Method Details

    • build

      public Scale build()
      Finish building the Scale object. This will call GObject.withProperties(Type, String[], Value[]) to create a new GObject instance, which is then cast to Scale.
      Overrides:
      build in class Range.Builder<B extends Scale.Builder<B>>
      Returns:
      a new instance of Scale with the properties that were set in the Builder object.
    • setDigits

      public B setDigits(int digits)
      The number of decimal places that are displayed in the value.
      Parameters:
      digits - the value for the digits property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setDrawValue

      public B setDrawValue(boolean drawValue)
      Whether the current value is displayed as a string next to the slider.
      Parameters:
      drawValue - the value for the draw-value property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setHasOrigin

      public B setHasOrigin(boolean hasOrigin)
      Whether the scale has an origin.
      Parameters:
      hasOrigin - the value for the has-origin property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setValuePos

      public B setValuePos(PositionType valuePos)
      The position in which the current value is displayed.
      Parameters:
      valuePos - the value for the value-pos property
      Returns:
      the Builder instance is returned, to allow method chaining