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 Type
    Method
    Description
    static void
    handleIfElement(Object o, Consumer<Element> elementConsumer)
    Handle the object if it is an instance of Element
    static <T> void
    handleIfElement(Collection<T> collection, Consumer<Element> elementConsumer)
    Loop through the collection and handle the element if it is an instance of Element
    default void
    Initialize the element.
    default void
    Stop the element.
  • Method Details

    • handleIfElement

      static void handleIfElement(Object o, Consumer<Element> elementConsumer)
      Handle the object if it is an instance of Element
      Parameters:
      o - the object
      elementConsumer - the consumer
    • handleIfElement

      static <T> void handleIfElement(Collection<T> collection, Consumer<Element> elementConsumer)
      Loop through the collection and handle the element if it is an instance of Element
      Parameters:
      collection - the collection
      elementConsumer - 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.