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

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

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

Node.isVisible介绍

暂无

代码示例

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

  1. @Override
  2. protected double computePrefWidth(double height) {
  3. double width = 0.0F;
  4. for (Node child : getChildren()) {
  5. if (child instanceof TabHeaderContainer
  6. && child.isVisible()
  7. && (measureClosingTabs || !((TabHeaderContainer) child).isClosing)) {
  8. width += child.prefWidth(height);
  9. }
  10. }
  11. return snapSize(width) + snappedLeftInset() + snappedRightInset();
  12. }

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

  1. Text text = ((Text) node);
  2. final int beginIndex = text.getText().toLowerCase().indexOf(query.toLowerCase());
  3. if (beginIndex > -1 && node.isVisible()) {
  4. ArrayList<Bounds> boundingBoxes = getMatchingBounds(query, text);
  5. ArrayList<Rectangle> rectangles = new ArrayList<>();

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

  1. @Override
  2. protected void layoutChildren(double x, double y, double w, double h) {
  3. updateDisclosureNode();
  4. double disclosureWidth = 0;
  5. Node disclosureNode = ((JFXTreeTableCell<S, T>) getSkinnable()).getDisclosureNode();
  6. if (disclosureNode.isVisible()) {
  7. Pos alignment = getSkinnable().getAlignment();
  8. alignment = alignment == null ? Pos.CENTER_LEFT : alignment;
  9. layoutInArea(disclosureNode, x + 8, y, w, h, 0, Insets.EMPTY, false, false, HPos.LEFT, VPos.CENTER);
  10. disclosureWidth = disclosureNode.getLayoutBounds().getWidth() + 18;
  11. }
  12. super.layoutChildren(x + disclosureWidth, y, w - disclosureWidth, h);
  13. }
  14. }

代码示例来源:origin: org.testfx/testfx-internal-java9

  1. public static boolean isNotVisible(Node node) {
  2. return !node.isVisible();
  3. }

代码示例来源:origin: org.testfx/testfx-internal-java8

  1. @SuppressWarnings("deprecated")
  2. public static boolean isNotVisible(Node node) {
  3. return !node.isVisible() || !node.impl_isTreeVisible();
  4. }

代码示例来源:origin: org.jfxtras/jfxtras-common

  1. /**
  2. * Determine if a node is effectively visible.
  3. * This means that if the node or any of its parents are not visible, the node is effectively not visible.
  4. * Otherwise it is visible.
  5. *
  6. * @param n
  7. * @return
  8. */
  9. static public boolean isEffectivelyVisible(Node n) {
  10. while (n != null) {
  11. if (!n.isVisible()) {
  12. return false;
  13. }
  14. n = n.getParent();
  15. }
  16. return true;
  17. }

代码示例来源:origin: org.fxmisc.flowless/flowless

  1. public C getVisibleCell(int itemIndex) {
  2. C cell = cellManager.getPresentCell(itemIndex);
  3. if(cell.getNode().isVisible()) {
  4. return cell;
  5. } else {
  6. throw new NoSuchElementException(
  7. "Cell " + itemIndex + " is not visible");
  8. }
  9. }

代码示例来源:origin: org.fxmisc.flowless/flowless

  1. public Optional<C> getCellIfVisible(int itemIndex) {
  2. return cellManager.getCellIfPresent(itemIndex)
  3. .filter(c -> c.getNode().isVisible());
  4. }

代码示例来源:origin: org.jfxtras/jfxtras-test-support

  1. protected void assertNotVisible(String string) {
  2. Node lNode = find(string);
  3. if (lNode.isVisible()) {
  4. Assert.fail("Should not have found '" + string + "', but did anyway");
  5. }
  6. }

代码示例来源:origin: org.loadui/testFx

  1. @SuppressWarnings("deprecation")
  2. public static boolean isNodeVisible(Node node)
  3. {
  4. if(!node.isVisible() || !node.impl_isTreeVisible())
  5. return false;
  6. return isNodeWithinSceneBounds(node);
  7. }

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

  1. /**
  2. *
  3. */
  4. @Override
  5. public void validate() {
  6. if(getDisplay().isVisible()){
  7. editInputComponent.validate();
  8. }
  9. }

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

  1. /**
  2. *
  3. */
  4. @Override
  5. public boolean isNotValid() {
  6. if(getDisplay().isVisible()){
  7. return editInputComponent.isNotValid();
  8. }
  9. else {
  10. return false;
  11. }
  12. }

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

  1. for( Node node: parent.getChildrenUnmodifiable()) {
  2. if( node.isVisible() && !node.isDisabled() && node.isFocusTraversable())
  3. return node;
  4. }
  5. return null;

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

  1. /**
  2. *
  3. */
  4. @Override
  5. public void displayError() {
  6. if(getDisplay().isVisible()) {
  7. editInputComponent().displayError();
  8. }
  9. }

