javafx.scene.Node.scaleXProperty()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(14.3k)|赞(0)|评价(0)|浏览(100)

本文整理了Java中javafx.scene.Node.scaleXProperty()方法的一些代码示例,展示了Node.scaleXProperty()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.scaleXProperty()方法的具体详情如下:
包路径:javafx.scene.Node
类名称:Node
方法名:scaleXProperty

Node.scaleXProperty介绍

暂无

代码示例

代码示例来源:origin: jfoenixadmin/JFoenix

private BiFunction<Boolean, Duration, Collection<KeyFrame>> initDefaultAnimation(Node child) {
  return (expanded, duration) -> {
    ArrayList<KeyFrame> frames = new ArrayList<>();
    frames.add(new KeyFrame(duration, event -> {
      child.setScaleX(expanded ? 1 : 0);
      child.setScaleY(expanded ? 1 : 0);
    },
      new KeyValue(child.scaleXProperty(), expanded ? 1 : 0, Interpolator.EASE_BOTH),
      new KeyValue(child.scaleYProperty(), expanded ? 1 : 0, Interpolator.EASE_BOTH)
    ));
    return frames;
  };
}

代码示例来源:origin: jfoenixadmin/JFoenix

public void togglePane() {
  if (toggleAnimation == null) {
    updateToggleAnimation();
  }
  this.getClip().scaleXProperty().unbind();
  this.getClip().scaleYProperty().unbind();
  toggleAnimation.setRate(toggleAnimation.getRate() * -1);
  if (toggleAnimation.getCurrentTime().equals(Duration.millis(0)) && toggleAnimation.getRate() == -1) {
    toggleAnimation.playFrom(Duration.millis(510));
  } else {
    toggleAnimation.play();
  }
}

代码示例来源:origin: jfoenixadmin/JFoenix

public CenterTransition(Node contentContainer, Node overlay) {
    super(contentContainer, new Timeline(
      new KeyFrame(Duration.ZERO,
        new KeyValue(contentContainer.scaleXProperty(), 0, Interpolator.LINEAR),
        new KeyValue(contentContainer.scaleYProperty(), 0, Interpolator.LINEAR),
        new KeyValue(overlay.opacityProperty(), 0, Interpolator.EASE_BOTH)
      ),
      new KeyFrame(Duration.millis(1000),
        new KeyValue(contentContainer.scaleXProperty(), 1, Interpolator.EASE_OUT),
        new KeyValue(contentContainer.scaleYProperty(), 1, Interpolator.EASE_OUT),
        new KeyValue(overlay.opacityProperty(), 1, Interpolator.EASE_BOTH)
      )));
    // reduce the number to increase the shifting , increase number to reduce shifting
    setCycleDuration(Duration.seconds(0.4));
    setDelay(Duration.seconds(0));
  }
}

代码示例来源:origin: jfoenixadmin/JFoenix

CheckBoxTransition(Node mark) {
  super(null, new Timeline(
      new KeyFrame(
        Duration.ZERO,
        new KeyValue(mark.opacityProperty(), 0, Interpolator.EASE_OUT),
        new KeyValue(mark.scaleXProperty(), 0.5, Interpolator.EASE_OUT),
        new KeyValue(mark.scaleYProperty(), 0.5, Interpolator.EASE_OUT)
      ),
      new KeyFrame(Duration.millis(400),
        new KeyValue(mark.opacityProperty(), 1, Interpolator.EASE_OUT),
        new KeyValue(mark.scaleXProperty(), 0.5, Interpolator.EASE_OUT),
        new KeyValue(mark.scaleYProperty(), 0.5, Interpolator.EASE_OUT)
      ),
      new KeyFrame(
        Duration.millis(1000),
        new KeyValue(mark.scaleXProperty(), 1, Interpolator.EASE_OUT),
        new KeyValue(mark.scaleYProperty(), 1, Interpolator.EASE_OUT)
      )
    )
  );
  // reduce the number to increase the shifting , increase number to reduce shifting
  setCycleDuration(Duration.seconds(0.12));
  setDelay(Duration.seconds(0.05));
  this.mark = mark;
}

代码示例来源:origin: jfoenixadmin/JFoenix

