Class WPanelWithInsets
java.lang.Object
io.github.cottonmc.cotton.gui.widget.WWidget
io.github.cottonmc.cotton.gui.widget.WPanel
io.github.cottonmc.cotton.gui.widget.WPanelWithInsets
- Direct Known Subclasses:
WBox
,WGridPanel
,WPlainPanel
A panel that has layout insets.
- Since:
- 4.0.0
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Expands this panel be at least as large as the widget.Gets the layout insets of this panel.Sets the layout insets of this panel.Methods inherited from class io.github.cottonmc.cotton.gui.widget.WPanel
addPainters, canResize, expandToFit, getBackgroundPainter, hit, layout, onHidden, onShown, paint, remove, setBackgroundPainter, setHost, streamChildren, tick, toString, validate
Methods inherited from class io.github.cottonmc.cotton.gui.widget.WWidget
addNarrations, addTooltip, canFocus, canHover, getAbsoluteX, getAbsoluteY, getFocusModel, getHeight, getHost, getParent, getWidth, getX, getY, hoveredProperty, isActivationKey, isFocused, isHovered, isNarratable, isWithinBounds, onCharTyped, onClick, onFocusGained, onFocusLost, onKeyPressed, onKeyReleased, onMouseDown, onMouseDrag, onMouseMove, onMouseScroll, onMouseUp, releaseFocus, renderTooltip, requestFocus, setHovered, setLocation, setParent, setSize, shouldRenderInDarkMode
-
Field Details
-
insets
The layout insets of this panel. They control how far from the panel's edges the widgets are placed.
-
-
Constructor Details
-
WPanelWithInsets
public WPanelWithInsets()
-
-
Method Details
-
getInsets
Gets the layout insets of this panel.- Returns:
- the insets
-
setInsets
Sets the layout insets of this panel. Subclasses are encouraged to override this method to return their more specific type (such asWGridPanel
).If there are already widgets in this panel when the insets are modified, the panel is resized and the widgets are moved according to the insets.
- Parameters:
insets
- the insets, should not be null- Returns:
- this panel
-
expandToFit
Description copied from class:WPanel
Expands this panel be at least as large as the widget.- Overrides:
expandToFit
in classWPanel
- Parameters:
w
- the widget
-