本文整理了Java中javafx.scene.Node.scaleYProperty()
方法的一些代码示例,展示了Node.scaleYProperty()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.scaleYProperty()
方法的具体详情如下:
包路径:javafx.scene.Node
类名称:Node
方法名:scaleYProperty
暂无
代码示例来源: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 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 KeyValue(getClip().scaleXProperty(), newRate, Interpolator.EASE_BOTH)),
new KeyFrame(Duration.millis(350),
new KeyValue(getClip().scaleYProperty(), newRate, Interpolator.EASE_BOTH)),
new KeyFrame(Duration.millis(370),
new KeyValue(getContentNode().opacityProperty(), 0, Interpolator.EASE_BOTH)),
}, this.widthProperty(), this.heightProperty()));
this.getClip().scaleYProperty().bind(Bindings.createDoubleBinding(() -> {
double X = this.getWidth() / getClip().getLayoutBounds().getWidth();
double Y = this.getHeight() / getClip().getLayoutBounds().getHeight();
代码示例来源:origin: jfoenixadmin/JFoenix
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)
));
frames.add(new KeyFrame(Duration.millis(duration.toMillis()),
代码示例来源:origin: torakiki/pdfsam
Timeline timeline = new Timeline(new KeyFrame(Duration.millis(2500)),
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),
代码示例来源: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.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))
);
timeline.play();
代码示例来源: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 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 KeyValue(getClip().scaleXProperty(), newRate, Interpolator.EASE_BOTH)),
new KeyFrame(Duration.millis(350),
new KeyValue(getClip().scaleYProperty(), newRate, Interpolator.EASE_BOTH)),
new KeyFrame(Duration.millis(370),
new KeyValue(getContentNode().opacityProperty(), 0, Interpolator.EASE_BOTH)),
}, this.widthProperty(), this.heightProperty()));
this.getClip().scaleYProperty().bind(Bindings.createDoubleBinding(() -> {
double X = this.getWidth() / getClip().getLayoutBounds().getWidth();
double Y = this.getHeight() / getClip().getLayoutBounds().getHeight();
内容来源于网络,如有侵权,请联系作者删除!