Class ComponentOp.Animatable

  • All Implemented Interfaces:
    org.polyfrost.polyui.operations.ComponentOp

    
    public abstract class ComponentOp.Animatable<S extends Component>
     implements ComponentOp
                        

    Class to represent an operation that can be applied on a component that modifies it in some way.

    It is applied before and after rendering, for example a Move, Resize, or Rotate operation, or a transition.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Function1<S, Unit> onFinish
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Function1<S, Unit> getOnFinish()
      final Unit setOnFinish(Function1<S, Unit> onFinish)
      Unit apply() Apply the operation, this is called before the component is rendered.
      Boolean unapply() Unapply the operation.
      final Unit add()
      Unit finishNow() finish this operation immediately.
      Unit reset()
      Unit reverse()
      • Methods inherited from class org.polyfrost.polyui.operations.ComponentOp

        exclusive, verify
      • Methods inherited from class java.lang.Object

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

      • ComponentOp.Animatable

        ComponentOp.Animatable(S self, Animation animation, Function1<S, Unit> onFinish)
    • Method Detail

      • apply

         Unit apply()

        Apply the operation, this is called before the component is rendered.

      • unapply

         Boolean unapply()

        Unapply the operation. this is called after the component is rendered.

        return true to instantly remove this operation from the component.

      • finishNow

        @ApiStatus.Experimental() Unit finishNow()

        finish this operation immediately.

        This is marked as experimental as it might not always work as expected.

        Since:

        1.0.5