Examples of TimingTarget


Examples of org.jdesktop.core.animation.timing.TimingTarget

      if (backgroundAnimator != null) {
        backgroundAnimator.cancel();
        backgroundAnimator = null;
      }

      TimingTarget timingTarget = new TimingTargetAdapter() {
        private final RGB from = getBackground();
        private final RGB to = value.getBackground();
       
        @Override
        public void timingEvent(Animator source, double fraction) {
View Full Code Here

Examples of org.jdesktop.core.animation.timing.TimingTarget

      if (offsetAnimator != null) {
        offsetAnimator.cancel();
        offsetAnimator = null;
      }
     
      TimingTarget timingTarget = new TimingTargetAdapter() {
        private final int from = offset;
        private final int to = value;
       
        @Override
        public void timingEvent(Animator source, double fraction) {
View Full Code Here

Examples of org.jdesktop.core.animation.timing.TimingTarget

     
      if (from.equals(to)) {
        return;
      }
     
      TimingTarget timingTarget = new TimingTargetAdapter() {

        @Override
        public void timingEvent(Animator source, double fraction) {
          double dLeft = from.getLeft() + ((to.getLeft() - from.getLeft()) * fraction);
          double dRight = from.getRight() + ((to.getRight() - from.getRight()) * fraction);
 
View Full Code Here

Examples of org.jdesktop.core.animation.timing.TimingTarget

    Rectangle bounds = controller.getItemBounds();
    bounds.x += controller.getOffset();
    final int from = bounds.x;
   
    TimingTarget tt = new TimingTargetAdapter() {
      @Override
      public void timingEvent(Animator source, double fraction) {
        int distance = (int )Math.round(((double )to - (double )from) * fraction);
       
        Rectangle bounds = controller.getItemBounds();
View Full Code Here

Examples of org.jdesktop.core.animation.timing.TimingTarget

     
      if (from.equals(to)) {
        return;
      }
     
      TimingTarget timingTarget = new TimingTargetAdapter() {

        @Override
        public void timingEvent(Animator source, double fraction) {
          double dRed = from.red + ((to.red - from.red) * fraction);
          double dGreen = from.green + ((to.green - from.green) * fraction);
 
View Full Code Here

Examples of org.jdesktop.core.animation.timing.TimingTarget

      controller.setBackgroundAnimator(null);
    }
   
    final RGB from = controller.getBackground();
   
    TimingTarget tt = new TimingTargetAdapter() {
      @Override
      public void timingEvent(Animator source, double fraction) {
        double r = to.red - from.red;
        double g = to.green - from.green;
        double b = to.blue - from.blue;
View Full Code Here

Examples of org.jdesktop.core.animation.timing.TimingTarget

     
      if (from.equals(to)) {
        return;
      }
     
      TimingTarget timingTarget = new TimingTargetAdapter() {

        @Override
        public void timingEvent(Animator source, double fraction) {
          double dRed = from.red + ((to.red - from.red) * fraction);
          double dGreen = from.green + ((to.green - from.green) * fraction);
 
View Full Code Here

Examples of org.jdesktop.core.animation.timing.TimingTarget

    /*
     * This PropertySetter enables the animation for the car movement all the
     * way around the track.
     */
    final TimingTarget modifier = PropertySetter.getTarget(basicGUI.getTrack(), "carPosition", keyFrames);
    animator.addTarget(modifier);

    /*
     * Now create similar keyframes for rotation of car.
     */
    int[] rotationKeyValues = { 360, 315, 270, 225, 180, 135, 90, 45, 0 };
    Interpolator straightawayTurnSpline = new SplineInterpolator(1.0f, 0.0f, 1.0f, 0.0f);
    Interpolator curveTurnSpline = new SplineInterpolator(0.0f, 0.5f, 0.5f, 1.0f);
    Interpolator[] rotationInterps = { null, straightawayTurnSpline, curveTurnSpline, straightawayTurnSpline, curveTurnSpline,
        straightawayTurnSpline, curveTurnSpline, straightawayTurnSpline, curveTurnSpline };
    final KeyFrames.Builder<Integer> rotationBuilder = new KeyFrames.Builder<Integer>(rotationKeyValues[0]);
    for (int i = 1; i < values.length; i++) {
      rotationBuilder.addFrame(rotationKeyValues[i], times[i], rotationInterps[i]);
    }
    KeyFrames<Integer> rotationKeyFrames = rotationBuilder.build();
    final TimingTarget rotationModifier = PropertySetter.getTarget(basicGUI.getTrack(), "carRotation", rotationKeyFrames);
    animator.addTarget(rotationModifier);

    /*
     * Finally, add sound effects, triggered by the same animator.
     */
 
View Full Code Here

Examples of org.jdesktop.core.animation.timing.TimingTarget

          }
        }
      }
    });

    final TimingTarget target = new TimingTargetAdapter() {

      Color c;

      @Override
      public void timingEvent(Animator source, double fraction) {
View Full Code Here

Examples of org.jdesktop.core.animation.timing.TimingTarget

    builder.addFrame(ball.y + (2 * radiusY), SPLINE_0_1_1_0);
    builder.addFrame(ball.y + radiusY, SPLINE_1_0_1_1);
    builder.addFrame(ball.y, SPLINE_0_1_1_0);
    final KeyFrames<Integer> framesY = builder.build();

    final TimingTarget circularMovement = new TimingTargetAdapter() {
      @Override
      public void timingEvent(Animator source, double fraction) {
        ball.x = framesX.getInterpolatedValueAt(fraction);
        ball.y = framesY.getInterpolatedValueAt(fraction);
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.