/**
   * Starts the animation thread, creating and initializing it if necessary. This method is invoked
   * when an indeterminate progress bar should start animating. Reasons for this may include:
   *
   * <ul>
   *   <li>The progress bar is determinate and becomes displayable
   *   <li>The progress bar is displayable and becomes determinate
   *   <li>The progress bar is displayable and determinate and this UI is installed
   * </ul>
   *
   * If you implement your own animation thread, you must override this method.
   *
   * @since 1.4
   * @see #stopAnimationTimer
   */
  protected void startAnimationTimer() {
    if (animator == null) {
      animator = new Animator();
    }

    animator.start(getRepaintInterval());
  }
 /**
  * Stops the animation thread. This method is invoked when the indeterminate animation should be
  * stopped. Reasons for this may include:
  *
  * <ul>
  *   <li>The progress bar changes to determinate
  *   <li>The progress bar is no longer part of a displayable hierarchy
  *   <li>This UI in uninstalled
  * </ul>
  *
  * If you implement your own animation thread, you must override this method.
  *
  * @since 1.4
  * @see #startAnimationTimer
  */
 protected void stopAnimationTimer() {
   if (animator != null) {
     animator.stop();
   }
 }