Class TWindowElement
java.lang.Object
com.thecsdev.common.scene.Node<TElement>
com.thecsdev.commonmc.api.client.gui.TElement
com.thecsdev.commonmc.api.client.gui.panel.window.TWindowElement
- All Implemented Interfaces:
INode<TElement>, INodeBounded<TElement,Bounds2i>, INodeRenderable<TElement, TGuiGraphics>, Iterable<TElement>, Collection<TElement>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumConstants used to define what happens whenclose()is called. -
Field Summary
Fields inherited from class TElement
eInitialized -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal IntegerPropertyIntegerPropertythat holds the background color of this window.final voidclose()Invokes theTWindowElement.CloseOperationthat is assigned to thisTWindowElement.NotNullPropertythat controls what happens whenclose()is called.protected abstract voidinitBodyCallback(@NotNull TElement body) Similar toinitCallback(), except elements are initialized onto the provided "body"TElement.protected final voidCallback method that is invoked when thisTElementis initializing.final booleaninputCallback(TInputContext.InputDiscoveryPhase phase, @NotNull TInputContext context) A callback method that is invoked when the user makes an input.final BooleanPropertyBooleanPropertythat controls whether this window is maximized or not.final voidpostRenderCallback(@NotNull TGuiGraphics pencil) Callback method that is invoked after thisNodeand all of their children have been rendered.voidrenderCallback(@NotNull TGuiGraphics pencil) Callback method that is invoked when thisNodeis being rendered.final NotNullProperty<Bounds2i> NotNullPropertythat holds the preferred bounds of this window, that are used when not maximized.final NotNullProperty<net.minecraft.network.chat.Component> NotNullPropertyholding the title of this window, that is shown in the title-bar.Methods inherited from class TElement
addRel, boundsProperty, clearAndInit, clipsDescendantsProperty, contextMenuProperty, dragEndCallback, dragStartCallback, findElementAt, focusableProperty, focusGainedCallback, focusLostCallback, forEachVisible, getBaseType, getBounds, getClient, getContentBounds, getCursor, getSelf, getTooltip, hoverableProperty, hoverGainedCallback, hoverLostCallback, invalidateTooltipCache, isFocusable, isFocused, isHoverable, isHovered, isHoveredOrFocused, isVisible, move, moveChildren, moveTo, removeRel, screenProperty, setBounds, setBounds, setBounds, showContextMenu, tickCallback, tooltipProperty, toString, visiblePropertyMethods inherited from class Node
add, addAll, childAddedCallback, childRemovedCallback, clear, contains, containsAll, equals, findChild, findParent, findSibling, forEach, get, getFirst, getLast, getParent, hashCode, indexOf, isEmpty, iterator, parentProperty, remove, remove, remove, removeAll, retainAll, rootProperty, size, toArray, toArray
-
Constructor Details
-
TWindowElement
public TWindowElement()
-
-
Method Details
-
titleProperty
NotNullPropertyholding the title of this window, that is shown in the title-bar. -
closeOperationProperty
NotNullPropertythat controls what happens whenclose()is called. -
maximizedProperty
BooleanPropertythat controls whether this window is maximized or not.When setting this to
true, it is highly advised to set the value ofrestoredBoundsProperty()if you haven't already - specifically if thisTWindowElementis maximized from the beginning of its lifespan (as in, you maximized it the moment you created it). -
restoredBoundsProperty
NotNullPropertythat holds the preferred bounds of this window, that are used when not maximized. Specifically, when restoring-down - the window will return to these bounds.The value of this property is automatically updated whenever the value of
maximizedProperty()is set totrue.This value will be overridden when maximizing this
TWindowElement.- See Also:
-
backgroundColorProperty
IntegerPropertythat holds the background color of this window. -
initCallback
protected final void initCallback()Description copied from class:TElementCallback method that is invoked when thisTElementis initializing. You may override this method to create and add childTElements.- Overrides:
initCallbackin classTElement- See Also:
-
renderCallback
Description copied from interface:INodeRenderableCallback method that is invoked when thisNodeis being rendered.- Specified by:
renderCallbackin interfaceINodeRenderable<TElement, TGuiGraphics>- Overrides:
renderCallbackin classTElement- Parameters:
pencil- The rendering context.
-
postRenderCallback
Description copied from interface:INodeRenderableCallback method that is invoked after thisNodeand all of their children have been rendered.- Specified by:
postRenderCallbackin interfaceINodeRenderable<TElement, TGuiGraphics>- Overrides:
postRenderCallbackin classTElement- Parameters:
pencil- The rendering context.
-
inputCallback
public final boolean inputCallback(@NotNull TInputContext.InputDiscoveryPhase phase, @NotNull @NotNull TInputContext context) throws NullPointerException Description copied from class:TElementA callback method that is invoked when the user makes an input.- Overrides:
inputCallbackin classTElement- Parameters:
phase- The input discovery phase.context- Information about the user's input.- Returns:
trueif thisTElementhandled the input.- Throws:
NullPointerException- If an argument isnull.
-
initBodyCallback
Similar toinitCallback(), except elements are initialized onto the provided "body"TElement.- Parameters:
body- The parent element where the GUI is to be initialized.
-
close
public final void close()Invokes theTWindowElement.CloseOperationthat is assigned to thisTWindowElement.- See Also:
-