Package org.gbcpainter.game.view.animations

Examples of org.gbcpainter.game.view.animations.JunctionColoringAnimation


  @Override
  protected synchronized String getResourceName() {
    boolean animationsTerminated = true;

    if ( ! this.coloringAnimations.isEmpty() ) {
      JunctionColoringAnimation bestAnimation = coloringAnimations.iterator().next();
      double higherNonFullPercentage = bestAnimation.getPercentageDoneAnimation();
      for (JunctionColoringAnimation coloringAnimation : this.coloringAnimations) {
        final double animationPercentage = coloringAnimation.getPercentageDoneAnimation();
        if ( animationPercentage > higherNonFullPercentage && ( animationPercentage != 1.0 || higherNonFullPercentage == 0.0 ) ) {
          higherNonFullPercentage = animationPercentage;
          bestAnimation = coloringAnimation;
        }

        if ( ! coloringAnimation.isTerminated() ) {
          animationsTerminated = false;
        }
      }

      if ( animationsTerminated ) {
        this.coloringAnimations.clear();
      } else if ( higherNonFullPercentage >= HALF_ANIMATION_THRESHOLD && previousColor != bestAnimation.isColoring() ) {
        @NotNull
        @NonNls
        final String suffixString;
        final PERPENDICULAR_DIRECTION animationDirection = bestAnimation.getDirection();
        Set<PERPENDICULAR_DIRECTION> directions = getAvailableDirections();


        if ( bestAnimation.isColoring() ) {
          suffixString = getHalfResourceNameByDirections( directions, animationDirection.getOpposite() );
        } else {
          Deque<PERPENDICULAR_DIRECTION> junctionDirections = new LinkedList<>( directions );

          if ( junctionDirections.size() == 2 ) {
View Full Code Here

TOP

Related Classes of org.gbcpainter.game.view.animations.JunctionColoringAnimation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.