public abstract class WPanel extends WWidget
| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<WWidget> |
children
The widgets contained within this panel.
|
| Constructor and Description |
|---|
WPanel() |
| Modifier and Type | Method and Description |
|---|---|
void |
addPainters()
Adds the default background painters to this widget and all children.
|
boolean |
canResize()
Checks whether this widget can be resized using
WWidget.setSize(int, int). |
void |
createPeers(GuiDescription c)
Creates "heavyweight" component peers
|
@Nullable WWidget |
cycleFocus(boolean lookForwards)
Cycles the focus inside this widget.
|
@Nullable WWidget |
cycleFocus(boolean lookForwards,
@Nullable WWidget pivot)
Cycles the focus inside this panel.
|
protected void |
expandToFit(WWidget w)
Expands this panel be at least as large as the widget.
|
protected void |
expandToFit(WWidget w,
Insets insets)
Expands this panel be at least as large as the widget.
|
BackgroundPainter |
getBackgroundPainter()
Gets the current
BackgroundPainter of this panel. |
WWidget |
hit(int x,
int y)
Finds the most specific child node at this location.
|
void |
layout()
Uses this Panel's layout rules to reposition and resize components to fit nicely in the panel.
|
void |
onHidden()
Notifies this widget that it won't be drawn and
hides any visible peers of itself and its children.
|
void |
onShown()
Notifies this widget that it is visible and
shows any hidden peers of itself and its children.
|
void |
paint(net.minecraft.client.util.math.MatrixStack matrices,
int x,
int y,
int mouseX,
int mouseY)
Paints this widget.
|
void |
remove(WWidget w)
Removes the widget from this panel.
|
WPanel |
setBackgroundPainter(BackgroundPainter painter)
Sets the
BackgroundPainter of this panel. |
void |
tick()
Ticks all children of this panel.
|
java.lang.String |
toString() |
void |
validate(GuiDescription c)
Creates component peers, lays out children, and initializes animation data for this Widget and all its children.
|
addTooltip, canFocus, getAbsoluteX, getAbsoluteY, getHeight, getHost, getParent, getWidth, getX, getY, isActivationKey, isFocused, isWithinBounds, onCharTyped, onClick, onFocusGained, onFocusLost, onKeyPressed, onKeyReleased, onMouseDown, onMouseDrag, onMouseMove, onMouseScroll, onMouseUp, releaseFocus, renderTooltip, requestFocus, setHost, setLocation, setParent, setSizeprotected final java.util.List<WWidget> children
The list is mutable.
public void createPeers(GuiDescription c)
WWidgetcreatePeers in class WWidgetc - the top-level Container that will hold the peerspublic void remove(WWidget w)
w - the removed widgetpublic boolean canResize()
WWidgetWWidget.setSize(int, int).@Environment(value=CLIENT) public WPanel setBackgroundPainter(BackgroundPainter painter)
BackgroundPainter of this panel.painter - the new painter@Environment(value=CLIENT) public BackgroundPainter getBackgroundPainter()
BackgroundPainter of this panel.public void layout()
protected void expandToFit(WWidget w)
w - the widgetprotected void expandToFit(WWidget w, Insets insets)
w - the widgetinsets - the layout insetspublic WWidget hit(int x, int y)
public void validate(GuiDescription c)
Subclasses should call super.validate(c) to ensure that children are validated.
@Environment(value=CLIENT)
public void paint(net.minecraft.client.util.math.MatrixStack matrices,
int x,
int y,
int mouseX,
int mouseY)
WWidget@Environment(value=CLIENT) public void tick()
@Nullable public @Nullable WWidget cycleFocus(boolean lookForwards)
WWidgetIf this widget is not focusable, returns null.
cycleFocus in class WWidgetlookForwards - whether this should cycle forwards (true) or backwards (false)@Nullable public @Nullable WWidget cycleFocus(boolean lookForwards, @Nullable @Nullable WWidget pivot)
lookForwards - whether this should cycle forwards (true) or backwards (false)pivot - the widget that should be cycled around (can be null for beginning / end)public void onShown()
WWidgetpublic void onHidden()
WWidgetThe default implementation releases this widget's focus if it is focused. Overriding implementations might want to do this as well.
@Environment(value=CLIENT) public void addPainters()
Always called before GuiDescription.addPainters() to allow users to modify painters.
Subclasses should call super.addPainters() to ensure that children have proper default painters.
addPainters in class WWidgetpublic java.lang.String toString()
toString in class java.lang.Object