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

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

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

Node.setVisible介绍

暂无

代码示例

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

  1. private void initChild(Node node, int index, BiFunction<Boolean, Duration, Collection<KeyFrame>> animationFramesFunction, boolean addTriggerListener) {
  2. if (index > 0) {
  3. initNode(node);
  4. node.setVisible(false);
  5. } else {
  6. if (addTriggerListener) {
  7. if (node instanceof Button) {
  8. node.addEventHandler(ActionEvent.ACTION, event -> animateList());
  9. } else {
  10. node.addEventHandler(MouseEvent.MOUSE_CLICKED, event-> animateList());
  11. }
  12. }
  13. node.getStyleClass().add("trigger-node");
  14. node.setVisible(true);
  15. }
  16. if (animationFramesFunction == null && index != 0) {
  17. animationFramesFunction = initDefaultAnimation(node);
  18. } else if (animationFramesFunction == null && index == 0) {
  19. animationFramesFunction = (aBoolean, duration) -> new ArrayList<>();
  20. }
  21. animationsMap.put(node, animationFramesFunction);
  22. }

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

  1. private void createAnimation(boolean expanded, Timeline animation) {
  2. final ObservableList<Node> children = getChildren();
  3. double duration = 160 / (double) children.size();
  4. // show child nodes
  5. if (expanded) {
  6. for (Node child : children) {
  7. child.setVisible(true);
  8. }
  9. }
  10. // add child nodes animation
  11. for (int i = 1; i < children.size(); i++) {
  12. Node child = children.get(i);
  13. Collection<KeyFrame> frames = animationsMap.get(child).apply(expanded, Duration.millis(i * duration));
  14. animation.getKeyFrames().addAll(frames);
  15. }
  16. // add 1st element animation
  17. Collection<KeyFrame> frames = animationsMap.get(children.get(0)).apply(expanded, Duration.millis(160));
  18. animation.getKeyFrames().addAll(frames);
  19. // hide child nodes to allow mouse events on the nodes behind them
  20. if (!expanded) {
  21. animation.setOnFinished((finish) -> {
  22. for (int i = 1; i < children.size(); i++) {
  23. children.get(i).setVisible(false);
  24. }
  25. });
  26. } else {
  27. animation.setOnFinished(null);
  28. }
  29. }

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

  1. arrow.setVisible(false);
  2. arrow.setManaged(false);

