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

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

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

Node.setVisible介绍

暂无

代码示例

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

private void initChild(Node node, int index, BiFunction<Boolean, Duration, Collection<KeyFrame>> animationFramesFunction, boolean addTriggerListener) {
  if (index > 0) {
    initNode(node);
    node.setVisible(false);
  } else {
    if (addTriggerListener) {
      if (node instanceof Button) {
        node.addEventHandler(ActionEvent.ACTION, event -> animateList());
      } else {
        node.addEventHandler(MouseEvent.MOUSE_CLICKED, event-> animateList());
      }
    }
    node.getStyleClass().add("trigger-node");
    node.setVisible(true);
  }
  if (animationFramesFunction == null && index != 0) {
    animationFramesFunction = initDefaultAnimation(node);
  } else if (animationFramesFunction == null && index == 0) {
    animationFramesFunction = (aBoolean, duration) -> new ArrayList<>();
  }
  animationsMap.put(node, animationFramesFunction);
}

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

private void createAnimation(boolean expanded, Timeline animation) {
  final ObservableList<Node> children = getChildren();
  double duration = 160 / (double) children.size();
  // show child nodes
  if (expanded) {
    for (Node child : children) {
      child.setVisible(true);
    }
  }
  // add child nodes animation
  for (int i = 1; i < children.size(); i++) {
    Node child = children.get(i);
    Collection<KeyFrame> frames = animationsMap.get(child).apply(expanded, Duration.millis(i * duration));
    animation.getKeyFrames().addAll(frames);
  }
  // add 1st element animation
  Collection<KeyFrame> frames = animationsMap.get(children.get(0)).apply(expanded, Duration.millis(160));
  animation.getKeyFrames().addAll(frames);
  // hide child nodes to allow mouse events on the nodes behind them
  if (!expanded) {
    animation.setOnFinished((finish) -> {
      for (int i = 1; i < children.size(); i++) {
        children.get(i).setVisible(false);
      }
    });
  } else {
    animation.setOnFinished(null);
  }
}

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

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

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

private void toggleVisibility(RowConstraints row,
               FilteredList<Node> children,
               boolean show) {
  if (show) {
    row.setMaxHeight(USE_COMPUTED_SIZE);
    row.setMinHeight(10);
  } else {
    row.setMaxHeight(0);
    row.setMinHeight(0);
  }
  children.forEach(n -> {
    n.setVisible(show);
    n.setManaged(show);
  });
}

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

if (is24HourView) {
  if (tmp == 0 || tmp > 12) {
    hoursContent.getChildren().get(0).setVisible(false);
    hoursContent.getChildren().get(1).setVisible(true);
  } else {
    hoursContent.getChildren().get(1).setVisible(false);
    hoursContent.getChildren().get(0).setVisible(true);

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

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

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

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

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

private void updateDisclosureNode() {
  Node disclosureNode = ((JFXTreeTableCell<S, T>) getSkinnable()).getDisclosureNode();
  if (disclosureNode != null) {
    TreeItem<S> item = getSkinnable().getTreeTableRow().getTreeItem();
    final S value = item == null ? null : item.getValue();
    boolean disclosureVisible = value != null
                  && !item.isLeaf()
                  && value instanceof RecursiveTreeObject
                  && ((RecursiveTreeObject) value).getGroupedColumn() == getSkinnable().getTableColumn();
    disclosureNode.setVisible(disclosureVisible);
    if (!disclosureVisible) {
      getChildren().remove(disclosureNode);
    } else if (disclosureNode.getParent() == null) {
      getChildren().add(disclosureNode);
      disclosureNode.toFront();
    } else {
      disclosureNode.toBack();
    }
    if (disclosureNode.getScene() != null) {
      disclosureNode.applyCss();
    }
  }
}

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

public HamburgerSlideCloseTransition(JFXHamburger burger) {
  super(burger, createTimeline(burger));
  timeline.bind(Bindings.createObjectBinding(() -> createTimeline(burger),
    ((Region) burger.getChildren().get(0)).widthProperty(),
    ((Region) burger.getChildren().get(0)).heightProperty()));
  setCycleDuration(Duration.seconds(0.3));
  setDelay(Duration.seconds(0));
  setOnFinished((finish) -> {
    if (this.getRate() == 1) {
      burger.getChildren().get(1).setVisible(false);
    }
  });
}

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

@Override
protected void starting() {
  super.starting();
  if (node.getParent() instanceof JFXRippler) {
    JFXRippler rippler = (JFXRippler) node.getParent();
    BorderPane p = new BorderPane(node);
    p.setMaxWidth(((JFXHamburger) node).getWidth());
    p.setMinWidth(((JFXHamburger) node).getWidth());
    p.addEventHandler(MouseEvent.ANY, (event) -> {
      if (!event.isConsumed()) {
        event.consume();
        node.fireEvent(event);
      }
    });
    rippler.setControl(p);
  }
  if (this.getRate() == -1) {
    ((JFXHamburger) node).getChildren().get(1).setVisible(true);
  }
}

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

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

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

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

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

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

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

htmlEditor.setVisible(false);
 Platform.runLater(new Runnable() {
   @Override
   public void run() {
     Node[] nodes = htmlEditor.lookupAll(".tool-bar").toArray(new Node[0]);
     for (Node node : nodes) {
       node.setVisible(false);
       node.setManaged(false);
     }
     htmlEditor.setVisible(true);
   }
 });

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

private void _doSetLoading() {
 StackPane p = new StackPane();
 p.setId("LoadingPane");
 p.setStyle("-fx-background-color:white;-fx-alignment:CENTER");
 NodeHelper.setHVGrow(p);
 content.getChildren().clear();
 content.getChildren().add(p);
 p.getChildren().add(NodeHelper.getProcessingIndicator());
 if (pagination != null) {
  pagination.getDisplay().setVisible(false);
 }
}

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

private void handleStageAttached() {
  handleFocus(getStage().focusedProperty());
  if (getStage().getModality() == Modality.WINDOW_MODAL) {
    this.dialogAreaNode.getMinButton().setVisible(false);
  }
}

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

private void handleStageAttached() {
  handleFocus(getStage().focusedProperty());
  if (getStage().getModality() == Modality.WINDOW_MODAL) {
    this.dialogAreaNode.getMinButton().setVisible(false);
  }
}

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

private void _doSetNoContent() {
 content.getChildren().clear();
 if (noContentPane != null) {
  content.getChildren().clear();
  content.getChildren().add(noContentPane.getDisplay());
 }
 if (pagination != null) {
  pagination.getDisplay().setVisible(false);
  pagination.getDisplay().pseudoClassStateChanged(PseudoClass.getPseudoClass("nodata"), true);
 } ;
}

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

/**
 * @param newValue
 */
private void collapseExpand(Boolean newValue) {
 blocContent.visibleProperty().setValue(newValue);
 if (blocFooter != null) {
  blocFooter.getDisplay().setVisible(newValue);
 }
 if (blocTitle != null && blocTitle.getDisplay() != null) {
  blocTitle.getDisplay().pseudoClassStateChanged(PseudoClass.getPseudoClass("collapsed"), newValue);
 }
}

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

private void _doSetNoContent() {
 if (noContentPane != null) {
  tableView.setPlaceholder(noContentPane.getDisplay());
  tableView.pseudoClassStateChanged(PseudoClass.getPseudoClass("nocontent"), true);
 }
 if (pagination != null) {
  pagination.getDisplay().setVisible(false);
  pagination.getDisplay().pseudoClassStateChanged(PseudoClass.getPseudoClass("nodata"), true);
 } ;
}

相关文章

微信公众号

最新文章

更多

Node类方法