本文整理匯總了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());
}