代码示例来源:origin: speedment/speedment

  1. private void toggleVisibility(RowConstraints row,
  2. FilteredList<Node> children,
  3. boolean show) {
  4. if (show) {
  5. row.setMaxHeight(USE_COMPUTED_SIZE);
  6. row.setMinHeight(10);
  7. } else {
  8. row.setMaxHeight(0);
  9. row.setMinHeight(0);
  10. }
  11. children.forEach(n -> {
  12. n.setVisible(show);
  13. n.setManaged(show);
  14. });
  15. }

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

  1. if (is24HourView) {
  2. if (tmp == 0 || tmp > 12) {
  3. hoursContent.getChildren().get(0).setVisible(false);
  4. hoursContent.getChildren().get(1).setVisible(true);
  5. } else {
  6. hoursContent.getChildren().get(1).setVisible(false);
  7. hoursContent.getChildren().get(0).setVisible(true);

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

  1. if (_24HourView) {
  2. if (Point2D.distance(0, 0, dx, dy) >= (contentCircleRadius - shift - (2 * selectionCircle.getRadius()))) {
  3. hoursContent.getChildren().get(1).setVisible(false);
  4. hoursContent.getChildren().get(0).setVisible(true);
  5. pointerRotate.get().setAngle(index * angle.get());
  6. timeValue = (index + 9) % 12 == 0 ? 12 : (index + 9) % 12;
  7. } else {
  8. hoursContent.getChildren().get(0).setVisible(false);
  9. hoursContent.getChildren().get(1).setVisible(true);
  10. _24HourPointerRotate.get().setAngle(index * angle.get());
  11. int tmp = ((index + 21) % 24 <= 13 ? (index + 21) % 24 + 12 : (index + 21) % 24);

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

  1. control.setVisible(!plot.isSelected());

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

  1. private void updateDisclosureNode() {
  2. Node disclosureNode = ((JFXTreeTableCell<S, T>) getSkinnable()).getDisclosureNode();
  3. if (disclosureNode != null) {
  4. TreeItem<S> item = getSkinnable().getTreeTableRow().getTreeItem();
  5. final S value = item == null ? null : item.getValue();
  6. boolean disclosureVisible = value != null
  7. && !item.isLeaf()
  8. && value instanceof RecursiveTreeObject
  9. && ((RecursiveTreeObject) value).getGroupedColumn() == getSkinnable().getTableColumn();
  10. disclosureNode.setVisible(disclosureVisible);
  11. if (!disclosureVisible) {
  12. getChildren().remove(disclosureNode);
  13. } else if (disclosureNode.getParent() == null) {
  14. getChildren().add(disclosureNode);
  15. disclosureNode.toFront();
  16. } else {
  17. disclosureNode.toBack();
  18. }
  19. if (disclosureNode.getScene() != null) {
  20. disclosureNode.applyCss();
  21. }
  22. }
  23. }

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

  1. public HamburgerSlideCloseTransition(JFXHamburger burger) {
  2. super(burger, createTimeline(burger));
  3. timeline.bind(Bindings.createObjectBinding(() -> createTimeline(burger),
  4. ((Region) burger.getChildren().get(0)).widthProperty(),
  5. ((Region) burger.getChildren().get(0)).heightProperty()));
  6. setCycleDuration(Duration.seconds(0.3));
  7. setDelay(Duration.seconds(0));
  8. setOnFinished((finish) -> {
  9. if (this.getRate() == 1) {
  10. burger.getChildren().get(1).setVisible(false);
  11. }
  12. });
  13. }

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

  1. @Override
  2. protected void starting() {
  3. super.starting();
  4. if (node.getParent() instanceof JFXRippler) {
  5. JFXRippler rippler = (JFXRippler) node.getParent();
  6. BorderPane p = new BorderPane(node);
  7. p.setMaxWidth(((JFXHamburger) node).getWidth());
  8. p.setMinWidth(((JFXHamburger) node).getWidth());
  9. p.addEventHandler(MouseEvent.ANY, (event) -> {
  10. if (!event.isConsumed()) {
  11. event.consume();
  12. node.fireEvent(event);
  13. }
  14. });
  15. rippler.setControl(p);
  16. }
  17. if (this.getRate() == -1) {
  18. ((JFXHamburger) node).getChildren().get(1).setVisible(true);
  19. }
  20. }

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

  1. Node closeButton = this.lookupButton(ButtonType.CLOSE);
  2. closeButton.managedProperty().bind(closeButton.visibleProperty());
  3. closeButton.setVisible(false);

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

  1. seperator.setVisible(false); seperator.setManaged(false);
  2. if (url != null && imageNamePattern.matcher(url).matches()) {
  3. Node button = imageView.getParent().getParent();
  4. button.setVisible(false); button.setManaged(false);

代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.controls

  1. protected void updateNode(int lineIndex) {
  2. N node = getNode(lineIndex);
  3. node.setVisible(true);
  4. this.nodePopulator.accept(node, Integer.valueOf(lineIndex));
  5. }

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

  1. htmlEditor.setVisible(false);
  2. Platform.runLater(new Runnable() {
  3. @Override
  4. public void run() {
  5. Node[] nodes = htmlEditor.lookupAll(".tool-bar").toArray(new Node[0]);
  6. for (Node node : nodes) {
  7. node.setVisible(false);
  8. node.setManaged(false);
  9. }
  10. htmlEditor.setVisible(true);
  11. }
  12. });

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

  1. private void _doSetLoading() {
  2. StackPane p = new StackPane();
  3. p.setId("LoadingPane");
  4. p.setStyle("-fx-background-color:white;-fx-alignment:CENTER");
  5. NodeHelper.setHVGrow(p);
  6. content.getChildren().clear();
  7. content.getChildren().add(p);
  8. p.getChildren().add(NodeHelper.getProcessingIndicator());
  9. if (pagination != null) {
  10. pagination.getDisplay().setVisible(false);
  11. }
  12. }

代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.controls

  1. private void handleStageAttached() {
  2. handleFocus(getStage().focusedProperty());
  3. if (getStage().getModality() == Modality.WINDOW_MODAL) {
  4. this.dialogAreaNode.getMinButton().setVisible(false);
  5. }
  6. }

代码示例来源:origin: at.bestsolution.eclipse/org.eclipse.fx.ui.controls

  1. private void handleStageAttached() {
  2. handleFocus(getStage().focusedProperty());
  3. if (getStage().getModality() == Modality.WINDOW_MODAL) {
  4. this.dialogAreaNode.getMinButton().setVisible(false);
  5. }
  6. }

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

  1. private void _doSetNoContent() {
  2. content.getChildren().clear();
  3. if (noContentPane != null) {
  4. content.getChildren().clear();
  5. content.getChildren().add(noContentPane.getDisplay());
  6. }
  7. if (pagination != null) {
  8. pagination.getDisplay().setVisible(false);
  9. pagination.getDisplay().pseudoClassStateChanged(PseudoClass.getPseudoClass("nodata"), true);
  10. } ;
  11. }

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

  1. /**
  2. * @param newValue
  3. */
  4. private void collapseExpand(Boolean newValue) {
  5. blocContent.visibleProperty().setValue(newValue);
  6. if (blocFooter != null) {
  7. blocFooter.getDisplay().setVisible(newValue);
  8. }
  9. if (blocTitle != null && blocTitle.getDisplay() != null) {
  10. blocTitle.getDisplay().pseudoClassStateChanged(PseudoClass.getPseudoClass("collapsed"), newValue);
  11. }
  12. }

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

  1. private void _doSetNoContent() {
  2. if (noContentPane != null) {
  3. tableView.setPlaceholder(noContentPane.getDisplay());
  4. tableView.pseudoClassStateChanged(PseudoClass.getPseudoClass("nocontent"), true);
  5. }
  6. if (pagination != null) {
  7. pagination.getDisplay().setVisible(false);
  8. pagination.getDisplay().pseudoClassStateChanged(PseudoClass.getPseudoClass("nodata"), true);
  9. } ;
  10. }

相关文章

Node类方法