Package org.gnome.gtk
Class CenterLayout
- All Implemented Interfaces:
Proxy
GtkCenterLayout
is a layout manager that manages up to three children.
The start widget is allocated at the start of the layout (left in left-to-right locales and right in right-to-left ones), and the end widget at the end.
The center widget is centered regarding the full width of the layout's.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
CenterLayout.Builder<B extends CenterLayout.Builder<B>>
Inner class implementing a builder pattern to construct a GObject with properties.static class
Nested classes/interfaces inherited from class org.gnome.gtk.LayoutManager
LayoutManager.LayoutManagerClass, LayoutManager.LayoutManagerImpl
Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass
-
Constructor Summary
ConstructorDescriptionCreates a newGtkCenterLayout
.CenterLayout
(MemorySegment address) Create a CenterLayout proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected CenterLayout
asParent()
Returns this instance as if it were its parent type.static CenterLayout.Builder
<? extends CenterLayout.Builder> builder()
ACenterLayout.Builder
object constructs aCenterLayout
with the specified properties.Returns the baseline position of the layout.Returns the center widget of the layout.Returns the end widget of the layout.Gets the current orienration of the layout manager.boolean
Gets whether this CenterLayout shrinks the center widget after other children.Returns the start widget of the layout.static Type
getType()
Get the GType of the CenterLayout classvoid
setBaselinePosition
(BaselinePosition baselinePosition) Sets the new baseline position of this CenterLayoutvoid
setCenterWidget
(@Nullable Widget widget) Sets the new center widget of this CenterLayout.void
setEndWidget
(@Nullable Widget widget) Sets the new end widget of this CenterLayout.void
setOrientation
(Orientation orientation) Sets the orientation of this CenterLayout.void
setShrinkCenterLast
(boolean shrinkCenterLast) Sets whether to shrink the center widget after other children.void
setStartWidget
(@Nullable Widget widget) Sets the new start widget of this CenterLayout.Methods inherited from class org.gnome.gtk.LayoutManager
allocate, createLayoutChild, getLayoutChild, getMemoryLayout, getRequestMode, getRequestMode, getWidget, layoutChanged, measure, root, unroot
Methods inherited from class org.gnome.gobject.GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newInstance, newInstance, newv, notify_, notify_, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withProperties
Methods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, getPrivate, readGClass, writeGClass
Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
CenterLayout
Create a CenterLayout proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
CenterLayout
public CenterLayout()Creates a newGtkCenterLayout
.
-
-
Method Details
-
getType
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuper
keyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()
doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName()
. This will call the native function pointer of this virtual method in the typeclass of the parent type.- Overrides:
asParent
in classLayoutManager
-
getBaselinePosition
Returns the baseline position of the layout.- Returns:
- The current baseline position of this CenterLayout.
-
getCenterWidget
Returns the center widget of the layout.- Returns:
- the current center widget of this CenterLayout
-
getEndWidget
Returns the end widget of the layout.- Returns:
- the current end widget of this CenterLayout
-
getOrientation
Gets the current orienration of the layout manager.- Returns:
- The current orientation of this CenterLayout
-
getShrinkCenterLast
public boolean getShrinkCenterLast()Gets whether this CenterLayout shrinks the center widget after other children.- Returns:
- whether to shrink the center widget after others
-
getStartWidget
Returns the start widget of the layout.- Returns:
- The current start widget of this CenterLayout
-
setBaselinePosition
Sets the new baseline position of this CenterLayout- Parameters:
baselinePosition
- the new baseline position
-
setCenterWidget
Sets the new center widget of this CenterLayout.To remove the existing center widget, pass
null
.- Parameters:
widget
- the new center widget
-
setEndWidget
Sets the new end widget of this CenterLayout.To remove the existing center widget, pass
null
.- Parameters:
widget
- the new end widget
-
setOrientation
Sets the orientation of this CenterLayout.- Parameters:
orientation
- the new orientation
-
setShrinkCenterLast
public void setShrinkCenterLast(boolean shrinkCenterLast) Sets whether to shrink the center widget after other children.By default, when there's no space to give all three children their natural widths, the start and end widgets start shrinking and the center child keeps natural width until they reach minimum width.
If set to
FALSE
, start and end widgets keep natural width and the center widget starts shrinking instead.- Parameters:
shrinkCenterLast
- whether to shrink the center widget after others
-
setStartWidget
Sets the new start widget of this CenterLayout.To remove the existing start widget, pass
null
.- Parameters:
widget
- the new start widget
-
builder
ACenterLayout.Builder
object constructs aCenterLayout
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withCenterLayout.Builder.build()
.
-