Class ClampLayout.Builder<B extends ClampLayout.Builder<B>>
- Type Parameters:
B
- the type of the Builder that is returned
- All Implemented Interfaces:
BuilderInterface
,Orientable.Builder<B>
- Enclosing class:
ClampLayout
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Finish building theClampLayout
object.setMaximumSize
(int maximumSize) The maximum size to allocate to the children.setTighteningThreshold
(int tighteningThreshold) The size above which the children are clamped.setUnit
(LengthUnit unit) The length unit for maximum size and tightening threshold.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 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 theClampLayout
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 toClampLayout
.- Overrides:
build
in classLayoutManager.Builder<B extends ClampLayout.Builder<B>>
- Returns:
- a new instance of
ClampLayout
with the properties that were set in the Builder object.
-
setMaximumSize
The maximum size to allocate to the children.It is the width if the layout is horizontal, or the height if it is vertical.
- Parameters:
maximumSize
- the value for themaximum-size
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setTighteningThreshold
The size above which the children are clamped.Starting from this size, the layout will tighten its grip on the children, slowly allocating less and less of the available size up to the maximum allocated size. Below that threshold and below the maximum size, the children will be allocated all the available size.
If the threshold is greater than the maximum size to allocate to the children, they will be allocated the whole size up to the maximum. If the threshold is lower than the minimum size to allocate to the children, that size will be used as the tightening threshold.
Effectively, tightening the grip on a child before it reaches its maximum size makes transitions to and from the maximum size smoother when resizing.
- Parameters:
tighteningThreshold
- the value for thetightening-threshold
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setUnit
The length unit for maximum size and tightening threshold.Allows the sizes to vary depending on the text scale factor.
- Parameters:
unit
- the value for theunit
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-