Class EventDSL

  • All Implemented Interfaces:

    
    public final class EventDSL<S extends Drawable>
    
                        

    DSL for events.

    Since:

    0.23.2

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      EventDSL(S self)
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final <E extends Event> S then(E $self, Function2<S, E, Boolean> handler) specify a handler for this event.
      final <E extends Event> S to(E $self, Function2<S, E, Unit> handler) specify a handler for this event.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EventDSL

        EventDSL(S self)
    • Method Detail

      • then

         final <E extends Event> S then(E $self, Function2<S, E, Boolean> handler)

        specify a handler for this event.

        in the given handler, you can perform things on this component, such as recoloring and rotating

        Return true to consume the event. True by default.

        Since:

        0.19.2

      • to

         final <E extends Event> S to(E $self, Function2<S, E, Unit> handler)

        specify a handler for this event.

        in the given handler, you can perform things on this component, such as recoloring and rotating.

        Return true to consume the event. True by default.

        Since:

        0.19.2