本文整理了Java中javafx.scene.Node.opacityProperty()
方法的一些代码示例,展示了Node.opacityProperty()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.opacityProperty()
方法的具体详情如下:
包路径:javafx.scene.Node
类名称:Node
方法名:opacityProperty
暂无
代码示例来源:origin: jfoenixadmin/JFoenix
public HorizontalTransition(boolean leftDirection, Node contentContainer, Node overlay) {
super(contentContainer, new Timeline(
new KeyFrame(Duration.ZERO,
new KeyValue(contentContainer.translateXProperty(),
(contentContainer.getLayoutX() + contentContainer.getLayoutBounds().getMaxX())
* (leftDirection? -1 : 1), Interpolator.LINEAR),
new KeyValue(overlay.opacityProperty(), 0, Interpolator.EASE_BOTH)
),
new KeyFrame(Duration.millis(1000),
new KeyValue(overlay.opacityProperty(), 1, Interpolator.EASE_BOTH),
new KeyValue(contentContainer.translateXProperty(), 0, Interpolator.EASE_OUT)
)));
// reduce the number to increase the shifting , increase number to reduce shifting
setCycleDuration(Duration.seconds(0.4));
setDelay(Duration.seconds(0));
}
}
代码示例来源:origin: jfoenixadmin/JFoenix
public VerticalTransition(boolean topDirection, Node contentContainer, Node overlay) {
super(contentContainer, new Timeline(
new KeyFrame(Duration.ZERO,
new KeyValue(contentContainer.translateYProperty(),
(contentContainer.getLayoutY() + contentContainer.getLayoutBounds().getMaxY())
* (topDirection? -1 : 1), Interpolator.LINEAR),
new KeyValue(overlay.opacityProperty(), 0, Interpolator.EASE_BOTH)
),
new KeyFrame(Duration.millis(1000),
new KeyValue(overlay.opacityProperty(), 1, Interpolator.EASE_BOTH),
new KeyValue(contentContainer.translateYProperty(), 0, Interpolator.EASE_OUT)
)));
// reduce the number to increase the shifting , increase number to reduce shifting
setCycleDuration(Duration.seconds(0.4));
setDelay(Duration.seconds(0));
}
}
代码示例来源: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(2).rotateProperty(), 0, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(2).translateYProperty(), 0, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(1).opacityProperty(), 1, Interpolator.EASE_BOTH)
),
new KeyFrame(Duration.millis(1000),
.getHeight() / 2),
Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(1).opacityProperty(), 0, Interpolator.EASE_BOTH)
代码示例来源:origin: jfoenixadmin/JFoenix
));
frames.add(new KeyFrame(Duration.millis(duration.toMillis()),
new KeyValue(container.getChildren().get(0).opacityProperty(), expanded ? 0 : 1, Interpolator.EASE_BOTH),
new KeyValue(container.getChildren().get(0).translateXProperty(), expanded ? 20 : 0, Interpolator.EASE_BOTH)
));
frames.add(new KeyFrame(Duration.millis(duration.toMillis() + 40),
new KeyValue(container.getChildren().get(0).opacityProperty(), expanded ? 1 : 0, Interpolator.EASE_BOTH),
new KeyValue(container.getChildren().get(0).translateXProperty(), expanded ? 0 : 20, Interpolator.EASE_BOTH)
));
代码示例来源: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 KeyFrame(Duration.millis(350),
new KeyValue(getClip().scaleXProperty(), newRate, Interpolator.EASE_BOTH)),
new KeyValue(getClip().scaleYProperty(), newRate, Interpolator.EASE_BOTH)),
new KeyFrame(Duration.millis(370),
new KeyValue(getContentNode().opacityProperty(), 0, Interpolator.EASE_BOTH)),
new KeyFrame(Duration.millis(510),
new KeyValue(getContentNode().opacityProperty(), 1, Interpolator.EASE_BOTH)));
toggleAnimation.setOnFinished((finish) -> {
if (toggleAnimation.getRate() == 1) {
代码示例来源:origin: jfoenixadmin/JFoenix
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(1).opacityProperty(), 1, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(1).translateXProperty(), 0, Interpolator.EASE_BOTH)
),
.getHeight() / 2),
Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(1).opacityProperty(), 0, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(1).translateXProperty(),
-burger.getWidth() / 1.1,
代码示例来源:origin: org.jrebirth/transition
opacities.add(/* dp */this.nodes.get(j).opacityProperty());
idx++;
代码示例来源:origin: org.copper-engine/copper-monitoring-client
animationPane.getChildren().add(node);
}, new KeyValue(node.opacityProperty(), 0));
KeyFrame keyFrame2 = new KeyFrame(Duration.millis(startTimeMs), keyValueStartX, keyValueStartY);
KeyFrame keyFrame3 = new KeyFrame(Duration.millis(startTimeMs + FADEDURATION), new KeyValue(node.opacityProperty(), 1));
KeyFrame keyFrame4 = new KeyFrame(Duration.millis(startTimeMs + FADEDURATION), keyValueStartX, keyValueStartY);
KeyFrame keyFrame5 = new KeyFrame(Duration.millis(endTimeMs - FADEDURATION), keyValueEndX, keyValueEndY);
KeyFrame keyFrame6 = new KeyFrame(Duration.millis(endTimeMs - FADEDURATION), new KeyValue(node.opacityProperty(), 1));
KeyFrame keyFrame7 = new KeyFrame(Duration.millis(endTimeMs),
new EventHandler<ActionEvent>() {
animationPane.getChildren().remove(node);
}, new KeyValue(node.opacityProperty(), 0));
代码示例来源:origin: com.jfoenix/jfoenix
public VerticalTransition(boolean topDirection, Node contentContainer, Node overlay) {
super(contentContainer, new Timeline(
new KeyFrame(Duration.ZERO,
new KeyValue(contentContainer.translateYProperty(),
(contentContainer.getLayoutY() + contentContainer.getLayoutBounds().getMaxY())
* (topDirection? -1 : 1), Interpolator.LINEAR),
new KeyValue(overlay.opacityProperty(), 0, Interpolator.EASE_BOTH)
),
new KeyFrame(Duration.millis(1000),
new KeyValue(overlay.opacityProperty(), 1, Interpolator.EASE_BOTH),
new KeyValue(contentContainer.translateYProperty(), 0, Interpolator.EASE_OUT)
)));
// 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
public HorizontalTransition(boolean leftDirection, Node contentContainer, Node overlay) {
super(contentContainer, new Timeline(
new KeyFrame(Duration.ZERO,
new KeyValue(contentContainer.translateXProperty(),
(contentContainer.getLayoutX() + contentContainer.getLayoutBounds().getMaxX())
* (leftDirection? -1 : 1), Interpolator.LINEAR),
new KeyValue(overlay.opacityProperty(), 0, Interpolator.EASE_BOTH)
),
new KeyFrame(Duration.millis(1000),
new KeyValue(overlay.opacityProperty(), 1, Interpolator.EASE_BOTH),
new KeyValue(contentContainer.translateXProperty(), 0, Interpolator.EASE_OUT)
)));
// 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
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: org.javafxdata/datafx-ui
: new KeyFrame(Duration.ZERO,
new KeyValue(cell.prefHeightProperty(), startHeight, Interpolator.EASE_BOTH),
new KeyValue(graphic.opacityProperty(), 1.0, Interpolator.EASE_BOTH));
: new KeyFrame(Duration.millis(ANIMATION_DURATION / 2.0),
replaceGraphicEvent,
new KeyValue(graphic.opacityProperty(), 0.0, Interpolator.EASE_BOTH));
fireEvent2,
new KeyValue(cell.prefHeightProperty(), endHeight, Interpolator.EASE_BOTH),
new KeyValue(graphic.opacityProperty(), endOpacity, Interpolator.EASE_BOTH));
代码示例来源:origin: org.javafxdata/datafx-cell
: new KeyFrame(Duration.ZERO,
new KeyValue(cell.prefHeightProperty(), startHeight, Interpolator.EASE_BOTH),
new KeyValue(graphic.opacityProperty(), 1.0, Interpolator.EASE_BOTH));
: new KeyFrame(Duration.millis(ANIMATION_DURATION / 2.0),
replaceGraphicEvent,
new KeyValue(graphic.opacityProperty(), 0.0, Interpolator.EASE_BOTH));
fireEvent2,
new KeyValue(cell.prefHeightProperty(), endHeight, Interpolator.EASE_BOTH),
new KeyValue(graphic.opacityProperty(), endOpacity, Interpolator.EASE_BOTH));
代码示例来源:origin: org.controlsfx/controlsfx
private void maybeAnimatePositionChange(final double position,
final boolean showDetail) {
Node detailNode = getSkinnable().getDetailNode();
if (detailNode == null) {
return;
}
showDetailForTimeline.set(showDetail);
Divider divider = splitPane.getDividers().get(0);
if (showDetailForTimeline.get()) {
unbindDividerPosition();
bindDividerPosition();
}
if (getSkinnable().isAnimated() && detailNode != null) {
KeyValue positionKeyValue = new KeyValue(
divider.positionProperty(), position);
KeyValue opacityKeyValue = new KeyValue(detailNode.opacityProperty(), showDetailForTimeline.get() ? 1 : 0);
KeyFrame keyFrame = new KeyFrame(Duration.seconds(.1), "endAnimation", positionKeyValue, opacityKeyValue);
timeline.getKeyFrames().clear();
timeline.getKeyFrames().add(keyFrame);
timeline.playFromStart();
} else {
detailNode.setOpacity(1);
divider.setPosition(position);
if (!showDetailForTimeline.get()) {
unbindDividerPosition();
splitPane.getItems().remove(getSkinnable().getDetailNode());
}
changing = false;
}
}
代码示例来源: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(2).rotateProperty(), 0, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(2).translateYProperty(), 0, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(1).opacityProperty(), 1, Interpolator.EASE_BOTH)
),
new KeyFrame(Duration.millis(1000),
.getHeight() / 2),
Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(1).opacityProperty(), 0, Interpolator.EASE_BOTH)
代码示例来源: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 KeyFrame(Duration.millis(350),
new KeyValue(getClip().scaleXProperty(), newRate, Interpolator.EASE_BOTH)),
new KeyValue(getClip().scaleYProperty(), newRate, Interpolator.EASE_BOTH)),
new KeyFrame(Duration.millis(370),
new KeyValue(getContentNode().opacityProperty(), 0, Interpolator.EASE_BOTH)),
new KeyFrame(Duration.millis(510),
new KeyValue(getContentNode().opacityProperty(), 1, Interpolator.EASE_BOTH)));
toggleAnimation.setOnFinished((finish) -> {
if (toggleAnimation.getRate() == 1) {
代码示例来源:origin: com.jfoenix/jfoenix
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(1).opacityProperty(), 1, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(1).translateXProperty(), 0, Interpolator.EASE_BOTH)
),
.getHeight() / 2),
Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(1).opacityProperty(), 0, Interpolator.EASE_BOTH),
new KeyValue(burger.getChildren().get(1).translateXProperty(),
-burger.getWidth() / 1.1,
内容来源于网络,如有侵权,请联系作者删除!