Class ComponentAnimation.UIMutation

java.lang.Object
com.codename1.ui.animations.ComponentAnimation
com.codename1.ui.animations.ComponentAnimation.UIMutation
Enclosing class:
ComponentAnimation

public static class ComponentAnimation.UIMutation extends ComponentAnimation

A special kind of ComponentAnimation that encapsulates a mutation of the user interface. This class used internally to allow compatible UI mutation animations to run concurrently. Two UI mutations are compatible if the containers that they mutate reside in separate branches of the UI tree. I.e. As long as neither container contains the other, their mutations are compatible.

Since

7.0

See also
  • AnimationManager#addUIMutation(com.codename1.ui.Container, com.codename1.ui.animations.ComponentAnimation)

  • AnimationManager#addUIMutation(com.codename1.ui.Container, com.codename1.ui.animations.ComponentAnimation, java.lang.Runnable)

  • Constructor Details

    • UIMutation

      public UIMutation(Container cnt, ComponentAnimation anim)

      Creates a new UIMutation which mutates the given container with the provided animation.

      Parameters
      • cnt: The container that is being mutated.

      • anim: The animation.

  • Method Details

    • add

      public boolean add(Container cnt, ComponentAnimation anim)

      Tries to add another mutation to this UIMutation.

      Parameters
      • cnt: The container that is being mutated.

      • anim: The animation

      Returns
      Returns:
      True if it was successfully added. False otherwise. This will return false if #isLocked() returns true (i.e. the animation has already stared), or if the mutation is incompatible with any of the existing mutations in this mutation.
    • isLocked

      public boolean isLocked()
      Checks if this mutation is locked. Once a mutation animation has started, it becomes locked, and cannot have any further mutations added to it.
    • updateState

      protected void updateState()
      Description copied from class: ComponentAnimation
      Updates the animation state
    • isInProgress

      public boolean isInProgress()
      Description copied from class: ComponentAnimation

      Indicates if the animation is in progress

      Returns

      true if in progress

      Specified by:
      isInProgress in class ComponentAnimation
    • flush

      public void flush()
      Description copied from class: ComponentAnimation
      Flushes the animation immediately, this will be called if the form is de-initialized
      Overrides:
      flush in class ComponentAnimation
    • getMaxSteps

      public int getMaxSteps()
      Description copied from class: ComponentAnimation

      The total number of steps in this animation.

      Returns

      the number of steps

      Overrides:
      getMaxSteps in class ComponentAnimation
    • setStep

      public void setStep(int step)
      Description copied from class: ComponentAnimation

      Sets the current animation step to a value between 0 and maxSteps

      Parameters
      • step: the current step
      Overrides:
      setStep in class ComponentAnimation