new KeyValue(burger.getChildren().get(0).translateYProperty(), 0, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(0).translateXProperty(), 0, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(0).scaleXProperty(), 1, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(2).rotateProperty(), 0, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(2).translateYProperty(), 0, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(2).translateXProperty(), 0, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(2).scaleXProperty(), 1, Interpolator.EASE_BOTH)
new KeyValue(burger.getChildren().get(0).translateYProperty(), transY, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(0).translateXProperty(), -transX, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(0).scaleXProperty(), 0.5, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(2).rotateProperty(), angle, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(2).translateYProperty(), -transY, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(2).translateXProperty(), -transX, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(2).scaleXProperty(), 0.5, Interpolator.EASE_BOTH)

代码示例来源:origin: jfoenixadmin/JFoenix

new KeyValue(burger.getChildren().get(0).translateYProperty(), 0, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(0).translateXProperty(), 0, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(0).scaleXProperty(), 1, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(2).rotateProperty(), 0, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(2).translateYProperty(), 0, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(2).translateXProperty(), 0, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(2).scaleXProperty(), 1, Interpolator.EASE_BOTH)
new KeyValue(burger.getChildren().get(0).translateYProperty(), transY, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(0).translateXProperty(), transX, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(0).scaleXProperty(), 0.5, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(2).rotateProperty(), -angle, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(2).translateYProperty(),
  Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(2).translateXProperty(), transX, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(2).scaleXProperty(), 0.5, Interpolator.EASE_BOTH)

代码示例来源:origin: jfoenixadmin/JFoenix

new KeyFrame(Duration.millis(0), new KeyValue(getClip().scaleXProperty(), 1, Interpolator.EASE_BOTH)),
  new KeyFrame(Duration.millis(0), new KeyValue(getClip().scaleYProperty(), 1, Interpolator.EASE_BOTH)),
  new KeyFrame(Duration.millis(0),
    new KeyValue(getContentNode().opacityProperty(), 0, Interpolator.EASE_BOTH)),
  new KeyFrame(Duration.millis(350),
    new KeyValue(getClip().scaleXProperty(), newRate, Interpolator.EASE_BOTH)),
  new KeyFrame(Duration.millis(350),
    new KeyValue(getClip().scaleYProperty(), newRate, Interpolator.EASE_BOTH)),
