Class WidgetInstance<W extends Widget>
java.lang.Object
dev.pfaff.altargui.WidgetInstance<W>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal float
final float
final float
final float
void
applyBuiltinSelector
(BuiltinSelector selector, Consumer<WidgetInstance> consumer) final boolean
final boolean
final float
final float
protected static void
computeFillLayout
(WidgetInstance element, LayoutContext context) protected abstract void
computeLayout
(LayoutContext context) protected abstract void
computeMount
(MountContext context) abstract void
configure
(StateContext stateContext, W widget, boolean init) Configures the instance's state according to the inputs in the specifiedwidget
.final void
protected final void
void
dispose()
Disposes of the element...final boolean
protected final void
Sets the computed size to fill the entire allocated rect.final GuiContext
final int
hashCode()
final boolean
isInside
(double checkX, double checkY) final long
key()
final void
layout
(LayoutContext context) mounts children and computes actual size and position from the allocated rectprotected final void
protected void
final void
mount
(MountContext context) void
onMount()
Called when the element is mounted to a new parent.void
Called when the element is unmounted from the current parent.protected final void
protected final void
final void
setAllocatedRect
(float x, float y, float width, float height) final void
setAllocatedRect
(float x, float y, float width, float height, boolean canOverflowX, boolean canOverflowY) protected final void
setComputedSize
(float width, float height) boolean
shouldPaint
(MountContext mountContext) protected final boolean
final String
toString()
final String
void
uSpecMount
(MountContext context)
-
Field Details
-
EMPTY_ARRAY
-
needsLayout
-
-
Constructor Details
-
WidgetInstance
-
-
Method Details
-
configure
Configures the instance's state according to the inputs in the specifiedwidget
.Other initialization might be done if
init
is true. -
onMount
public void onMount()Called when the element is mounted to a new parent. -
onUnmount
@MustBeInvokedByOverriders public void onUnmount()Called when the element is unmounted from the current parent. -
dispose
@MustBeInvokedByOverriders public void dispose()Disposes of the element... currently the element may be reused, but this will likely change in the future. -
shouldPaint
- Specified by:
shouldPaint
in interfaceCullable
-
layout
mounts children and computes actual size and position from the allocated rectThis will usually call
LayoutContext.layout(WidgetInstance, WidgetInstance, BiConsumer)
with each child and go through a layout procedure whereinsetAllocatedRect(float, float, float, float)
and thenlayout(LayoutContext)
are called (in that order) on each child. -
mount
-
uSpecMount
-
computeFillLayout
-
computeLayout
-
computeMount
-
markNeedsLayout
protected final void markNeedsLayout() -
takeNeedsLayout
protected final boolean takeNeedsLayout() -
allocatedX
public final float allocatedX() -
allocatedY
public final float allocatedY() -
allocatedWidth
public final float allocatedWidth() -
allocatedHeight
public final float allocatedHeight() -
canOverflowX
public final boolean canOverflowX() -
canOverflowY
public final boolean canOverflowY() -
markNeedsLayoutOnAllocationChange
protected void markNeedsLayoutOnAllocationChange() -
setAllocatedRect
public final void setAllocatedRect(float x, float y, float width, float height, boolean canOverflowX, boolean canOverflowY) -
setAllocatedRect
public final void setAllocatedRect(float x, float y, float width, float height) -
copyAllocatedRectFrom
-
requireFiniteAllocatedWidth
protected final void requireFiniteAllocatedWidth() -
requireFiniteAllocatedHeight
protected final void requireFiniteAllocatedHeight() -
computedWidth
public final float computedWidth() -
computedHeight
public final float computedHeight() -
setComputedSize
protected final void setComputedSize(float width, float height) -
copyComputedSizeFrom
-
fillAllocated
protected final void fillAllocated()Sets the computed size to fill the entire allocated rect. -
isInside
public final boolean isInside(double checkX, double checkY) -
applyBuiltinSelector
-
toStringShort
-
toString
-
guiContext
-
key
public final long key() -
equals
-
hashCode
-