Package org.gnome.adw
Class Carousel.Builder<B extends Carousel.Builder<B>>
java.lang.Object
org.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:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Finish building theCarouselobject.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 theAdwCarouselcan 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, setLimitEvents, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOverflow, setReceivesDefault, setSensitive, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible, setWidthRequestMethods inherited from class org.gnome.gobject.GObject.Builder
onNotifyMethods inherited from class org.javagi.gobject.Builder
addBuilderProperty, connect, connect, connectSignals, getArena, getNames, getValuesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gnome.gtk.Accessible.Builder
setAccessibleRoleMethods inherited from interface org.javagi.gobject.BuilderInterface
addBuilderProperty, connect, connect, getArenaMethods inherited from interface org.gnome.gtk.Orientable.Builder
setOrientation
-
Constructor Details
-
Builder
protected Builder()Default constructor for aBuilderobject.
-
-
Method Details
-
build
Finish building theCarouselobject. 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:
buildin classWidget.Builder<B extends Carousel.Builder<B>>- Returns:
- a new instance of
Carouselwith 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-swipesproperty- Returns:
- the
Builderinstance is returned, to allow method chaining
-
setAllowMouseDrag
Sets whether theAdwCarouselcan be dragged with mouse pointer.If the value is
FALSE, dragging is only available on touch.- Parameters:
allowMouseDrag- the value for theallow-mouse-dragproperty- Returns:
- the
Builderinstance 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-wheelproperty- Returns:
- the
Builderinstance 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 theinteractiveproperty- Returns:
- the
Builderinstance 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-durationproperty- Returns:
- the
Builderinstance 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-paramsproperty- Returns:
- the
Builderinstance is returned, to allow method chaining
-
setSpacing
Spacing between pages in pixels.- Parameters:
spacing- the value for thespacingproperty- Returns:
- the
Builderinstance 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
Builderinstance is returned, to allow method chaining - See Also:
-