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

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

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

Node.lookupAll介绍

暂无

代码示例

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

/**
 * this method is used to set some nodes in cell content as mouse transparent nodes
 * so clicking on them will trigger the ripple effect.
 */
protected void makeChildrenTransparent() {
  for (Node child : getChildren()) {
    if (child instanceof Label) {
      Set<Node> texts = child.lookupAll("Text");
      for (Node text : texts) {
        text.setMouseTransparent(true);
      }
    } else if (child instanceof Shape) {
      child.setMouseTransparent(true);
    }
  }
}

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

"rgba(40, 40, 40, 0.87)") : Color.valueOf("rgba(255, 255, 255, 0.87)");
for (Node tabNode : tabs.lookupAll(".tab")) {
  for (Node node : tabNode.lookupAll(".tab-label")) {
    ((Label) node).setTextFill(fontColor);
  for (Node node : tabNode.lookupAll(".jfx-rippler")) {
    ((JFXRippler) node).setRipplerFill(fontColor);

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

/**
 * {@inheritDoc}
 */
@Override
public Set<Node> lookupAll(final String selector) {
  return node().lookupAll(selector);
}

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

public <T> T lookup(Node parent, String id, Class<T> clazz) {
  for (Node node : parent.lookupAll(id)) {
    if (node.getClass().isAssignableFrom(clazz)) {
      return (T)node;
    }
  }
  throw new IllegalArgumentException("Parent " + parent + " doesn't contain node with id " + id);
}

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

private static Set<Node> findAllRecursively( String query, Node node )
{
  Set<Node> foundNodes;
  if( query.startsWith( "." ) || query.startsWith( "#" ) )
  {
    foundNodes = node.lookupAll( query );
  }
  else
  {
    foundNodes = findAll( hasText( query ), node );
  }
  return foundNodes;
}

代码示例来源:origin: com.aquafx-project/aquafx

@Override public void run() {
    for (Node n : heightTest.lookupAll(".choice-box")) {
      ((ChoiceBox) n).getSelectionModel().selectFirst();
    }
    for (Node n : heightTest.lookupAll(".combo-box")) {
      ((ComboBox) n).getSelectionModel().selectFirst();
    }
  }
});

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

@Override
public void start(Stage primaryStage) {
  ColorPicker picker = new ColorPicker();
  StackPane root = new StackPane(picker);

  Scene scene = new Scene(root, 500, 400);

  primaryStage.setScene(scene);
  primaryStage.show();
  picker.showingProperty().addListener((obs,b,b1)->{
    if(b1){
      PopupWindow popupWindow = getPopupWindow();
      Node popup = popupWindow.getScene().getRoot().getChildrenUnmodifiable().get(0);
      popup.lookupAll(".color-rect").stream()
        .forEach(rect->{
          Color c = (Color)((Rectangle)rect).getFill();
          Tooltip.install(rect.getParent(), new Tooltip("Custom tip for "+c.toString()));
        });
    }
  });
}

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

/**
 * this method is used to set some nodes in cell content as mouse transparent nodes
 * so clicking on them will trigger the ripple effect.
 */
protected void makeChildrenTransparent() {
  for (Node child : getChildren()) {
    if (child instanceof Label) {
      Set<Node> texts = child.lookupAll("Text");
      for (Node text : texts) {
        text.setMouseTransparent(true);
      }
    } else if (child instanceof Shape) {
      child.setMouseTransparent(true);
    }
  }
}

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

PopupWindow popupWindow = getPopupWindow();
Node popup = popupWindow.getScene().getRoot().getChildrenUnmodifiable().get(0);
popup.lookupAll(".color-rect").stream()
  .forEach(rect->{
    Color c = (Color)((Rectangle)rect).getFill();

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

StackPane hover = (StackPane) popup.lookup(".hover-square");
Rectangle rectH = (Rectangle) hover.getChildren().get(0);
Set<Node> squares = popup.lookupAll(".color-rect");
squares.stream()
    .skip(squares.size()-2)

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

private void attachListener() {
  Node n = getContent();
  if (n != null) {
    for (Node c : n.lookupAll(".component")) { //$NON-NLS-1$
      if (c.getId() != null) {
        for (Node s : c.lookupAll(".shape")) { //$NON-NLS-1$
          s.setOnMouseEntered((e) -> {
            this.hoverNode.set(c);
          });
          s.setOnMouseExited((e) -> {
            if (this.hoverNode.get() == c) {
              this.hoverNode.set(null);
            }
          });
          s.setOnMouseReleased((e) -> {
            if (e.getClickCount() == 2) {
              fireEvent(new OpenItemEvent(c));
            } else {
              this.selectedNodes.clear();
              this.selectedNodes.add(c);
            }
          });
        }
      }
    }
  }
}

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

private void attachListener() {
  Node n = getContent();
  if (n != null) {
    for (Node c : n.lookupAll(".component")) { //$NON-NLS-1$
      if (c.getId() != null) {
        for (Node s : c.lookupAll(".shape")) { //$NON-NLS-1$
          s.setOnMouseEntered((e) -> {
            this.hoverNode.set(c);
          });
          s.setOnMouseExited((e) -> {
            if (this.hoverNode.get() == c) {
              this.hoverNode.set(null);
            }
          });
          s.setOnMouseReleased((e) -> {
            if (e.getClickCount() == 2) {
              fireEvent(new OpenItemEvent(c));
            } else {
              this.selectedNodes.clear();
              this.selectedNodes.add(c);
            }
          });
        }
      }
    }
  }
}

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

popup.lookupAll(".color-rect").stream()
  .forEach(rect->{
    Color c = (Color)((Rectangle)rect).getFill();

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

"rgba(40, 40, 40, 0.87)") : Color.valueOf("rgba(255, 255, 255, 0.87)");
for (Node tabNode : tabs.lookupAll(".tab")) {
  for (Node node : tabNode.lookupAll(".tab-label")) {
    ((Label) node).setTextFill(fontColor);
  for (Node node : tabNode.lookupAll(".jfx-rippler")) {
    ((JFXRippler) node).setRipplerFill(fontColor);

相关文章

微信公众号

最新文章

更多

Node类方法