Class Range.Builder<B extends Range.Builder<B>>

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

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

      public B setAdjustment(Adjustment adjustment)
      The adjustment that is controlled by the range.
      Parameters:
      adjustment - the value for the adjustment property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setFillLevel

      public B setFillLevel(double fillLevel)
      The fill level (e.g. prebuffering of a network stream).
      Parameters:
      fillLevel - the value for the fill-level property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setInverted

      public B setInverted(boolean inverted)
      If true, the direction in which the slider moves is inverted.
      Parameters:
      inverted - the value for the inverted property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setRestrictToFillLevel

      public B setRestrictToFillLevel(boolean restrictToFillLevel)
      Controls whether slider movement is restricted to an upper boundary set by the fill level.
      Parameters:
      restrictToFillLevel - the value for the restrict-to-fill-level property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setRoundDigits

      public B setRoundDigits(int roundDigits)

      The number of digits to round the value to when it changes.

      See Gtk.Range::change-value.

      Parameters:
      roundDigits - the value for the round-digits property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setShowFillLevel

      public B setShowFillLevel(boolean showFillLevel)
      Controls whether fill level indicator graphics are displayed on the trough.
      Parameters:
      showFillLevel - the value for the show-fill-level property
      Returns:
      the Builder instance is returned, to allow method chaining
    • onAdjustBounds

      public B onAdjustBounds(Range.AdjustBoundsCallback handler)
      Emitted before clamping a value, to give the application a chance to adjust the bounds.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onChangeValue

      public B onChangeValue(Range.ChangeValueCallback handler)

      Emitted when a scroll action is performed on a range.

      It allows an application to determine the type of scroll event that occurred and the resultant new value. The application can handle the event itself and return true to prevent further processing. Or, by returning false, it can pass the event to other handlers until the default GTK handler is reached.

      The value parameter is unrounded. An application that overrides the ::change-value signal is responsible for clamping the value to the desired number of decimal digits; the default GTK handler clamps the value based on Gtk.Range:round-digits.

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

      public B onMoveSlider(Range.MoveSliderCallback handler)

      Virtual function that moves the slider.

      Used for keybindings.

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

      public B onValueChanged(Range.ValueChangedCallback handler)
      Emitted when the range value changes.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also: