Class RelationsKt
-
- All Implemented Interfaces:
public final class RelationsKt
-
-
Method Summary
Modifier and Type Method Description final static <S extends Component> Sprioritize(S $self)Prioritize this component, meaning it will, in relation to its siblings: be drawn last (so visually on top)
receive events first
final static <S extends Component> Srelegate(S $self)Relegate this component, meaning it will, in relation to its siblings: be drawn first (so visually on the bottom)
receive events last
final static <S extends Component> Slocate(Component $self, String id)Locate a component by its name. final static BooleanisChildOf(Component $self, Component component)Returns trueif this component is a child of the specified component.final static BooleanisRelatedTo(Component $self, Component component)Returns trueif this component is a child of the specified component, or if the component is a child of this.final static IntegercountChildren(Component $self)Returns a count of this component's children, including children of children. final static BooleanhasChildIn(Component $self, Float x, Float y, Float width, Float height)-
-
Method Detail
-
prioritize
@ApiStatus.Experimental() final static <S extends Component> S prioritize(S $self)
Prioritize this component, meaning it will, in relation to its siblings:
be drawn last (so visually on top)
receive events first
this method is experimental as it may interfere with statically-typed references to children.
- Since:
1.0.0
-
relegate
@ApiStatus.Experimental() final static <S extends Component> S relegate(S $self)
Relegate this component, meaning it will, in relation to its siblings:
be drawn first (so visually on the bottom)
receive events last
this method is experimental as it may interfere with statically-typed references to children.
- Since:
1.1.71
-
locate
final static <S extends Component> S locate(Component $self, String id)
Locate a component by its name.
This method is recursive, meaning it will search through all children of this component.
- Parameters:
id- the name of the drawable to locate.- Returns:
the drawable with the given name, or
nullif it was not found.- Since:
1.1.72
-
isChildOf
final static Boolean isChildOf(Component $self, Component component)
Returns
trueif this component is a child of the specified component.- Since:
1.4.2
-
isRelatedTo
final static Boolean isRelatedTo(Component $self, Component component)
Returns
trueif this component is a child of the specified component, or if the component is a child of this.- Since:
1.4.2
-
countChildren
final static Integer countChildren(Component $self)
Returns a count of this component's children, including children of children.
- Since:
1.0.1
-
-
-