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

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

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

Node.lookupAll介绍

暂无

代码示例

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

  1. /**
  2. * this method is used to set some nodes in cell content as mouse transparent nodes
  3. * so clicking on them will trigger the ripple effect.
  4. */
  5. protected void makeChildrenTransparent() {
  6. for (Node child : getChildren()) {
  7. if (child instanceof Label) {
  8. Set<Node> texts = child.lookupAll("Text");
  9. for (Node text : texts) {
  10. text.setMouseTransparent(true);
  11. }
  12. } else if (child instanceof Shape) {
  13. child.setMouseTransparent(true);
  14. }
  15. }
  16. }

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

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

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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. @Override
  5. public Set<Node> lookupAll(final String selector) {
  6. return node().lookupAll(selector);
  7. }

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

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

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

  1. private static Set<Node> findAllRecursively( String query, Node node )
  2. {
  3. Set<Node> foundNodes;
  4. if( query.startsWith( "." ) || query.startsWith( "#" ) )
  5. {
  6. foundNodes = node.lookupAll( query );
  7. }
  8. else
  9. {
  10. foundNodes = findAll( hasText( query ), node );
  11. }
  12. return foundNodes;
  13. }

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

  1. @Override public void run() {
  2. for (Node n : heightTest.lookupAll(".choice-box")) {
  3. ((ChoiceBox) n).getSelectionModel().selectFirst();
  4. }
  5. for (Node n : heightTest.lookupAll(".combo-box")) {
  6. ((ComboBox) n).getSelectionModel().selectFirst();
  7. }
  8. }
  9. });

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

  1. @Override
  2. public void start(Stage primaryStage) {
  3. ColorPicker picker = new ColorPicker();
  4. StackPane root = new StackPane(picker);
  5. Scene scene = new Scene(root, 500, 400);
  6. primaryStage.setScene(scene);
  7. primaryStage.show();
  8. picker.showingProperty().addListener((obs,b,b1)->{
  9. if(b1){
  10. PopupWindow popupWindow = getPopupWindow();
  11. Node popup = popupWindow.getScene().getRoot().getChildrenUnmodifiable().get(0);
  12. popup.lookupAll(".color-rect").stream()
  13. .forEach(rect->{
  14. Color c = (Color)((Rectangle)rect).getFill();
  15. Tooltip.install(rect.getParent(), new Tooltip("Custom tip for "+c.toString()));
  16. });
  17. }
  18. });
  19. }

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

  1. /**
  2. * this method is used to set some nodes in cell content as mouse transparent nodes
  3. * so clicking on them will trigger the ripple effect.
  4. */
  5. protected void makeChildrenTransparent() {
  6. for (Node child : getChildren()) {
  7. if (child instanceof Label) {
  8. Set<Node> texts = child.lookupAll("Text");
  9. for (Node text : texts) {
  10. text.setMouseTransparent(true);
  11. }
  12. } else if (child instanceof Shape) {
  13. child.setMouseTransparent(true);
  14. }
  15. }
  16. }

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

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

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

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

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

  1. private void attachListener() {
  2. Node n = getContent();
  3. if (n != null) {
  4. for (Node c : n.lookupAll(".component")) { //$NON-NLS-1$
  5. if (c.getId() != null) {
  6. for (Node s : c.lookupAll(".shape")) { //$NON-NLS-1$
  7. s.setOnMouseEntered((e) -> {
  8. this.hoverNode.set(c);
  9. });
  10. s.setOnMouseExited((e) -> {
  11. if (this.hoverNode.get() == c) {
  12. this.hoverNode.set(null);
  13. }
  14. });
  15. s.setOnMouseReleased((e) -> {
  16. if (e.getClickCount() == 2) {
  17. fireEvent(new OpenItemEvent(c));
  18. } else {
  19. this.selectedNodes.clear();
  20. this.selectedNodes.add(c);
  21. }
  22. });
  23. }
  24. }
  25. }
  26. }
  27. }

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

  1. private void attachListener() {
  2. Node n = getContent();
  3. if (n != null) {
  4. for (Node c : n.lookupAll(".component")) { //$NON-NLS-1$
  5. if (c.getId() != null) {
  6. for (Node s : c.lookupAll(".shape")) { //$NON-NLS-1$
  7. s.setOnMouseEntered((e) -> {
  8. this.hoverNode.set(c);
  9. });
  10. s.setOnMouseExited((e) -> {
  11. if (this.hoverNode.get() == c) {
  12. this.hoverNode.set(null);
  13. }
  14. });
  15. s.setOnMouseReleased((e) -> {
  16. if (e.getClickCount() == 2) {
  17. fireEvent(new OpenItemEvent(c));
  18. } else {
  19. this.selectedNodes.clear();
  20. this.selectedNodes.add(c);
  21. }
  22. });
  23. }
  24. }
  25. }
  26. }
  27. }

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

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

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

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

相关文章

Node类方法