Creates a simple animation backend that cycles through a list of colors.

@return the backend to use
5001
public static AnimationBackend createSampleColorAnimationBackend(Resources resources) {
    // Get the animation duration in ms for each color frame
    int frameDurationMs = resources.getInteger(android.R.integer.config_mediumAnimTime);
    // Create and return the backend
    return new ExampleColorBackend(SampleData.COLORS, frameDurationMs);
  }
213824
function () {
		var series = this,
			options = this.options,
			props = [['graph', options.lineColor || this.color]],
			lineWidth = options.lineWidth,
			dashStyle =  options.dashStyle,
			graphPath = this.getGraphPath(),
			negativeColor = options.negativeColor;
			
		if (negativeColor) {
			props.push(['graphNeg', negativeColor]);
		}
		
		// draw the graph
		each(props, function (prop, i) {
			var graphKey = prop[0],
				graph = series[graphKey],
				attribs;
			
			if (graph) {
				stop(graph); // cancel running animations, #459
				graph.animate({ d: graphPath });
	
			} else if (lineWidth && graphPath.length) { // #1487
				attribs = {
					stroke: prop[1],
					'stroke-width': lineWidth,
					zIndex: 1 // #1069
				};
				if (dashStyle) {
					attribs.dashstyle = dashStyle;
				} else {
					attribs['stroke-linecap'] = attribs['stroke-linejoin'] = 'round';
				}

				series[graphKey] = series.chart.renderer.path(graphPath)
					.attr(attribs)
					.add(series.group)
					.shadow(!i && options.shadow);
			}
		});
	}
1056591
public Paint getScrollBarButtonBackgroundPaint(Shape s, boolean isIncrease, boolean buttonsTogether) {
        TwoColors colors = getScrollBarButtonBackgroundColors(buttonsTogether, isIncrease);

        return createHorizontalGradient(s, colors);
    }
968968
private void adaptHeaderBackground(@Nullable final BackgroundAnimation animation) {
        if (headerBackgroundImageView != null) {
            Drawable newBackground = headerBackground;

            if (animation != null && newBackground != null) {
                Drawable previousBackground = headerBackgroundImageView.getDrawable();

                if (previousBackground != null) {
                    if (previousBackground instanceof AbstractTransitionDrawable) {
                        previousBackground =
                                ((AbstractTransitionDrawable) previousBackground).getDrawable(1);
                    }

                    if (animation instanceof CircleTransitionAnimation) {
                        CircleTransitionAnimation circleTransitionAnimation =
                                (CircleTransitionAnimation) animation;
                        CircleTransitionDrawable transition = new CircleTransitionDrawable(
                                new Drawable[]{previousBackground, newBackground});
                        transition.setRadius(circleTransitionAnimation.getRadius());
                        transition.setListener(circleTransitionAnimation.getListener());

                        if (circleTransitionAnimation.getX() != null) {
                            transition.setX(circleTransitionAnimation.getX());
                        }

                        if (circleTransitionAnimation.getY() != null) {
                            transition.setY(circleTransitionAnimation.getY());
                        }

                        transition.startTransition(circleTransitionAnimation.getDuration());
                        newBackground = transition;
                    } else if (animation instanceof CrossFadeTransitionAnimation) {
                        CrossFadeTransitionDrawable transition = new CrossFadeTransitionDrawable(
                                new Drawable[]{previousBackground, newBackground});
                        transition.setListener(animation.getListener());
                        transition.startTransition(animation.getDuration());
                        newBackground = transition;
                    } else {
                        throw new RuntimeException("Unknown type of animation: " +
                                animation.getClass().getSimpleName());
                    }
                }
            }

            headerBackgroundImageView.setImageDrawable(newBackground);
        }
    }
972872
public static <K, T, V> MultiDimensionalMap<K, T, V> newThreadSafeTreeBackedMap() {
        return new MultiDimensionalMap<>(new ConcurrentSkipListMap<Pair<K, T>, V>());
    }
