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

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

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

Node.scaleYProperty介绍

暂无

代码示例

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

  1. private BiFunction<Boolean, Duration, Collection<KeyFrame>> initDefaultAnimation(Node child) {
  2. return (expanded, duration) -> {
  3. ArrayList<KeyFrame> frames = new ArrayList<>();
  4. frames.add(new KeyFrame(duration, event -> {
  5. child.setScaleX(expanded ? 1 : 0);
  6. child.setScaleY(expanded ? 1 : 0);
  7. },
  8. new KeyValue(child.scaleXProperty(), expanded ? 1 : 0, Interpolator.EASE_BOTH),
  9. new KeyValue(child.scaleYProperty(), expanded ? 1 : 0, Interpolator.EASE_BOTH)
  10. ));
  11. return frames;
  12. };
  13. }

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

  1. public void togglePane() {
  2. if (toggleAnimation == null) {
  3. updateToggleAnimation();
  4. }
  5. this.getClip().scaleXProperty().unbind();
  6. this.getClip().scaleYProperty().unbind();
  7. toggleAnimation.setRate(toggleAnimation.getRate() * -1);
  8. if (toggleAnimation.getCurrentTime().equals(Duration.millis(0)) && toggleAnimation.getRate() == -1) {
  9. toggleAnimation.playFrom(Duration.millis(510));
  10. } else {
  11. toggleAnimation.play();
  12. }
  13. }

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

  1. public CenterTransition(Node contentContainer, Node overlay) {
  2. super(contentContainer, new Timeline(
  3. new KeyFrame(Duration.ZERO,
  4. new KeyValue(contentContainer.scaleXProperty(), 0, Interpolator.LINEAR),
  5. new KeyValue(contentContainer.scaleYProperty(), 0, Interpolator.LINEAR),
  6. new KeyValue(overlay.opacityProperty(), 0, Interpolator.EASE_BOTH)
  7. ),
  8. new KeyFrame(Duration.millis(1000),
  9. new KeyValue(contentContainer.scaleXProperty(), 1, Interpolator.EASE_OUT),
  10. new KeyValue(contentContainer.scaleYProperty(), 1, Interpolator.EASE_OUT),
  11. new KeyValue(overlay.opacityProperty(), 1, Interpolator.EASE_BOTH)
  12. )));
  13. // reduce the number to increase the shifting , increase number to reduce shifting
  14. setCycleDuration(Duration.seconds(0.4));
  15. setDelay(Duration.seconds(0));
  16. }
  17. }

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

  1. CheckBoxTransition(Node mark) {
  2. super(null, new Timeline(
  3. new KeyFrame(
  4. Duration.ZERO,
  5. new KeyValue(mark.opacityProperty(), 0, Interpolator.EASE_OUT),
  6. new KeyValue(mark.scaleXProperty(), 0.5, Interpolator.EASE_OUT),
  7. new KeyValue(mark.scaleYProperty(), 0.5, Interpolator.EASE_OUT)
  8. ),
  9. new KeyFrame(Duration.millis(400),
  10. new KeyValue(mark.opacityProperty(), 1, Interpolator.EASE_OUT),
  11. new KeyValue(mark.scaleXProperty(), 0.5, Interpolator.EASE_OUT),
  12. new KeyValue(mark.scaleYProperty(), 0.5, Interpolator.EASE_OUT)
  13. ),
  14. new KeyFrame(
  15. Duration.millis(1000),
  16. new KeyValue(mark.scaleXProperty(), 1, Interpolator.EASE_OUT),
  17. new KeyValue(mark.scaleYProperty(), 1, Interpolator.EASE_OUT)
  18. )
  19. )
  20. );
  21. // reduce the number to increase the shifting , increase number to reduce shifting
  22. setCycleDuration(Duration.seconds(0.12));
  23. setDelay(Duration.seconds(0.05));
  24. this.mark = mark;
  25. }

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

  1. new KeyFrame(Duration.millis(0), new KeyValue(getClip().scaleYProperty(), 1, Interpolator.EASE_BOTH)),
  2. new KeyFrame(Duration.millis(0),
  3. new KeyValue(getContentNode().opacityProperty(), 0, Interpolator.EASE_BOTH)),
  4. new KeyValue(getClip().scaleXProperty(), newRate, Interpolator.EASE_BOTH)),
  5. new KeyFrame(Duration.millis(350),
  6. new KeyValue(getClip().scaleYProperty(), newRate, Interpolator.EASE_BOTH)),
  7. new KeyFrame(Duration.millis(370),
  8. new KeyValue(getContentNode().opacityProperty(), 0, Interpolator.EASE_BOTH)),
  9. }, this.widthProperty(), this.heightProperty()));
  10. this.getClip().scaleYProperty().bind(Bindings.createDoubleBinding(() -> {
  11. double X = this.getWidth() / getClip().getLayoutBounds().getWidth();
  12. double Y = this.getHeight() / getClip().getLayoutBounds().getHeight();

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

  1. frames.add(new KeyFrame(duration,
  2. new KeyValue(container.getChildren().get(1).scaleXProperty(), expanded ? 1 : 0, Interpolator.EASE_BOTH),
  3. new KeyValue(container.getChildren().get(1).scaleYProperty(), expanded ? 1 : 0, Interpolator.EASE_BOTH)
  4. ));
  5. frames.add(new KeyFrame(Duration.millis(duration.toMillis()),

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

  1. Timeline timeline = new Timeline(new KeyFrame(Duration.millis(2500)),
  2. new KeyFrame(Duration.millis(0), new KeyValue(node.scaleXProperty(), 1, EASE_BOTH),
  3. new KeyValue(node.scaleYProperty(), 1, EASE_BOTH),
  4. new KeyValue(node.rotateProperty(), 0, EASE_BOTH)),
  5. new KeyFrame(Duration.millis(100), new KeyValue(node.scaleXProperty(), 0.9, EASE_BOTH),
  6. new KeyValue(node.scaleYProperty(), 0.9, EASE_BOTH),
  7. new KeyValue(node.rotateProperty(), -3, EASE_BOTH)),
  8. new KeyFrame(Duration.millis(200), new KeyValue(node.scaleXProperty(), 0.9, EASE_BOTH),
  9. new KeyValue(node.scaleYProperty(), 0.9, EASE_BOTH),
  10. new KeyValue(node.rotateProperty(), -3, EASE_BOTH)),
  11. new KeyFrame(Duration.millis(300), new KeyValue(node.scaleXProperty(), 1.1, EASE_BOTH),
  12. new KeyValue(node.scaleYProperty(), 1.1, EASE_BOTH),
  13. new KeyValue(node.rotateProperty(), 3, EASE_BOTH)),
  14. new KeyFrame(Duration.millis(400), new KeyValue(node.scaleXProperty(), 1.1, EASE_BOTH),
  15. new KeyValue(node.scaleYProperty(), 1.1, EASE_BOTH),
  16. new KeyValue(node.rotateProperty(), -3, EASE_BOTH)),
  17. new KeyFrame(Duration.millis(500), new KeyValue(node.scaleXProperty(), 1.1, EASE_BOTH),
  18. new KeyValue(node.scaleYProperty(), 1.1, EASE_BOTH),
  19. new KeyValue(node.rotateProperty(), 3, EASE_BOTH)),
  20. new KeyFrame(Duration.millis(600), new KeyValue(node.scaleXProperty(), 1.1, EASE_BOTH),
  21. new KeyValue(node.scaleYProperty(), 1.1, EASE_BOTH),
  22. new KeyValue(node.rotateProperty(), -3, EASE_BOTH)),
  23. new KeyFrame(Duration.millis(700), new KeyValue(node.scaleXProperty(), 1.1, EASE_BOTH),
  24. new KeyValue(node.scaleYProperty(), 1.1, EASE_BOTH),
  25. new KeyValue(node.rotateProperty(), 3, EASE_BOTH)),
  26. new KeyFrame(Duration.millis(800), new KeyValue(node.scaleXProperty(), 1.1, EASE_BOTH),
  27. new KeyValue(node.scaleYProperty(), 1.1, EASE_BOTH),
  28. new KeyValue(node.rotateProperty(), -3, EASE_BOTH)),
  29. new KeyFrame(Duration.millis(900), new KeyValue(node.scaleXProperty(), 1.1, EASE_BOTH),

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

  1. private BiFunction<Boolean, Duration, Collection<KeyFrame>> initDefaultAnimation(Node child) {
  2. return (expanded, duration) -> {
  3. ArrayList<KeyFrame> frames = new ArrayList<>();
  4. frames.add(new KeyFrame(duration, event -> {
  5. child.setScaleX(expanded ? 1 : 0);
  6. child.setScaleY(expanded ? 1 : 0);
  7. },
  8. new KeyValue(child.scaleXProperty(), expanded ? 1 : 0, Interpolator.EASE_BOTH),
  9. new KeyValue(child.scaleYProperty(), expanded ? 1 : 0, Interpolator.EASE_BOTH)
  10. ));
  11. return frames;
  12. };
  13. }

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

  1. new KeyFrame(Duration.millis(200), new KeyValue(node.translateYProperty(), node.getTranslateY() - f * dy)),
  2. new KeyFrame(Duration.millis(200), new KeyValue(node.scaleXProperty(), scale)),
  3. new KeyFrame(Duration.millis(200), new KeyValue(node.scaleYProperty(), scale))
  4. );
  5. timeline.play();

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

  1. public void togglePane() {
  2. if (toggleAnimation == null) {
  3. updateToggleAnimation();
  4. }
  5. this.getClip().scaleXProperty().unbind();
  6. this.getClip().scaleYProperty().unbind();
  7. toggleAnimation.setRate(toggleAnimation.getRate() * -1);
  8. if (toggleAnimation.getCurrentTime().equals(Duration.millis(0)) && toggleAnimation.getRate() == -1) {
  9. toggleAnimation.playFrom(Duration.millis(510));
  10. } else {
  11. toggleAnimation.play();
  12. }
  13. }

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

  1. public CenterTransition(Node contentContainer, Node overlay) {
  2. super(contentContainer, new Timeline(
  3. new KeyFrame(Duration.ZERO,
  4. new KeyValue(contentContainer.scaleXProperty(), 0, Interpolator.LINEAR),
  5. new KeyValue(contentContainer.scaleYProperty(), 0, Interpolator.LINEAR),
  6. new KeyValue(overlay.opacityProperty(), 0, Interpolator.EASE_BOTH)
  7. ),
  8. new KeyFrame(Duration.millis(1000),
  9. new KeyValue(contentContainer.scaleXProperty(), 1, Interpolator.EASE_OUT),
  10. new KeyValue(contentContainer.scaleYProperty(), 1, Interpolator.EASE_OUT),
  11. new KeyValue(overlay.opacityProperty(), 1, Interpolator.EASE_BOTH)
  12. )));
  13. // reduce the number to increase the shifting , increase number to reduce shifting
  14. setCycleDuration(Duration.seconds(0.4));
  15. setDelay(Duration.seconds(0));
  16. }
  17. }

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

  1. CheckBoxTransition(Node mark) {
  2. super(null, new Timeline(
  3. new KeyFrame(
  4. Duration.ZERO,
  5. new KeyValue(mark.opacityProperty(), 0, Interpolator.EASE_OUT),
  6. new KeyValue(mark.scaleXProperty(), 0.5, Interpolator.EASE_OUT),
  7. new KeyValue(mark.scaleYProperty(), 0.5, Interpolator.EASE_OUT)
  8. ),
  9. new KeyFrame(Duration.millis(400),
  10. new KeyValue(mark.opacityProperty(), 1, Interpolator.EASE_OUT),
  11. new KeyValue(mark.scaleXProperty(), 0.5, Interpolator.EASE_OUT),
  12. new KeyValue(mark.scaleYProperty(), 0.5, Interpolator.EASE_OUT)
  13. ),
  14. new KeyFrame(
  15. Duration.millis(1000),
  16. new KeyValue(mark.scaleXProperty(), 1, Interpolator.EASE_OUT),
  17. new KeyValue(mark.scaleYProperty(), 1, Interpolator.EASE_OUT)
  18. )
  19. )
  20. );
  21. // reduce the number to increase the shifting , increase number to reduce shifting
  22. setCycleDuration(Duration.seconds(0.12));
  23. setDelay(Duration.seconds(0.05));
  24. this.mark = mark;
  25. }

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

  1. new KeyFrame(Duration.millis(0), new KeyValue(getClip().scaleYProperty(), 1, Interpolator.EASE_BOTH)),
  2. new KeyFrame(Duration.millis(0),
  3. new KeyValue(getContentNode().opacityProperty(), 0, Interpolator.EASE_BOTH)),
  4. new KeyValue(getClip().scaleXProperty(), newRate, Interpolator.EASE_BOTH)),
  5. new KeyFrame(Duration.millis(350),
  6. new KeyValue(getClip().scaleYProperty(), newRate, Interpolator.EASE_BOTH)),
  7. new KeyFrame(Duration.millis(370),
  8. new KeyValue(getContentNode().opacityProperty(), 0, Interpolator.EASE_BOTH)),
  9. }, this.widthProperty(), this.heightProperty()));
  10. this.getClip().scaleYProperty().bind(Bindings.createDoubleBinding(() -> {
  11. double X = this.getWidth() / getClip().getLayoutBounds().getWidth();
  12. double Y = this.getHeight() / getClip().getLayoutBounds().getHeight();

相关文章

Node类方法