toggleAnimation.setOnFinished((finish) -> {
  if (toggleAnimation.getRate() == 1) {
    this.getClip().scaleXProperty().bind(Bindings.createDoubleBinding(() -> {
      double X = this.getWidth() / getClip().getLayoutBounds().getWidth();
      double Y = this.getHeight() / getClip().getLayoutBounds().getHeight();

代码示例来源:origin: jfoenixadmin/JFoenix

List<KeyFrame> frames = new ArrayList<>();
frames.add(new KeyFrame(duration,
  new KeyValue(container.getChildren().get(1).scaleXProperty(), expanded ? 1 : 0, Interpolator.EASE_BOTH),
  new KeyValue(container.getChildren().get(1).scaleYProperty(), expanded ? 1 : 0, Interpolator.EASE_BOTH)
));

代码示例来源:origin: torakiki/pdfsam

new KeyFrame(Duration.millis(0), new KeyValue(node.scaleXProperty(), 1, EASE_BOTH),
    new KeyValue(node.scaleYProperty(), 1, EASE_BOTH),
    new KeyValue(node.rotateProperty(), 0, EASE_BOTH)),
new KeyFrame(Duration.millis(100), new KeyValue(node.scaleXProperty(), 0.9, EASE_BOTH),
    new KeyValue(node.scaleYProperty(), 0.9, EASE_BOTH),
    new KeyValue(node.rotateProperty(), -3, EASE_BOTH)),
new KeyFrame(Duration.millis(200), new KeyValue(node.scaleXProperty(), 0.9, EASE_BOTH),
    new KeyValue(node.scaleYProperty(), 0.9, EASE_BOTH),
    new KeyValue(node.rotateProperty(), -3, EASE_BOTH)),
new KeyFrame(Duration.millis(300), new KeyValue(node.scaleXProperty(), 1.1, EASE_BOTH),
    new KeyValue(node.scaleYProperty(), 1.1, EASE_BOTH),
    new KeyValue(node.rotateProperty(), 3, EASE_BOTH)),
new KeyFrame(Duration.millis(400), new KeyValue(node.scaleXProperty(), 1.1, EASE_BOTH),
    new KeyValue(node.scaleYProperty(), 1.1, EASE_BOTH),
    new KeyValue(node.rotateProperty(), -3, EASE_BOTH)),
new KeyFrame(Duration.millis(500), new KeyValue(node.scaleXProperty(), 1.1, EASE_BOTH),
    new KeyValue(node.scaleYProperty(), 1.1, EASE_BOTH),
    new KeyValue(node.rotateProperty(), 3, EASE_BOTH)),
new KeyFrame(Duration.millis(600), new KeyValue(node.scaleXProperty(), 1.1, EASE_BOTH),
    new KeyValue(node.scaleYProperty(), 1.1, EASE_BOTH),
    new KeyValue(node.rotateProperty(), -3, EASE_BOTH)),
new KeyFrame(Duration.millis(700), new KeyValue(node.scaleXProperty(), 1.1, EASE_BOTH),
    new KeyValue(node.scaleYProperty(), 1.1, EASE_BOTH),
    new KeyValue(node.rotateProperty(), 3, EASE_BOTH)),
new KeyFrame(Duration.millis(800), new KeyValue(node.scaleXProperty(), 1.1, EASE_BOTH),
    new KeyValue(node.scaleYProperty(), 1.1, EASE_BOTH),
    new KeyValue(node.rotateProperty(), -3, EASE_BOTH)),
new KeyFrame(Duration.millis(900), new KeyValue(node.scaleXProperty(), 1.1, EASE_BOTH),
    new KeyValue(node.scaleYProperty(), 1.1, EASE_BOTH),

代码示例来源:origin: com.jfoenix/jfoenix

private BiFunction<Boolean, Duration, Collection<KeyFrame>> initDefaultAnimation(Node child) {
  return (expanded, duration) -> {
    ArrayList<KeyFrame> frames = new ArrayList<>();
    frames.add(new KeyFrame(duration, event -> {
      child.setScaleX(expanded ? 1 : 0);
      child.setScaleY(expanded ? 1 : 0);
    },
      new KeyValue(child.scaleXProperty(), expanded ? 1 : 0, Interpolator.EASE_BOTH),
      new KeyValue(child.scaleYProperty(), expanded ? 1 : 0, Interpolator.EASE_BOTH)
    ));
    return frames;
  };
}

代码示例来源:origin: stackoverflow.com

new KeyFrame(Duration.millis(200), new KeyValue(node.translateXProperty(), node.getTranslateX() - f * dx)),
  new KeyFrame(Duration.millis(200), new KeyValue(node.translateYProperty(), node.getTranslateY() - f * dy)),
  new KeyFrame(Duration.millis(200), new KeyValue(node.scaleXProperty(), scale)),
  new KeyFrame(Duration.millis(200), new KeyValue(node.scaleYProperty(), scale))
);

代码示例来源:origin: com.jfoenix/jfoenix

public void togglePane() {
  if (toggleAnimation == null) {
    updateToggleAnimation();
  }
  this.getClip().scaleXProperty().unbind();
  this.getClip().scaleYProperty().unbind();
  toggleAnimation.setRate(toggleAnimation.getRate() * -1);
  if (toggleAnimation.getCurrentTime().equals(Duration.millis(0)) && toggleAnimation.getRate() == -1) {
    toggleAnimation.playFrom(Duration.millis(510));
  } else {
    toggleAnimation.play();
  }
}

代码示例来源:origin: com.jfoenix/jfoenix

public CenterTransition(Node contentContainer, Node overlay) {
    super(contentContainer, new Timeline(
      new KeyFrame(Duration.ZERO,
        new KeyValue(contentContainer.scaleXProperty(), 0, Interpolator.LINEAR),
        new KeyValue(contentContainer.scaleYProperty(), 0, Interpolator.LINEAR),
        new KeyValue(overlay.opacityProperty(), 0, Interpolator.EASE_BOTH)
      ),
      new KeyFrame(Duration.millis(1000),
        new KeyValue(contentContainer.scaleXProperty(), 1, Interpolator.EASE_OUT),
        new KeyValue(contentContainer.scaleYProperty(), 1, Interpolator.EASE_OUT),
        new KeyValue(overlay.opacityProperty(), 1, Interpolator.EASE_BOTH)
      )));
    // reduce the number to increase the shifting , increase number to reduce shifting
    setCycleDuration(Duration.seconds(0.4));
    setDelay(Duration.seconds(0));
  }
}

代码示例来源:origin: com.jfoenix/jfoenix

CheckBoxTransition(Node mark) {
  super(null, new Timeline(
      new KeyFrame(
        Duration.ZERO,
        new KeyValue(mark.opacityProperty(), 0, Interpolator.EASE_OUT),
        new KeyValue(mark.scaleXProperty(), 0.5, Interpolator.EASE_OUT),
        new KeyValue(mark.scaleYProperty(), 0.5, Interpolator.EASE_OUT)
      ),
      new KeyFrame(Duration.millis(400),
        new KeyValue(mark.opacityProperty(), 1, Interpolator.EASE_OUT),
        new KeyValue(mark.scaleXProperty(), 0.5, Interpolator.EASE_OUT),
        new KeyValue(mark.scaleYProperty(), 0.5, Interpolator.EASE_OUT)
      ),
      new KeyFrame(
        Duration.millis(1000),
        new KeyValue(mark.scaleXProperty(), 1, Interpolator.EASE_OUT),
        new KeyValue(mark.scaleYProperty(), 1, Interpolator.EASE_OUT)
      )
    )
  );
  // reduce the number to increase the shifting , increase number to reduce shifting
  setCycleDuration(Duration.seconds(0.12));
  setDelay(Duration.seconds(0.05));
  this.mark = mark;
}

代码示例来源:origin: com.jfoenix/jfoenix

new KeyValue(burger.getChildren().get(0).translateYProperty(), 0, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(0).translateXProperty(), 0, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(0).scaleXProperty(), 1, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(2).rotateProperty(), 0, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(2).translateYProperty(), 0, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(2).translateXProperty(), 0, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(2).scaleXProperty(), 1, Interpolator.EASE_BOTH)
new KeyValue(burger.getChildren().get(0).translateYProperty(), transY, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(0).translateXProperty(), -transX, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(0).scaleXProperty(), 0.5, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(2).rotateProperty(), angle, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(2).translateYProperty(), -transY, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(2).translateXProperty(), -transX, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(2).scaleXProperty(), 0.5, Interpolator.EASE_BOTH)

代码示例来源:origin: com.jfoenix/jfoenix

new KeyValue(burger.getChildren().get(0).translateYProperty(), 0, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(0).translateXProperty(), 0, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(0).scaleXProperty(), 1, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(2).rotateProperty(), 0, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(2).translateYProperty(), 0, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(2).translateXProperty(), 0, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(2).scaleXProperty(), 1, Interpolator.EASE_BOTH)
new KeyValue(burger.getChildren().get(0).translateYProperty(), transY, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(0).translateXProperty(), transX, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(0).scaleXProperty(), 0.5, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(2).rotateProperty(), -angle, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(2).translateYProperty(),
  Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(2).translateXProperty(), transX, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(2).scaleXProperty(), 0.5, Interpolator.EASE_BOTH)

代码示例来源:origin: com.jfoenix/jfoenix

new KeyFrame(Duration.millis(0), new KeyValue(getClip().scaleXProperty(), 1, Interpolator.EASE_BOTH)),
  new KeyFrame(Duration.millis(0), new KeyValue(getClip().scaleYProperty(), 1, Interpolator.EASE_BOTH)),
  new KeyFrame(Duration.millis(0),
    new KeyValue(getContentNode().opacityProperty(), 0, Interpolator.EASE_BOTH)),
  new KeyFrame(Duration.millis(350),
    new KeyValue(getClip().scaleXProperty(), newRate, Interpolator.EASE_BOTH)),
  new KeyFrame(Duration.millis(350),
    new KeyValue(getClip().scaleYProperty(), newRate, Interpolator.EASE_BOTH)),
toggleAnimation.setOnFinished((finish) -> {
  if (toggleAnimation.getRate() == 1) {
    this.getClip().scaleXProperty().bind(Bindings.createDoubleBinding(() -> {
      double X = this.getWidth() / getClip().getLayoutBounds().getWidth();
      double Y = this.getHeight() / getClip().getLayoutBounds().getHeight();

相关文章

微信公众号

最新文章

更多

Node类方法