737929
public java.awt.Image createAwtImage(Color foreground, Color background) {
        int f = foreground.getRGB();
        int g = background.getRGB();
        Canvas canvas = new Canvas();

        String bCode = code;
        if (extended)
            bCode = getCode39Ex(code);
        if (generateChecksum)
            bCode += getChecksum(bCode);
        int len = bCode.length() + 2;
        int nn = (int)n;
        int fullWidth = len * (6 + 3 * nn) + (len - 1);
        byte bars[] = getBarsCode39(bCode);
        boolean print = true;
        int ptr = 0;
        int height = (int)barHeight;
        int pix[] = new int[fullWidth * height];
        for (int k = 0; k < bars.length; ++k) {
            int w = (bars[k] == 0 ? 1 : nn);
            int c = g;
            if (print)
                c = f;
            print = !print;
            for (int j = 0; j < w; ++j)
                pix[ptr++] = c;
        }
        for (int k = fullWidth; k < pix.length; k += fullWidth) {
            System.arraycopy(pix, 0, pix, k, fullWidth); 
        }
        Image img = canvas.createImage(new MemoryImageSource(fullWidth, height, pix, 0, fullWidth));
        
        return img;
    }
1336409
function() {
        var backBuffer;
        if(this.useIFrame === false) {
            backBuffer = OpenLayers.Tile.Image.prototype.createBackBuffer.call(this);
        }
        return backBuffer;
    }
686539
public function build(): GetBackgroundColorsRequest
	{
		$instance = new GetBackgroundColorsRequest();
		if ($this->nodeId === null) {
			throw new BuilderException('Property [nodeId] is required.');
		}
		$instance->nodeId = $this->nodeId;
		return $instance;
	}
185973
public GrayF32 render()
	{
		ImageMiscOps.fill(output,background);
		ImageMiscOps.fill(depthMap,Float.MAX_VALUE);

		for (int i = 0; i < scene.size(); i++) {
			SurfaceRect r = scene.get(i);
			r.rectInCamera();
		}

		if( BoofConcurrency.USE_CONCURRENT ) {
			renderMultiThread();
		} else {
			renderSingleThread();
		}

		return getOutput();
	}
525820
private AnimationFactory.Factory getAnimationFactory(
            final JSONObject animationSpec) throws JSONException,
            NoSuchMethodException {
        if (animationSpec.has("duration")) {
            Log.d(TAG, "getAnimationFactory(): making factory for spec: %s", animationSpec);
            return AnimationFactory.makeFactory(animationSpec);
        } else if (animationSpec.has("id")) {
            final String id = animationSpec.getString("id");
            Log.d(TAG, "getAnimationFactory(): getting factory for '%s'", id);
            return AnimationFactory.getFactory(id);
        } else {
            throw Exceptions.RuntimeAssertion("Invalid animation spec: %s",
                                              animationSpec);
        }
    }
363319
public java.awt.Image createAwtImage(Color foreground, Color background) {
        int f = foreground.getRGB();
        int g = background.getRGB();
        Canvas canvas = new Canvas();

        String fullCode = code;
        if (generateChecksum && checksumText)
            fullCode = calculateChecksum(code);
        if (!startStopText)
            fullCode = fullCode.substring(1, fullCode.length() - 1);
        byte bars[] = getBarsCodabar(generateChecksum ? calculateChecksum(code) : code);
        int wide = 0;
        for (int k = 0; k < bars.length; ++k) {
            wide += bars[k];
        }
        int narrow = bars.length - wide;
        int fullWidth = narrow + wide * (int)n;
        boolean print = true;
        int ptr = 0;
        int height = (int)barHeight;
        int pix[] = new int[fullWidth * height];
        for (int k = 0; k < bars.length; ++k) {
            int w = (bars[k] == 0 ? 1 : (int)n);
            int c = g;
            if (print)
                c = f;
            print = !print;
            for (int j = 0; j < w; ++j)
                pix[ptr++] = c;
        }
        for (int k = fullWidth; k < pix.length; k += fullWidth) {
            System.arraycopy(pix, 0, pix, k, fullWidth); 
        }
        Image img = canvas.createImage(new MemoryImageSource(fullWidth, height, pix, 0, fullWidth));
        
        return img;
    }
