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

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

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

Node.opacityProperty介绍

暂无

代码示例

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

  1. public HorizontalTransition(boolean leftDirection, Node contentContainer, Node overlay) {
  2. super(contentContainer, new Timeline(
  3. new KeyFrame(Duration.ZERO,
  4. new KeyValue(contentContainer.translateXProperty(),
  5. (contentContainer.getLayoutX() + contentContainer.getLayoutBounds().getMaxX())
  6. * (leftDirection? -1 : 1), Interpolator.LINEAR),
  7. new KeyValue(overlay.opacityProperty(), 0, Interpolator.EASE_BOTH)
  8. ),
  9. new KeyFrame(Duration.millis(1000),
  10. new KeyValue(overlay.opacityProperty(), 1, Interpolator.EASE_BOTH),
  11. new KeyValue(contentContainer.translateXProperty(), 0, Interpolator.EASE_OUT)
  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. public VerticalTransition(boolean topDirection, Node contentContainer, Node overlay) {
  2. super(contentContainer, new Timeline(
  3. new KeyFrame(Duration.ZERO,
  4. new KeyValue(contentContainer.translateYProperty(),
  5. (contentContainer.getLayoutY() + contentContainer.getLayoutBounds().getMaxY())
  6. * (topDirection? -1 : 1), Interpolator.LINEAR),
  7. new KeyValue(overlay.opacityProperty(), 0, Interpolator.EASE_BOTH)
  8. ),
  9. new KeyFrame(Duration.millis(1000),
  10. new KeyValue(overlay.opacityProperty(), 1, Interpolator.EASE_BOTH),
  11. new KeyValue(contentContainer.translateYProperty(), 0, Interpolator.EASE_OUT)
  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. 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 KeyValue(burger.getChildren().get(2).rotateProperty(), 0, Interpolator.EASE_BOTH),
  2. new KeyValue(burger.getChildren().get(2).translateYProperty(), 0, Interpolator.EASE_BOTH),
  3. new KeyValue(burger.getChildren().get(1).opacityProperty(), 1, Interpolator.EASE_BOTH)
  4. ),
  5. new KeyFrame(Duration.millis(1000),
  6. .getHeight() / 2),
  7. Interpolator.EASE_BOTH),
  8. new KeyValue(burger.getChildren().get(1).opacityProperty(), 0, Interpolator.EASE_BOTH)

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

  1. ));
  2. frames.add(new KeyFrame(Duration.millis(duration.toMillis()),
  3. new KeyValue(container.getChildren().get(0).opacityProperty(), expanded ? 0 : 1, Interpolator.EASE_BOTH),
  4. new KeyValue(container.getChildren().get(0).translateXProperty(), expanded ? 20 : 0, Interpolator.EASE_BOTH)
  5. ));
  6. frames.add(new KeyFrame(Duration.millis(duration.toMillis() + 40),
  7. new KeyValue(container.getChildren().get(0).opacityProperty(), expanded ? 1 : 0, Interpolator.EASE_BOTH),
  8. new KeyValue(container.getChildren().get(0).translateXProperty(), expanded ? 0 : 20, Interpolator.EASE_BOTH)
  9. ));

代码示例来源: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 KeyFrame(Duration.millis(350),
  5. new KeyValue(getClip().scaleXProperty(), newRate, Interpolator.EASE_BOTH)),
  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. new KeyFrame(Duration.millis(510),
  10. new KeyValue(getContentNode().opacityProperty(), 1, Interpolator.EASE_BOTH)));
  11. toggleAnimation.setOnFinished((finish) -> {
  12. if (toggleAnimation.getRate() == 1) {

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

  1. new KeyValue(burger.getChildren().get(2).rotateProperty(), 0, Interpolator.EASE_BOTH),
  2. new KeyValue(burger.getChildren().get(2).translateYProperty(), 0, Interpolator.EASE_BOTH),
  3. new KeyValue(burger.getChildren().get(1).opacityProperty(), 1, Interpolator.EASE_BOTH),
  4. new KeyValue(burger.getChildren().get(1).translateXProperty(), 0, Interpolator.EASE_BOTH)
  5. ),
  6. .getHeight() / 2),
  7. Interpolator.EASE_BOTH),
  8. new KeyValue(burger.getChildren().get(1).opacityProperty(), 0, Interpolator.EASE_BOTH),
  9. new KeyValue(burger.getChildren().get(1).translateXProperty(),
  10. -burger.getWidth() / 1.1,

代码示例来源:origin: org.jrebirth/transition

  1. opacities.add(/* dp */this.nodes.get(j).opacityProperty());
  2. idx++;

代码示例来源:origin: org.copper-engine/copper-monitoring-client

  1. animationPane.getChildren().add(node);
  2. }, new KeyValue(node.opacityProperty(), 0));
  3. KeyFrame keyFrame2 = new KeyFrame(Duration.millis(startTimeMs), keyValueStartX, keyValueStartY);
  4. KeyFrame keyFrame3 = new KeyFrame(Duration.millis(startTimeMs + FADEDURATION), new KeyValue(node.opacityProperty(), 1));
  5. KeyFrame keyFrame4 = new KeyFrame(Duration.millis(startTimeMs + FADEDURATION), keyValueStartX, keyValueStartY);
  6. KeyFrame keyFrame5 = new KeyFrame(Duration.millis(endTimeMs - FADEDURATION), keyValueEndX, keyValueEndY);
  7. KeyFrame keyFrame6 = new KeyFrame(Duration.millis(endTimeMs - FADEDURATION), new KeyValue(node.opacityProperty(), 1));
  8. KeyFrame keyFrame7 = new KeyFrame(Duration.millis(endTimeMs),
  9. new EventHandler<ActionEvent>() {
  10. animationPane.getChildren().remove(node);
  11. }, new KeyValue(node.opacityProperty(), 0));

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

  1. public VerticalTransition(boolean topDirection, Node contentContainer, Node overlay) {
  2. super(contentContainer, new Timeline(
  3. new KeyFrame(Duration.ZERO,
  4. new KeyValue(contentContainer.translateYProperty(),
  5. (contentContainer.getLayoutY() + contentContainer.getLayoutBounds().getMaxY())
  6. * (topDirection? -1 : 1), Interpolator.LINEAR),
  7. new KeyValue(overlay.opacityProperty(), 0, Interpolator.EASE_BOTH)
  8. ),
  9. new KeyFrame(Duration.millis(1000),
  10. new KeyValue(overlay.opacityProperty(), 1, Interpolator.EASE_BOTH),
  11. new KeyValue(contentContainer.translateYProperty(), 0, Interpolator.EASE_OUT)
  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. public HorizontalTransition(boolean leftDirection, Node contentContainer, Node overlay) {
  2. super(contentContainer, new Timeline(
  3. new KeyFrame(Duration.ZERO,
  4. new KeyValue(contentContainer.translateXProperty(),
  5. (contentContainer.getLayoutX() + contentContainer.getLayoutBounds().getMaxX())
  6. * (leftDirection? -1 : 1), Interpolator.LINEAR),
  7. new KeyValue(overlay.opacityProperty(), 0, Interpolator.EASE_BOTH)
  8. ),
  9. new KeyFrame(Duration.millis(1000),
  10. new KeyValue(overlay.opacityProperty(), 1, Interpolator.EASE_BOTH),
  11. new KeyValue(contentContainer.translateXProperty(), 0, Interpolator.EASE_OUT)
  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. 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: org.javafxdata/datafx-ui

  1. : new KeyFrame(Duration.ZERO,
  2. new KeyValue(cell.prefHeightProperty(), startHeight, Interpolator.EASE_BOTH),
  3. new KeyValue(graphic.opacityProperty(), 1.0, Interpolator.EASE_BOTH));
  4. : new KeyFrame(Duration.millis(ANIMATION_DURATION / 2.0),
  5. replaceGraphicEvent,
  6. new KeyValue(graphic.opacityProperty(), 0.0, Interpolator.EASE_BOTH));
  7. fireEvent2,
  8. new KeyValue(cell.prefHeightProperty(), endHeight, Interpolator.EASE_BOTH),
  9. new KeyValue(graphic.opacityProperty(), endOpacity, Interpolator.EASE_BOTH));

代码示例来源:origin: org.javafxdata/datafx-cell

  1. : new KeyFrame(Duration.ZERO,
  2. new KeyValue(cell.prefHeightProperty(), startHeight, Interpolator.EASE_BOTH),
  3. new KeyValue(graphic.opacityProperty(), 1.0, Interpolator.EASE_BOTH));
  4. : new KeyFrame(Duration.millis(ANIMATION_DURATION / 2.0),
  5. replaceGraphicEvent,
  6. new KeyValue(graphic.opacityProperty(), 0.0, Interpolator.EASE_BOTH));
  7. fireEvent2,
  8. new KeyValue(cell.prefHeightProperty(), endHeight, Interpolator.EASE_BOTH),
  9. new KeyValue(graphic.opacityProperty(), endOpacity, Interpolator.EASE_BOTH));

代码示例来源:origin: org.controlsfx/controlsfx

  1. private void maybeAnimatePositionChange(final double position,
  2. final boolean showDetail) {
  3. Node detailNode = getSkinnable().getDetailNode();
  4. if (detailNode == null) {
  5. return;
  6. }
  7. showDetailForTimeline.set(showDetail);
  8. Divider divider = splitPane.getDividers().get(0);
  9. if (showDetailForTimeline.get()) {
  10. unbindDividerPosition();
  11. bindDividerPosition();
  12. }
  13. if (getSkinnable().isAnimated() && detailNode != null) {
  14. KeyValue positionKeyValue = new KeyValue(
  15. divider.positionProperty(), position);
  16. KeyValue opacityKeyValue = new KeyValue(detailNode.opacityProperty(), showDetailForTimeline.get() ? 1 : 0);
  17. KeyFrame keyFrame = new KeyFrame(Duration.seconds(.1), "endAnimation", positionKeyValue, opacityKeyValue);
  18. timeline.getKeyFrames().clear();
  19. timeline.getKeyFrames().add(keyFrame);
  20. timeline.playFromStart();
  21. } else {
  22. detailNode.setOpacity(1);
  23. divider.setPosition(position);
  24. if (!showDetailForTimeline.get()) {
  25. unbindDividerPosition();
  26. splitPane.getItems().remove(getSkinnable().getDetailNode());
  27. }
  28. changing = false;
  29. }
  30. }

代码示例来源: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 KeyValue(burger.getChildren().get(2).rotateProperty(), 0, Interpolator.EASE_BOTH),
  2. new KeyValue(burger.getChildren().get(2).translateYProperty(), 0, Interpolator.EASE_BOTH),
  3. new KeyValue(burger.getChildren().get(1).opacityProperty(), 1, Interpolator.EASE_BOTH)
  4. ),
  5. new KeyFrame(Duration.millis(1000),
  6. .getHeight() / 2),
  7. Interpolator.EASE_BOTH),
  8. new KeyValue(burger.getChildren().get(1).opacityProperty(), 0, Interpolator.EASE_BOTH)

代码示例来源: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 KeyFrame(Duration.millis(350),
  5. new KeyValue(getClip().scaleXProperty(), newRate, Interpolator.EASE_BOTH)),
  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. new KeyFrame(Duration.millis(510),
  10. new KeyValue(getContentNode().opacityProperty(), 1, Interpolator.EASE_BOTH)));
  11. toggleAnimation.setOnFinished((finish) -> {
  12. if (toggleAnimation.getRate() == 1) {

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

  1. new KeyValue(burger.getChildren().get(2).rotateProperty(), 0, Interpolator.EASE_BOTH),
  2. new KeyValue(burger.getChildren().get(2).translateYProperty(), 0, Interpolator.EASE_BOTH),
  3. new KeyValue(burger.getChildren().get(1).opacityProperty(), 1, Interpolator.EASE_BOTH),
  4. new KeyValue(burger.getChildren().get(1).translateXProperty(), 0, Interpolator.EASE_BOTH)
  5. ),
  6. .getHeight() / 2),
  7. Interpolator.EASE_BOTH),
  8. new KeyValue(burger.getChildren().get(1).opacityProperty(), 0, Interpolator.EASE_BOTH),
  9. new KeyValue(burger.getChildren().get(1).translateXProperty(),
  10. -burger.getWidth() / 1.1,

相关文章

Node类方法