Package org.gnome.adw
Class Carousel.Builder<B extends Carousel.Builder<B>>
java.lang.Object
io.github.jwharm.javagi.gobject.Builder<B>
org.gnome.gobject.GObject.Builder<B>
org.gnome.gobject.InitiallyUnowned.Builder<B>
org.gnome.gtk.Widget.Builder<B>
org.gnome.adw.Carousel.Builder<B>
- Type Parameters:
B
- the type of the Builder that is returned
- All Implemented Interfaces:
BuilderInterface
,Accessible.Builder<B>
,Orientable.Builder<B>
- 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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Finish building theCarousel
object.This signal is emitted after a page has been changed.setAllowLongSwipes
(boolean allowLongSwipes) Whether to allow swiping for more than one page at a time.setAllowMouseDrag
(boolean allowMouseDrag) Sets whether theAdwCarousel
can be dragged with mouse pointer.setAllowScrollWheel
(boolean allowScrollWheel) Whether the widget will respond to scroll wheel events.setInteractive
(boolean interactive) Whether the carousel can be navigated.setRevealDuration
(int revealDuration) Page reveal duration, in milliseconds.setScrollParams
(SpringParams scrollParams) Scroll animation spring parameters.setSpacing
(int spacing) Spacing between pages in pixels.Methods inherited from class org.gnome.gtk.Widget.Builder
onDestroy, onDirectionChanged, onHide, onKeynavFailed, onMap, onMnemonicActivate, onMoveFocus, onQueryTooltip, onRealize, onShow, onStateFlagsChanged, onUnmap, onUnrealize, setCanFocus, setCanTarget, setCssClasses, setCssName, setCursor, setFocusable, setFocusOnClick, setHalign, setHasTooltip, setHeightRequest, setHexpand, setHexpandSet, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOverflow, setReceivesDefault, setSensitive, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible, setWidthRequest
Methods inherited from class org.gnome.gobject.GObject.Builder
onNotify
Methods inherited from class io.github.jwharm.javagi.gobject.Builder
addBuilderProperty, connect, connect, connectSignals, getArena, getNames, getValues
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.gnome.gtk.Accessible.Builder
setAccessibleRole
Methods inherited from interface io.github.jwharm.javagi.gobject.BuilderInterface
addBuilderProperty, connect, connect, getArena
Methods inherited from interface org.gnome.gtk.Orientable.Builder
setOrientation
-
Constructor Details
-
Builder
protected Builder()Default constructor for aBuilder
object.
-
-
Method Details
-
build
Finish building theCarousel
object. This will callGObject.withProperties(org.gnome.glib.Type, java.lang.String[], org.gnome.gobject.Value[])
to create a new GObject instance, which is then cast toCarousel
.- Overrides:
build
in classWidget.Builder<B extends Carousel.Builder<B>>
- Returns:
- a new instance of
Carousel
with the properties that were set in the Builder object.
-
setAllowLongSwipes
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 theallow-long-swipes
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setAllowMouseDrag
Sets whether theAdwCarousel
can be dragged with mouse pointer.If the value is
FALSE
, dragging is only available on touch.- Parameters:
allowMouseDrag
- the value for theallow-mouse-drag
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setAllowScrollWheel
Whether the widget will respond to scroll wheel events.If the value is
FALSE
, wheel events will be ignored.- Parameters:
allowScrollWheel
- the value for theallow-scroll-wheel
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setInteractive
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 theinteractive
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setRevealDuration
Page reveal duration, in milliseconds.Reveal duration is used when animating adding or removing pages.
- Parameters:
revealDuration
- the value for thereveal-duration
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setScrollParams
Scroll animation spring parameters.The default value is equivalent to:
adw_spring_params_new (1, 0.5, 500)
- Parameters:
scrollParams
- the value for thescroll-params
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setSpacing
Spacing between pages in pixels.- Parameters:
spacing
- the value for thespacing
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
onPageChanged
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:
-