228484
private Animator prepareStyle3Animation() {
        AnimatorSet animation = new AnimatorSet();

        ObjectAnimator progressAnimation = ObjectAnimator.ofFloat(drawable, CircularProgressDrawable.PROGRESS_PROPERTY, 0.75f, 0f);
        progressAnimation.setDuration(1200);
        progressAnimation.setInterpolator(new AnticipateInterpolator());

        Animator innerCircleAnimation = ObjectAnimator.ofFloat(drawable, CircularProgressDrawable.CIRCLE_SCALE_PROPERTY, 0.75f, 0f);
        innerCircleAnimation.setDuration(1200);
        innerCircleAnimation.setInterpolator(new AnticipateInterpolator());

        ObjectAnimator invertedProgress = ObjectAnimator.ofFloat(drawable, CircularProgressDrawable.PROGRESS_PROPERTY, 0f, 0.75f);
        invertedProgress.setDuration(1200);
        invertedProgress.setStartDelay(3200);
        invertedProgress.setInterpolator(new OvershootInterpolator());

        Animator invertedCircle = ObjectAnimator.ofFloat(drawable, CircularProgressDrawable.CIRCLE_SCALE_PROPERTY, 0f, 0.75f);
        invertedCircle.setDuration(1200);
        invertedCircle.setStartDelay(3200);
        invertedCircle.setInterpolator(new OvershootInterpolator());

        animation.playTogether(progressAnimation, innerCircleAnimation, invertedProgress, invertedCircle);
        return animation;
    }
1105103
private FragmentInstance createNewInstance() {
    try {
      return (FragmentInstance) getBackingClass().newInstance();
    } catch (InstantiationException e) {
      throw new RuntimeException(e);
    } catch (IllegalAccessException e) {
      throw new RuntimeException(e);
    }
  }
