Class Node
java.lang.Object
dev.prozilla.pine.core.component.Component
dev.prozilla.pine.core.component.ui.Node
- All Implemented Interfaces:
EventDispatcherContext<NodeEventType,,Node, NodeEvent> EventDispatcherProvider<NodeEventType,,Node, NodeEvent> Destructible,Printable,ApplicationContext,ApplicationProvider,ComponentsContext,ComponentsProvider,EntityContext,EntityProvider,SceneContext,SceneProvider
public class Node
extends Component
implements EventDispatcherProvider<NodeEventType,Node,NodeEvent>
Component for nodes that make up the user interface.
Nodes are similar to HTML elements and the CSS box model.
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.prozilla.pine.common.event.EventDispatcherContext
EventDispatcherContext.EphemeralEventListener<EventType extends Enum<EventType>,E extends Event<EventType, ?>> -
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanIf true, this node won't be arranged by a layout node.booleanbooleanbooleanstatic final GridAlignmentstatic final Colorstatic final Colorstatic final Stringstatic final StringintbooleanIf true, allows the cursor to pass through this element.booleanint -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddModifier(String modifier) voidclick()voidfocus()floatfloatfloatfloatfloatgetName()floatfloatfloatfloatgetRoot()Gets the node root of this node.floatgetX()floatgetY()booleanbooleanbooleanisInside(int x, int y) Checks if a point is inside this rectangle.booleanChecks if a point is inside this rectangle.static booleanisInsideRect(float x, float y, Vector2f rectPosition, Vector2f rectSize) Checks if a point is inside a given rectangle.static booleanisInsideRect(Vector2f point, Vector2f rectPosition, Vector2f rectSize) Checks if a point is inside a given rectangle.booleanvoidremoveClass(String className) voidremoveModifier(String modifier) voidtoggleClass(String className) voidtoggleClass(String className, boolean active) voidtoggleModifier(String modifier) voidtoggleModifier(String modifier, boolean active) Methods inherited from class dev.prozilla.pine.core.component.Component
destroy, equals, getApplication, getEntity, getScene, hashCode, setActive, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface dev.prozilla.pine.core.ApplicationProvider
getAudioDevice, getConfig, getInput, getLogger, getModManager, getRenderer, getTimer, getTracker, getWindowMethods inherited from interface dev.prozilla.pine.core.component.ComponentsProvider
getComponent, getComponentInParent, getComponentInParent, getComponents, getComponentsInChildrenMethods inherited from interface dev.prozilla.pine.core.entity.EntityContext
isDescendantOfMethods inherited from interface dev.prozilla.pine.core.entity.EntityProvider
getChildWithTag, getFirstChild, getLastChild, getParentWithTag, getTransform, isDescendantOfMethods inherited from interface dev.prozilla.pine.common.event.EventDispatcherContext
addListener, addTargetedListener, off, on, onceMethods inherited from interface dev.prozilla.pine.common.event.EventDispatcherProvider
addListener, invoke, removeListenerMethods inherited from interface dev.prozilla.pine.core.scene.SceneProvider
getCameraData, getWorld
-
Field Details
-
currentPosition
-
currentInnerSize
-
currentOuterSize
-
offset
-
cursorHit
public boolean cursorHit -
readyToRender
public boolean readyToRender -
iterations
public int iterations -
anchor
-
passThrough
public boolean passThroughIf true, allows the cursor to pass through this element. -
absolutePosition
public boolean absolutePositionIf true, this node won't be arranged by a layout node. -
tooltipText
-
tabIndex
public int tabIndex -
autoFocus
public boolean autoFocus -
color
-
backgroundColor
-
borderColor
-
size
-
padding
-
margin
-
border
-
borderImage
-
borderImageSlice
-
borderImageSliceFill
public boolean borderImageSliceFill -
classes
-
modifiers
-
root
-
DEFAULT_COLOR
-
DEFAULT_BACKGROUND_COLOR
-
DEFAULT_ANCHOR
-
HOVER_MODIFIER
- See Also:
-
FOCUS_MODIFIER
- See Also:
-
-
Constructor Details
-
Node
public Node()
-
-
Method Details
-
getName
-
isInside
Checks if a point is inside this rectangle.- Returns:
- True if the point is inside the rectangle
-
isInside
public boolean isInside(int x, int y) Checks if a point is inside this rectangle.- Parameters:
x- X positiony- Y position- Returns:
- True if the point is inside the rectangle
-
isInsideRect
Checks if a point is inside a given rectangle.- Parameters:
rectPosition- Position of the rectanglerectSize- Size of the rectangle- Returns:
- True if the point is inside the rectangle
-
isInsideRect
Checks if a point is inside a given rectangle.- Parameters:
rectPosition- Position of the rectanglerectSize- Size of the rectangle- Returns:
- True if the point is inside the rectangle
-
getContext
-
isInLayout
public boolean isInLayout() -
isInTooltip
public boolean isInTooltip() -
getRoot
Gets the node root of this node.- Throws:
IllegalStateException- When this entity is not a child of an entity with a node root component.
-
getOuterSizeX
public float getOuterSizeX() -
getOuterSizeY
public float getOuterSizeY() -
getInnerSizeX
public float getInnerSizeX() -
getInnerSizeY
public float getInnerSizeY() -
getPaddingX
public float getPaddingX() -
getPaddingY
public float getPaddingY() -
getX
public float getX() -
getY
public float getY() -
getMarginX
public float getMarginX() -
getMarginY
public float getMarginY() -
getBorderWidth
public float getBorderWidth() -
getEventDispatcher
- Specified by:
getEventDispatcherin interfaceEventDispatcherProvider<NodeEventType,Node, NodeEvent>
-
toggleClass
-
toggleClass
-
addClass
-
removeClass
-
toggleModifier
-
toggleModifier
-
addModifier
-
removeModifier
-
click
public void click() -
focus
public void focus() -
isFocused
public boolean isFocused()
-