Class LevelBar.Builder<B extends LevelBar.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:
LevelBar

public static class LevelBar.Builder<B extends LevelBar.Builder<B>> extends Widget.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 LevelBar build()
      Finish building the LevelBar object. This will call GObject.withProperties(Type, String[], Value[]) to create a new GObject instance, which is then cast to LevelBar.
      Overrides:
      build in class Widget.Builder<B extends LevelBar.Builder<B>>
      Returns:
      a new instance of LevelBar with the properties that were set in the Builder object.
    • setInverted

      public B setInverted(boolean inverted)

      Whether the GtkLeveBar is inverted.

      Level bars normally grow from top to bottom or left to right. Inverted level bars grow in the opposite direction.

      Parameters:
      inverted - the value for the inverted property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setMaxValue

      public B setMaxValue(double maxValue)
      Determines the maximum value of the interval that can be displayed by the bar.
      Parameters:
      maxValue - the value for the max-value property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setMinValue

      public B setMinValue(double minValue)
      Determines the minimum value of the interval that can be displayed by the bar.
      Parameters:
      minValue - the value for the min-value property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setMode

      public B setMode(LevelBarMode mode)

      Determines the way GtkLevelBar interprets the value properties to draw the level fill area.

      Specifically, when the value is LevelBarMode.CONTINUOUS, GtkLevelBar will draw a single block representing the current value in that area; when the value is LevelBarMode.DISCRETE, the widget will draw a succession of separate blocks filling the draw area, with the number of blocks being equal to the units separating the integral roundings of Gtk.LevelBar:min-value and Gtk.LevelBar:max-value.

      Parameters:
      mode - the value for the mode property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setValue

      public B setValue(double value)
      Determines the currently filled value of the level bar.
      Parameters:
      value - the value for the value property
      Returns:
      the Builder instance is returned, to allow method chaining
    • onOffsetChanged

      public B onOffsetChanged(@Nullable String detail, LevelBar.OffsetChangedCallback handler)

      Emitted when an offset specified on the bar changes value.

      This typically is the result of a LevelBar.addOffsetValue(String, double) call.

      The signal supports detailed connections; you can connect to the detailed signal "changed::x" in order to only receive callbacks when the value of offset "x" changes.

      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also: