Class WrapLayout.Builder<B extends WrapLayout.Builder<B>>
- Type Parameters:
B- the type of the Builder that is returned
- All Implemented Interfaces:
Orientable.Builder<B>,BuilderInterface
- Enclosing class:
WrapLayout
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Finish building theWrapLayoutobject.setAlign(float align) The alignment of the children within each line.setChildSpacing(int childSpacing) The spacing between widgets on the same line.setChildSpacingUnit(LengthUnit childSpacingUnit) The length unit for child spacing.setJustify(JustifyMode justify) Determines whether and how each complete line should be stretched to fill the entire widget.setJustifyLastLine(boolean justifyLastLine) Whether the last line should be stretched to fill the entire widget.setLineHomogeneous(boolean lineHomogeneous) Whether all lines should take the same amount of space.setLineSpacing(int lineSpacing) The spacing between lines.setLineSpacingUnit(LengthUnit lineSpacingUnit) The length unit for line spacing.setNaturalLineLength(int naturalLineLength) Determines the natural size for each line.setNaturalLineLengthUnit(LengthUnit naturalLineLengthUnit) The length unit for natural line length.setPackDirection(PackDirection packDirection) The direction children are packed in each line.setWrapPolicy(WrapPolicy wrapPolicy) The policy for line wrapping.setWrapReverse(boolean wrapReverse) Whether wrap direction should be reversed.Methods 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.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 theWrapLayoutobject. 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 toWrapLayout.- Overrides:
buildin classLayoutManager.Builder<B extends WrapLayout.Builder<B>>- Returns:
- a new instance of
WrapLayoutwith the properties that were set in the Builder object.
-
setAlign
The alignment of the children within each line.0 means the children are placed at the start of the line, 1 means they are placed at the end of the line. 0.5 means they are placed in the middle of the line.
Alignment is only used when
WrapLayout:justifyis set toADW_JUSTIFY_NONE, or on the last line when theWrapLayout:justify-last-lineisFALSE.- Parameters:
align- the value for thealignproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.7
-
setChildSpacing
The spacing between widgets on the same line.See
WrapLayout:child-spacing-unit.- Parameters:
childSpacing- the value for thechild-spacingproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.7
-
setChildSpacingUnit
The length unit for child spacing.Allows the spacing to vary depending on the text scale factor.
See
WrapLayout:child-spacing.- Parameters:
childSpacingUnit- the value for thechild-spacing-unitproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.7
-
setJustify
Determines whether and how each complete line should be stretched to fill the entire widget.If set to
ADW_JUSTIFY_FILL, each widget in the line will be stretched, keeping consistent spacing, so that the line fills the entire widget.If set to
ADW_JUSTIFY_SPREAD, the spacing between widgets will be increased, keeping widget sizes intact. The first and last widget will be aligned with the beginning and end of the line. If the line only contains a single widget, it will be stretched regardless.If set to
ADW_JUSTIFY_NONE, the line will not be stretched and the children will be placed together within the line, according toWrapLayout:align.By default this doesn't affect the last line, as it will be incomplete. Use
WrapLayout:justify-last-lineto justify it as well.- Parameters:
justify- the value for thejustifyproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.7
-
setJustifyLastLine
Whether the last line should be stretched to fill the entire widget.See
WrapLayout:justify.- Parameters:
justifyLastLine- the value for thejustify-last-lineproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.7
-
setLineHomogeneous
Whether all lines should take the same amount of space.- Parameters:
lineHomogeneous- the value for theline-homogeneousproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.7
-
setLineSpacing
The spacing between lines.See
WrapLayout:line-spacing-unit.- Parameters:
lineSpacing- the value for theline-spacingproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.7
-
setLineSpacingUnit
The length unit for line spacing.Allows the spacing to vary depending on the text scale factor.
See
WrapLayout:line-spacing.- Parameters:
lineSpacingUnit- the value for theline-spacing-unitproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.7
-
setNaturalLineLength
Determines the natural size for each line.It should be used to limit the line lengths, for example when used in popovers.
See
WrapLayout:natural-line-length-unit.- Parameters:
naturalLineLength- the value for thenatural-line-lengthproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.7
-
setNaturalLineLengthUnit
The length unit for natural line length.Allows the length to vary depending on the text scale factor.
See
WrapLayout:natural-line-length.- Parameters:
naturalLineLengthUnit- the value for thenatural-line-length-unitproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.7
-
setPackDirection
The direction children are packed in each line.- Parameters:
packDirection- the value for thepack-directionproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.7
-
setWrapPolicy
The policy for line wrapping.If set to
ADW_WRAP_NATURAL, the box will wrap to the next line as soon as the previous line cannot fit any more children without shrinking them past their natural size.If set to
ADW_WRAP_MINIMUM, the box will try to fit as many children into each line as possible, shrinking them down to their minimum size before wrapping to the next line.- Parameters:
wrapPolicy- the value for thewrap-policyproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.7
-
setWrapReverse
Whether wrap direction should be reversed.By default, lines wrap downwards in a horizontal box, and towards the end in a vertical box. If set to
TRUE, they wrap upwards or towards the start respectively.- Parameters:
wrapReverse- the value for thewrap-reverseproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.7
-