Interface Element
- All Known Implementing Classes:
AnimatedButton,AnimatedMask,ButtonPaginatedMask,HybridMask,InputButton,ListButton,ListMask,MaskPaginatedMask,MultiButton,MultiMask,MultiPositionMask,OutputButton,PaginatedMask,PlaceholderMask,PredicateButton,PredicateMask,SequencePaginatedMask,SimpleButtonMask,SingleMask
public interface Element
Represents an element in the GUI that can be initialized and stopped.
Elements are components that make up the user interface and may require lifecycle management.
Example usage:
public class MyElement implements Element {
@Override
public void init() {
// Initialize resources
}
@Override
public void stop() {
// Clean up resources
}
}
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidhandleIfElement(Object o, Consumer<Element> elementConsumer) Handle the object if it is an instance ofElementstatic <T> voidhandleIfElement(Collection<T> collection, Consumer<Element> elementConsumer) Loop through the collection and handle the element if it is an instance ofElementdefault voidinit()Initialize the element.default voidstop()Stop the element.
-
Method Details
-
handleIfElement
Handle the object if it is an instance ofElement- Parameters:
o- the objectelementConsumer- the consumer
-
handleIfElement
Loop through the collection and handle the element if it is an instance ofElement- Parameters:
collection- the collectionelementConsumer- the consumer
-
init
default void init()Initialize the element. Should be called before adding to the GUI. -
stop
default void stop()Stop the element. Should be called after removing from the GUI.
-