代码示例来源:origin: org.fxmisc.flowless/flowless

  1. public OptionalInt lastVisibleBefore(int position) {
  2. MemoizationList<C> cells = cellManager.getLazyCellList();
  3. int presentBefore = cells.getMemoizedCountBefore(position);
  4. for(int i = presentBefore - 1; i >= 0; --i) {
  5. C cell = cells.memoizedItems().get(i);
  6. if(cell.getNode().isVisible()) {
  7. return OptionalInt.of(cells.indexOfMemoizedItem(i));
  8. }
  9. }
  10. return OptionalInt.empty();
  11. }

代码示例来源:origin: org.fxmisc.flowless/flowless

  1. public OptionalInt firstVisibleAfter(int position) {
  2. MemoizationList<C> cells = cellManager.getLazyCellList();
  3. int presentBefore = cells.getMemoizedCountBefore(position);
  4. int present = cells.getMemoizedCount();
  5. for(int i = presentBefore; i < present; ++i) {
  6. C cell = cells.memoizedItems().get(i);
  7. if(cell.getNode().isVisible()) {
  8. return OptionalInt.of(cells.indexOfMemoizedItem(i));
  9. }
  10. }
  11. return OptionalInt.empty();
  12. }

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

  1. @Override
  2. protected double computePrefWidth(double height) {
  3. double width = 0.0F;
  4. for (Node child : getChildren()) {
  5. if (child instanceof TabHeaderContainer
  6. && child.isVisible()
  7. && (measureClosingTabs || !((TabHeaderContainer) child).isClosing)) {
  8. width += child.prefWidth(height);
  9. }
  10. }
  11. return snapSize(width) + snappedLeftInset() + snappedRightInset();
  12. }

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

  1. private void updateConstraints() {
  2. AnchorPane.clearConstraints(anchorCenteredPane);
  3. AnchorPane.setLeftAnchor(anchorCenteredPane, 0.);
  4. AnchorPane.setRightAnchor(anchorCenteredPane, 0.);
  5. AnchorPane.setTopAnchor(anchorCenteredPane, 0.);
  6. if (bottomNode.isVisible()) {
  7. AnchorPane.setBottomAnchor(anchorCenteredPane, 72.0);
  8. } else {
  9. AnchorPane.setBottomAnchor(anchorCenteredPane, 0.0);
  10. }
  11. }

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

  1. @Override
  2. protected void layoutChildren(double x, double y, double w, double h) {
  3. updateDisclosureNode();
  4. double disclosureWidth = 0;
  5. Node disclosureNode = ((JFXTreeTableCell<S, T>) getSkinnable()).getDisclosureNode();
  6. if (disclosureNode.isVisible()) {
  7. Pos alignment = getSkinnable().getAlignment();
  8. alignment = alignment == null ? Pos.CENTER_LEFT : alignment;
  9. layoutInArea(disclosureNode, x + 8, y, w, h, 0, Insets.EMPTY, false, false, HPos.LEFT, VPos.CENTER);
  10. disclosureWidth = disclosureNode.getLayoutBounds().getWidth() + 18;
  11. }
  12. super.layoutChildren(x + disclosureWidth, y, w - disclosureWidth, h);
  13. }
  14. }

代码示例来源:origin: com.guigarage/responsivefx

  1. private static void updateManagedProperty(Node n, DeviceType type) {
  2. // first time we've set this invisible => store the preset
  3. if (!n.getProperties().containsKey(PROP_MANAGED_STATE)) {
  4. n.getProperties().put(PROP_MANAGED_STATE, n.isManaged());
  5. }
  6. // don't track changes through this
  7. n.managedProperty().removeListener(MANAGED_LISTENER);
  8. // If it's visible we use the stored value for "managed" property
  9. n.setManaged(n.isVisible() ? (Boolean) n.getProperties().get(PROP_MANAGED_STATE) : false);
  10. // need to track changes through API
  11. n.managedProperty().addListener(MANAGED_LISTENER);
  12. }

相关文章

Node类方法