Class MultiMask<T>
java.lang.Object
io.github.projectunified.craftux.mask.MultiMask<T>
- Type Parameters:
T- the type of the child element
- Direct Known Subclasses:
AnimatedMask,HybridMask,ListMask,MultiPositionMask
A base class for masks that manage multiple child elements.
Provides functionality to add, retrieve, and manage lifecycle of child elements.
Example usage:
MultiMask<Mask> multiMask = new MyMultiMask();
multiMask.add(new SingleMask(Position.of(0, 0), button1), new SingleMask(Position.of(1, 1), button2));
List<Mask> elements = multiMask.getElements();
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<R extends T>
voidadd(Collection<R> elements) Adds child elements to this mask.final voidAdds multiple child elements to this mask.Get the child elementsvoidinit()Initialize the element.voidstop()Stop the element.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.github.projectunified.craftux.common.Mask
apply, getActionMap
-
Field Details
-
elements
-
-
Constructor Details
-
MultiMask
public MultiMask()
-
-
Method Details
-
add
Adds child elements to this mask.- Type Parameters:
R- the type of the child elements, must extend T- Parameters:
elements- the child elements to add
-
add
Adds multiple child elements to this mask.- Parameters:
elements- the child elements to add
-
getElements
Get the child elements- Returns:
- the child elements
-
init
public void init()Description copied from interface:ElementInitialize the element. Should be called before adding to the GUI. -
stop
public void stop()Description copied from interface:ElementStop the element. Should be called after removing from the GUI.
-