private void runProcessingAnimation(double duration) {
    timeline.setAutoReverse(true);
    timeline.setCycleCount(2);

    //        transitionRect = new TranslateTransition(Duration.millis(duration), rectangle);
    //        transitionCircle = new TranslateTransition(Duration.millis(duration), circle);
    transitionCircle.setDuration(Duration.millis(duration));
    transitionCircle.setNode(circle);
    transitionCircle.setAutoReverse(false);
    transitionCircle.setByX(150);
    transitionCircle.setFromX(0);

    transitionRect.setAutoReverse(false);
    transitionRect.setDuration(Duration.millis(duration));
    transitionRect.setNode(rectangle);
    transitionRect.setByX(150);
    transitionRect.setFromX(0);

    KeyValue keyValue = new KeyValue(imageViewTop.translateYProperty(), 90);
    KeyFrame keyFrame =
        new KeyFrame(
            Duration.millis(duration),
            (ActionEvent) -> {
              toggleHide(rectangle);
              transitionRect.play();
              transitionCircle.play();
              stackProducts(rectangle, imageViewRightStorage, this);
            },
            keyValue);

    timeline.getKeyFrames().clear();
    timeline.getKeyFrames().add(keyFrame);
    timeline.play();
  }
  @Ignore // TODO: Activate once this was fixed
  @Test
  public void test() {
    t.play();
    delay(200);

    if (!newVal.equals(target.getValue())) {
      throw new AssertionError("key value changed");
    }
  }
Exemple #3
0
  /*
   * Q - Up, E - Down, A - Left, D - Right, W - Forward, S - Backward
   */
  public void keyPressed() {
    if (key == 'q' || key == 'Q') {
      globalCameraY--;
    }
    if (key == 'e' || key == 'E') {
      globalCameraY++;
    }
    if (key == 'w' || key == 'W') {
      globalCameraZ--;
    }
    if (key == 'a' || key == 'A') {
      globalCameraX++;
    }
    if (key == 's' || key == 'S') {
      globalCameraZ++;
    }
    if (key == 'd' || key == 'D') {
      globalCameraX--;
    }
    if (key == ' ') {
      if (selectedRule == 0) selectedRule = 1;
      else selectedRule = 0;
    }
    if (key == 't' || key == 'T') {
      // if a camera is active, add tick
      for (int i = 0; i < cameras.size(); i++) {
        if (cameras.get(i).camIsSelected()) {

          // need to find which tick is before/after the one that would be placed here
          // TODO above
          timeline.addTick(cameras.get(i));
        }
      }
    }
    if (key == 'l' || key == 'L') {
      timeline.play();
    }
    if (key == 'p' || key == 'P') {
      timeline.pause();
    }
  }
 public void resume() {
   timeline.play();
 }