Java Code Examples for javafx.scene.layout.VBox#getChildren()

The following examples show how to use javafx.scene.layout.VBox#getChildren() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RightListViewController.java    From mapper-generator-javafx with Apache License 2.0 6 votes vote down vote up
/**
 * 刷新 table 的字段信息
 */
@FXML
public void refreshTableColumn() {
    ObservableList<VBox> selectedItemVBoxs = vBoxListView.getSelectionModel().getSelectedItems();

    Assert.isTrue(selectedItemVBoxs.size() == 1, "请选择一个表进行操作", StageConstants.primaryStage);

    VBox selectedItemVBox = selectedItemVBoxs.get(0);
    String tableName = ((Label) ((HBox) selectedItemVBox.getChildren().get(0)).getChildren().get(0)).getText();
    columnService.reloadColumns(tableName);
    // 如果 size == 2 说明是,闭合状态下点击,如果 > 2 说明是展开状态下点击,这时需要删除
    ObservableList<Node> children = selectedItemVBox.getChildren();
    if (children.size() > 2) {
        selectedItemVBox.getChildren().remove(2);
    }
    rightListViewInit.expandTableViewColumns(selectedItemVBox);
}
 
Example 2
Source File: CreateTerrainDialog.java    From jmonkeybuilder with Apache License 2.0 6 votes vote down vote up
/**
 * Handle changing type of heightmap.
 */
@FxThread
private void processChangeType(@NotNull final HeightMapType newValue) {

    final VBox root = getSettingsRoot();
    final ObservableList<Node> children = root.getChildren();
    children.removeAll(flatSettings, heightMapSettings, hillSettings);

    switch (newValue) {
        case FLAT: {
            children.add(flatSettings);
            break;
        }
        case HILL: {
            children.add(hillSettings);
            break;
        }
        case IMAGE_BASED: {
            children.add(heightMapSettings);
            break;
        }
    }

    validate();
    getDialog().sizeToScene();
}
 
Example 3
Source File: CreateSkyDialog.java    From jmonkeybuilder with Apache License 2.0 6 votes vote down vote up
/**
 * Handle changing sky type.
 */
@FxThread
private void processChange(@NotNull final SkyType newValue) {

    final VBox settingsRoot = getSettingsRoot();
    final GridPane singleTextureSettings = getSingleTextureSettings();
    final GridPane multiplyTextureSettings = getMultipleTextureSettings();

    final ObservableList<javafx.scene.Node> children = settingsRoot.getChildren();
    children.removeAll(singleTextureSettings, getMultipleTextureSettings());

    switch (newValue) {
        case SINGLE_TEXTURE: {
            children.add(singleTextureSettings);
            break;
        }
        case MULTIPLE_TEXTURE: {
            children.add(multiplyTextureSettings);
        }
    }

    validate();
    getDialog().sizeToScene();
}
 
Example 4
Source File: TextFiledScrollSample.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
public TextFiledScrollSample() {
    VBox root = new VBox();
    ObservableList<Node> children = root.getChildren();
    for (int i = 0; i < 20; i++) {
        Label label = new Label("TextFiled " + i);
        children.add(label);
        TextField e = new TextField();
        children.add(e);
        children.add(new Button("Click Me"));
    }
    getChildren().add(root);
}