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

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

      public B setAllowLongSwipes(boolean allowLongSwipes)

      Whether to allow swiping for more than one page at a time.

      If the value is FALSE, each swipe can only move to the adjacent pages.

      Parameters:
      allowLongSwipes - the value for the allow-long-swipes property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setAllowMouseDrag

      public B setAllowMouseDrag(boolean allowMouseDrag)

      Sets whether the AdwCarousel can be dragged with mouse pointer.

      If the value is FALSE, dragging is only available on touch.

      Parameters:
      allowMouseDrag - the value for the allow-mouse-drag property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setAllowScrollWheel

      public B setAllowScrollWheel(boolean allowScrollWheel)

      Whether the widget will respond to scroll wheel events.

      If the value is FALSE, wheel events will be ignored.

      Parameters:
      allowScrollWheel - the value for the allow-scroll-wheel property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setInteractive

      public B setInteractive(boolean interactive)

      Whether the carousel can be navigated.

      This can be used to temporarily disable the carousel to only allow navigating it in a certain state.

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

      public B setRevealDuration(int revealDuration)

      Page reveal duration, in milliseconds.

      Reveal duration is used when animating adding or removing pages.

      Parameters:
      revealDuration - the value for the reveal-duration property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setScrollParams

      public B setScrollParams(SpringParams scrollParams)

      Scroll animation spring parameters.

      The default value is equivalent to:

      adw_spring_params_new (1, 0.5, 500)
      
      Parameters:
      scrollParams - the value for the scroll-params property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setSpacing

      public B setSpacing(int spacing)
      Spacing between pages in pixels.
      Parameters:
      spacing - the value for the spacing property
      Returns:
      the Builder instance is returned, to allow method chaining
    • onPageChanged

      public B onPageChanged(Carousel.PageChangedCallback handler)

      This signal is emitted after a page has been changed.

      It can be used to implement "infinite scrolling" by amending the pages after every scroll.

      ::: note An empty carousel is indicated by (int)index == -1.

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