本文整理汇总了Java中javafx.scene.layout.GridPane.getChildren方法的典型用法代码示例。如果您正苦于以下问题:Java GridPane.getChildren方法的具体用法?Java GridPane.getChildren怎么用?Java GridPane.getChildren使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.layout.GridPane
的用法示例。
在下文中一共展示了GridPane.getChildren方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getNodeByRowColumnIndex
import javafx.scene.layout.GridPane; //导入方法依赖的package包/类
private javafx.scene.Node getNodeByRowColumnIndex(final int row, final int column, GridPane gridPane) {
javafx.scene.Node result = null;
ObservableList<javafx.scene.Node> children = gridPane.getChildren();
for (javafx.scene.Node node : children) {
if(GridPane.getRowIndex(node) == row && GridPane.getColumnIndex(node) == column) {
result = node;
break;
}
}
return result;
}
示例2: removeRowFromGridPane
import javafx.scene.layout.GridPane; //导入方法依赖的package包/类
private GridPane removeRowFromGridPane(int row, GridPane gridPane ) {
Set<Node> deleteNodes = new HashSet<>();
for (Node child : gridPane.getChildren()) {
// get index from child
Integer rowIndex = GridPane.getRowIndex(child);
// handle null values for index=0
int r = rowIndex == null ? 0 : rowIndex;
if (r == row) {
// collect matching rows for deletion
deleteNodes.add(child);
}
}
gridPane.getChildren().removeAll(deleteNodes);
return gridPane;
}
示例3: handle
import javafx.scene.layout.GridPane; //导入方法依赖的package包/类
@Override public void handle(ActionEvent event) {
if (FunctionStage.this.functionItem == null) {
return;
}
ObservableList<Node> children = argumentPane.getChildren();
GridPane sp = (GridPane) children.get(0);
children = sp.getChildren();
String[] arguments = getArguments(children);
functionArgumentHandler.handle(arguments, (Function) functionItem.getValue());
}