# 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)

- ## Nested Class Summary

  ### Nested classes/interfaces inherited from class ComponentAnimation

  `ComponentAnimation.UIMutation`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `UIMutation(Container cnt, ComponentAnimation anim)`
  Creates a new UIMutation which mutates the given container with the provided animation.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `add(Container cnt, ComponentAnimation anim)`
  Tries to add another mutation to this UIMutation.
  `void`
  `flush()`
  Flushes the animation immediately, this will be called if the form is de-initialized
  `int`
  `getMaxSteps()`
  The total number of steps in this animation.
  `boolean`
  `isInProgress()`
  Indicates if the animation is in progress
  `boolean`
  `isLocked()`
  Checks if this mutation is locked.
  `void`
  `setStep(int step)`
  Sets the current animation step to a value between 0 and maxSteps
  `protected void`
  `updateState()`
  Updates the animation state

  ### Methods inherited from class ComponentAnimation

  `addOnCompleteCall, compoundAnimation, getStep, isStepModeSupported, sequentialAnimation, setNotifyLock, setOnCompletion, updateAnimationState`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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`