Package javafx.animation

Examples of javafx.animation.Timeline


        super(radialBargraph);
        angleStep         = radialBargraph.getAngleRange() / (radialBargraph.getMaxValue() - radialBargraph.getMinValue());
        angle             = new SimpleDoubleProperty(this, "angle", getSkinnable().getValue() * angleStep);
        lastCall          = Instant.now();
        withinSpeedLimit  = true;
        timeline          = new Timeline();
        mouseEventHandler = mouseEvent -> handleMouseEvent(mouseEvent);
        touchEventHandler = touchEvent -> handleTouchEvent(touchEvent);
        markersToRemove   = new ArrayList<>();

        init();
View Full Code Here


    public SimpleGaugeSkin(SimpleGauge gauge) {
        super(gauge);       
        angleStep        = gauge.getAngleRange() / (gauge.getMaxValue() - gauge.getMinValue());
        lastCall         = Instant.now();
        withinSpeedLimit = true;
        timeline         = new Timeline();
       
        init();
        initGraphics();
        registerListeners();
        isFirstTime = true;
View Full Code Here

     * @param tile to be animated
     * @param newLocation new location of the tile
     * @return a timeline
     */
    private Timeline animateExistingTile(Tile tile, Location newLocation) {
        Timeline timeline = new Timeline();
        KeyValue kvX = new KeyValue(tile.layoutXProperty(),
                newLocation.getLayoutX(Board.CELL_SIZE) - (tile.getMinHeight() / 2), Interpolator.EASE_OUT);
        KeyValue kvY = new KeyValue(tile.layoutYProperty(),
                newLocation.getLayoutY(Board.CELL_SIZE) - (tile.getMinHeight() / 2), Interpolator.EASE_OUT);

        KeyFrame kfX = new KeyFrame(ANIMATION_EXISTING_TILE, kvX);
        KeyFrame kfY = new KeyFrame(ANIMATION_EXISTING_TILE, kvY);

        timeline.getKeyFrames().add(kfX);
        timeline.getKeyFrames().add(kfY);

        return timeline;
    }
View Full Code Here

        HBox hTime=new HBox();
        hTime.setMinSize(gridWidth, GAP_HEIGHT);
        hTime.setAlignment(Pos.BOTTOM_RIGHT);
        lblTime.getStyleClass().addAll("game-label","game-time");
        lblTime.textProperty().bind(clock);
        timer=new Timeline(new KeyFrame(Duration.ZERO, e->{
            clock.set(LocalTime.now().minusNanos(time.toNanoOfDay()).format(fmt));
        }),new KeyFrame(Duration.seconds(1)));
        timer.setCycleCount(Animation.INDEFINITE);
        hTime.getChildren().add(lblTime);
       
View Full Code Here

            if(e.getCode().equals(KeyCode.ENTER) || e.getCode().equals(KeyCode.SPACE)){
                quit();
            }
        });
     
        timerPause=new Timeline(new KeyFrame(Duration.seconds(1),
                e->time=time.plusNanos(1_000_000_000)));
        timerPause.setCycleCount(Animation.INDEFINITE);
       
        gameOverProperty.addListener((observable, oldValue, newValue) -> {
            if (newValue) {
View Full Code Here

    public void animateScore() {
        if(gameMovePoints.get()==0){
            return;
        }
       
        final Timeline timeline = new Timeline();
        lblPoints.setText("+" + gameMovePoints.getValue().toString());
        lblPoints.setOpacity(1);
        double posX=vScore.localToScene(vScore.getWidth()/2d,0).getX();
        lblPoints.setTranslateX(0);
        lblPoints.setTranslateX(lblPoints.sceneToLocal(posX, 0).getX()-lblPoints.getWidth()/2d);
        lblPoints.setLayoutY(20);
        final KeyValue kvO = new KeyValue(lblPoints.opacityProperty(), 0);
        final KeyValue kvY = new KeyValue(lblPoints.layoutYProperty(), 100);

        Duration animationDuration = Duration.millis(600);
        final KeyFrame kfO = new KeyFrame(animationDuration, kvO);
        final KeyFrame kfY = new KeyFrame(animationDuration, kvY);

        timeline.getKeyFrames().add(kfO);
        timeline.getKeyFrames().add(kfY);

        timeline.play();
    }
View Full Code Here

    }

    public BooleanPulse(Duration duration, boolean initialValue) {
        currentValue = initialValue;

        timeline = new Timeline();
        timeline.setCycleCount(Timeline.INDEFINITE);
        timeline.getKeyFrames().add(new KeyFrame(duration, event -> toggle()));
    }
View Full Code Here

                    maxXatY.put((int) y, xRight);
                }
            }
            localMax = Math.max(yPos2, localMax);

            Timeline tm = new Timeline(new KeyFrame(Duration.seconds(1.0),
                    new KeyValue(tlNode.layoutXProperty(), xPos),
                    new KeyValue(tlNode.layoutYProperty(), yPos)));

            tm.play();
//            tlNode.relocate(xPos, yPos);
        }
        maxY.set(Math.max(maxY.get(), localMax));
        return localMax - minY;
    }
View Full Code Here

  public void init() {
    spaceObjects = new ArrayList<SpaceObject>();
  }

  public void run() {
    Timeline tickTimer = new Timeline(new KeyFrame(Duration.millis(50), new EventHandler<ActionEvent>() {
      private int tickCount = 0;
      @Override
      public void handle(ActionEvent event) {
        tick(tickCount++);
      }
    }));
    tickTimer.setCycleCount(Timeline.INDEFINITE);
    tickTimer.play();
    requestFocus();
    setOnKeyPressed(this);
    setOnKeyTyped(this);
  }
View Full Code Here

            case CLAIMED:
                actionButton.setText("View claim transaction");
                ColorAdjust effect = new ColorAdjust();
                coverImage.setEffect(effect);
                if (priorMode != Mode.CLAIMED) {
                    Timeline timeline = new Timeline(new KeyFrame(GuiUtils.UI_ANIMATION_TIME.multiply(3), new KeyValue(effect.saturationProperty(), -0.9)));
                    timeline.play();
                } else {
                    effect.setSaturation(-0.9);
                }
                break;
        }
View Full Code Here

TOP

Related Classes of javafx.animation.Timeline

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.