885672
function Animation() {
  // create a geometry that will be used by BAS.ModelBufferGeometry
  var modelRadius = 10;
  var modelTube = 4;
  var model = new THREE.TorusGeometry(modelRadius, modelTube, 256, 256);

  // duplicate some vertices so that each face becomes a separate triangle.
  // this is the same as the THREE.ExplodeModifier
  BAS.Utils.separateFaces(model);

  // create a ModelBufferGeometry based on the geometry created above
  // ModelBufferGeometry makes it easier to create animations based on faces of a geometry
  // it is similar to the PrefabBufferGeometry where the prefab is a face (triangle)
  var geometry = new BAS.ModelBufferGeometry(model, {
    // setting this to true will store the vertex positions relative to the face they are in
    // this way it's easier to rotate and scale faces around their own center
    localizeFaces: true,
    // setting this to true will store a centroid for each face in an array
    computeCentroids: true
  });

  // ANIMATION

  // create a BufferAttribute with an item size of 2, so each face has an animation duration and a delay
  var aDelayDuration = geometry.createAttribute('aDelayDuration', 2);
  var minDuration = 1.0;
  var maxDuration = 1.0;
  var centroidDelayFactor = 0.1;

  // animation delay is calculated based on position
  // the max position is equal to the radius + tube of the torus
  this.totalDuration = maxDuration + centroidDelayFactor * (modelRadius + modelTube);

  // calculate a delay and duration FOR EACH FACE
  for (var i = 0, offset = 0; i < geometry.faceCount; i++) {
    var duration = THREE.Math.randFloat(minDuration, maxDuration);
    var centroidLength = geometry.centroids[i].length();
    var delay = centroidLength * centroidDelayFactor;

    // store the delay and duration FOR EACH VERTEX of the face
    // the loop is repeated 3 times because each face has 3 vertices
    for (var j = 0; j < 3; j++) {
      aDelayDuration.array[offset]     = delay;
      aDelayDuration.array[offset + 1] = duration;

      offset += 2;
    }
  }

  // POSITION

  // simply copy the centroid of the face as the position
  // adding the position in the vertex shader will 'reset' the face to its original position in the geometry
  // the function passed as the 3rd argument will be executed for each face
  var aPosition = geometry.createAttribute('aPosition', 3, function(data, i) {
    geometry.centroids[i].toArray(data);
  });

  // ROTATION

  var axis = new THREE.Vector3();

  // give each face a rotation axis and an angle to rotate around that axis
  var aAxisAngle = geometry.createAttribute('aAxisAngle', 4, function(data, i) {
    // base the axis on the position within the geometry
    // this creates a smooth curve/wave effect
    axis.copy(geometry.centroids[i]).normalize();
    axis.toArray(data);
    // two full rotations around the axis
    data[3] = Math.PI * 4;
  });

  var material = new BAS.StandardAnimationMaterial({
    flatShading: true,
    side: THREE.DoubleSide,
    uniforms: {
      uTime: {value: 0},
      // this color will be used for back-facing fragments in fragmentDiffuse
      uBackColor: {value: new THREE.Color().setHSL(0, 1.0, 0.5)}
    },
    uniformValues: {
      diffuse: new THREE.Color(0x000000)
    },
    vertexFunctions: [
      BAS.ShaderChunk['ease_cubic_in_out'],
      BAS.ShaderChunk['quaternion_rotation']
    ],
    vertexParameters: [
      'uniform float uTime;',
      'attribute vec2 aDelayDuration;',
      'attribute vec3 aPosition;',
      'attribute vec4 aAxisAngle;'
    ],
    vertexInit: [
      'float tProgress = clamp(uTime - aDelayDuration.x, 0.0, aDelayDuration.y) / aDelayDuration.y;',
      'tProgress = easeCubicInOut(tProgress);'
    ],
    vertexPosition: [
      'vec4 tQuat = quatFromAxisAngle(aAxisAngle.xyz, aAxisAngle.w * tProgress);',

      // rotate the vertex around (0, 0, 0)
      'transformed = rotateVector(tQuat, transformed);',
      // restore the position
      'transformed += aPosition;'
    ],
    fragmentParameters: [
      'uniform vec3 uBackColor;'
    ],
    fragmentDiffuse: [
      // gl_FrontFacing is a built-in glsl variable that indicates if the current fragment is front-facing
      // if its not front facing, set diffuse color to uBackColor
      'if (!gl_FrontFacing) {',
      ' diffuseColor.rgb = uBackColor.xyz;',
      '}'
    ]
  });

  THREE.Mesh.call(this, geometry, material);

  this.frustumCulled = false;
}
390176
public java.lang.String getBgcolor() {
        return (java.lang.String) getStateHelper().eval(PropertyKeys.bgcolor);

    }
647031
protected ShadowMap createShadowMap() {
        synchronized (RoboSputnik.class) {
            if (mainShadowMap != null) return mainShadowMap;
            mainShadowMap = new ShadowMap.Builder().build();
            return mainShadowMap;
        }
    }
536356
private Animator prepareStyle1Animation() {
        AnimatorSet animation = new AnimatorSet();

        final Animator indeterminateAnimation = ObjectAnimator.ofFloat(drawable, CircularProgressDrawable.PROGRESS_PROPERTY, 0, 3600);
        indeterminateAnimation.setDuration(3600);

        Animator innerCircleAnimation = ObjectAnimator.ofFloat(drawable, CircularProgressDrawable.CIRCLE_SCALE_PROPERTY, 0f, 0.75f);
        innerCircleAnimation.setDuration(3600);
        innerCircleAnimation.addListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationStart(Animator animation) {
                drawable.setIndeterminate(true);
            }

            @Override
            public void onAnimationEnd(Animator animation) {
                indeterminateAnimation.end();
                drawable.setIndeterminate(false);
                drawable.setProgress(0);
            }
        });

        animation.playTogether(innerCircleAnimation, indeterminateAnimation);
        return animation;
    }