当前位置: 首页>>代码示例>>Java>>正文


Java VBox.getChildren方法代码示例

本文整理汇总了Java中javafx.scene.layout.VBox.getChildren方法的典型用法代码示例。如果您正苦于以下问题:Java VBox.getChildren方法的具体用法?Java VBox.getChildren怎么用?Java VBox.getChildren使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.scene.layout.VBox的用法示例。


在下文中一共展示了VBox.getChildren方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: refresh

import javafx.scene.layout.VBox; //导入方法依赖的package包/类
/**
 * Sync all properties with controls.
 */
@FXThread
public void refresh() {

    final Object object = getCurrentObject();
    if (object == null) return;

    final VBox container = getContainer();
    container.setDisable(!canEdit(object, getCurrentParent()));

    final ObservableList<Node> children = container.getChildren();
    children.forEach(node -> {
        if (node instanceof UpdatableControl) {
            ((UpdatableControl) node).sync();
        }
    });
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:20,代码来源:PropertyEditor.java

示例2: buildFor

import javafx.scene.layout.VBox; //导入方法依赖的package包/类
/**
 * Build property controls for the object.
 *
 * @param object the object
 * @param parent the parent
 */
@FXThread
public void buildFor(@Nullable final Object object, @Nullable final Object parent) {
    if (getCurrentObject() == object) return;

    final VBox container = getContainer();
    final ObservableList<Node> children = container.getChildren();
    children.clear();

    if (object != null) {
        BUILDER_REGISTRY.buildFor(object, parent, container, changeConsumer);
    }

    container.setDisable(object == null || !canEdit(object, parent));

    setCurrentObject(object);
    setCurrentParent(parent);
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:24,代码来源:PropertyEditor.java

示例3: reload

import javafx.scene.layout.VBox; //导入方法依赖的package包/类
/**
 * Reload this control.
 */
public void reload() {

    final I influencer = getInfluencer();
    final VBox root = getElementContainer();
    final ObservableList<Node> children = root.getChildren();

    if (isNeedRebuild(influencer, children.size())) {
        UIUtils.clear(root);
        fillControl(influencer, root);
    } else {
        children.stream()
                .map(InterpolationElement.class::cast)
                .forEach(InterpolationElement::reload);
    }
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:19,代码来源:AbstractInterpolationInfluencerControl.java

示例4: processChangeType

import javafx.scene.layout.VBox; //导入方法依赖的package包/类
/**
 * 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();
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:29,代码来源:CreateTerrainDialog.java

示例5: processChange

import javafx.scene.layout.VBox; //导入方法依赖的package包/类
/**
 * 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();
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:27,代码来源:CreateSkyDialog.java

示例6: showComponentFor

import javafx.scene.layout.VBox; //导入方法依赖的package包/类
@Override
public void showComponentFor(@Nullable final Object element) {
    super.showComponentFor(null);

    if (element == null) return;

    final VBox container = getContainer();
    final ObservableList<Node> children = container.getChildren();

    getComponents().stream()
            .filter(component -> component.isSupport(element))
            .peek(component -> children.add((Node) component))
            .peek(component -> component.startProcessing(element))
            .filter(component -> isShowed())
            .forEach(ProcessingComponent::notifyShowed);
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:17,代码来源:PaintingComponentContainer.java

示例7: showComponentFor

import javafx.scene.layout.VBox; //导入方法依赖的package包/类
/**
 * Show a processing component to process with the element.
 *
 * @param element the element to process.
 */
@FXThread
public void showComponentFor(@Nullable final Object element) {

    final VBox container = getContainer();
    final ObservableList<Node> children = container.getChildren();
    children.stream().filter(componentType::isInstance)
            .map(componentType::cast)
            .peek(ProcessingComponent::notifyHided)
            .forEach(ProcessingComponent::stopProcessing);

    children.clear();

    if (element == null) return;

    final C processingComponent = getComponents().search(element, C::isSupport);
    if (processingComponent == null) return;

    children.add((Node) processingComponent);

    processingComponent.startProcessing(element);

    if (isShowed()) {
        processingComponent.notifyShowed();
    }
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:31,代码来源:ProcessingComponentContainer.java

示例8: TextFiledScrollSample

import javafx.scene.layout.VBox; //导入方法依赖的package包/类
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);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:13,代码来源:TextFiledScrollSample.java

示例9: NewConnectionBox

import javafx.scene.layout.VBox; //导入方法依赖的package包/类
public NewConnectionBox(Stage parent, MessageByLocaleService localeService, UIProperties uiProperties,
        ConnectionDataHandler valueHandler) {
    this.localeService = localeService;
    this.uiProperties = uiProperties;
    this.valueHandler = valueHandler;

    initModality(Modality.APPLICATION_MODAL);
    initOwner(parent);
    setTitle(localeService.getMessage("ui.menu.file.connect.title"));

    VBox connectBox = new VBox(uiProperties.getNewConnectSpacing());
    connectBox.setAlignment(Pos.CENTER);
    Scene content = new Scene(connectBox, uiProperties.getNewConnectWidth(), uiProperties.getNewConnectHeight());
    children = connectBox.getChildren();
    urlField = getUrlField(uiProperties.getNewConnectWidth());
    children.add(urlField);
    keyspaceField = getKeyspaceField(uiProperties.getNewConnectWidth());
    children.add(keyspaceField);
    authTriggerBox = getAuthTriggerBox();
    children.add(authTriggerBox);

    credentials = new AuthCredentialsBox(localeService, uiProperties);
    credentials.setMinWidth(uiProperties.getNewConnectWidth() - 10);
    credentials.setMaxWidth(uiProperties.getNewConnectWidth() - 10);

    Button submitButton = buildButton();
    children.add(submitButton);

    urlField.textProperty().addListener(TextFieldButtonWatcher.wrap(submitButton));
    keyspaceField.textProperty().addListener(TextFieldButtonWatcher.wrap(submitButton));

    urlField.requestFocus();
    setScene(content);
    show();
}
 
开发者ID:Kindrat,项目名称:cassandra-client,代码行数:36,代码来源:NewConnectionBox.java

示例10: syncFor

import javafx.scene.layout.VBox; //导入方法依赖的package包/类
/**
 * Sync all properties with controls.
 *
 * @param object the object
 */
@FXThread
public void syncFor(@Nullable final Object object) {
    if (!isNeedUpdate(object)) return;

    final VBox container = getContainer();
    container.setDisable(object == null || !canEdit(object, getCurrentParent()));

    final ObservableList<Node> children = container.getChildren();
    children.forEach(node -> {
        if (node instanceof UpdatableControl) {
            ((UpdatableControl) node).sync();
        }
    });
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:20,代码来源:PropertyEditor.java

示例11: rebuildFor

import javafx.scene.layout.VBox; //导入方法依赖的package包/类
/**
 * Re-build property controls for the object.
 *
 * @param object the object
 * @param parent the parent
 */
@FXThread
public void rebuildFor(@Nullable final Object object, @Nullable final Object parent) {
    if (getCurrentObject() != object) return;

    final VBox container = getContainer();
    final ObservableList<Node> children = container.getChildren();
    children.clear();

    if (object != null) {
        BUILDER_REGISTRY.buildFor(object, parent, container, changeConsumer);
    }
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:19,代码来源:PropertyEditor.java

示例12: createControls

import javafx.scene.layout.VBox; //导入方法依赖的package包/类
/**
 * Create controls.
 */
private void createControls() {

    final Label propertyNameLabel = new Label(getControlTitle() + ":");

    elementContainer = new VBox();

    final Button addButton = new Button();
    addButton.setGraphic(new ImageView(Icons.ADD_16));
    addButton.setOnAction(event -> processAdd());

    final Button removeButton = new Button();
    removeButton.setGraphic(new ImageView(Icons.REMOVE_12));
    removeButton.setOnAction(event -> processRemove());
    removeButton.setDisable(true);

    final HBox buttonContainer = new HBox(addButton, removeButton);

    final ObservableList<Node> children = elementContainer.getChildren();
    children.addListener((ListChangeListener<Node>) c -> removeButton.setDisable(children.size() < (getMinElements() + 1)));

    FXUtils.addToPane(propertyNameLabel, this);
    FXUtils.addToPane(elementContainer, this);
    FXUtils.addToPane(buttonContainer, this);

    FXUtils.addClassTo(propertyNameLabel, CSSClasses.ABSTRACT_PARAM_CONTROL_PARAM_NAME_SINGLE_ROW);
    FXUtils.addClassTo(addButton, CSSClasses.BUTTON_WITHOUT_RIGHT_BORDER);
    FXUtils.addClassTo(removeButton, CSSClasses.BUTTON_WITHOUT_LEFT_BORDER);
    FXUtils.addClassTo(buttonContainer, CSSClasses.DEF_HBOX);
    FXUtils.addClassTo(elementContainer, CSSClasses.DEF_VBOX);

    DynamicIconSupport.addSupport(addButton, removeButton);
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:36,代码来源:PhysicsNodeListControl.java

示例13: reload

import javafx.scene.layout.VBox; //导入方法依赖的package包/类
/**
 * Reload this control.
 */
public void reload() {

    final PhysicsInfluencer influencer = getInfluencer();
    final VBox root = getElementContainer();
    final ObservableList<Node> children = root.getChildren();

    if (isNeedRebuild(influencer, children.size())) {
        UIUtils.clear(root);
        fillControl(influencer, root);
    }
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:15,代码来源:PhysicsNodeListControl.java

示例14: createControls

import javafx.scene.layout.VBox; //导入方法依赖的package包/类
/**
 * Create controls.
 */
protected void createControls() {

    final Label propertyNameLabel = new Label(getControlTitle() + ":");

    elementContainer = new VBox();

    final Button addButton = new Button();
    addButton.setGraphic(new ImageView(Icons.ADD_16));
    addButton.setOnAction(event -> processAdd());

    final Button removeButton = new Button();
    removeButton.setGraphic(new ImageView(Icons.REMOVE_12));
    removeButton.setOnAction(event -> processRemove());

    final HBox buttonContainer = new HBox(addButton, removeButton);

    final ObservableList<Node> children = elementContainer.getChildren();
    children.addListener((ListChangeListener<Node>) c -> removeButton.setDisable(children.size() < (getMinElements() + 1)));

    FXUtils.addToPane(propertyNameLabel, this);
    FXUtils.addToPane(elementContainer, this);
    FXUtils.addToPane(buttonContainer, this);

    FXUtils.addClassTo(propertyNameLabel, CSSClasses.ABSTRACT_PARAM_CONTROL_PARAM_NAME_SINGLE_ROW);
    FXUtils.addClassTo(elementContainer, CSSClasses.DEF_VBOX);
    FXUtils.addClassTo(addButton, CSSClasses.BUTTON_WITHOUT_RIGHT_BORDER);
    FXUtils.addClassTo(removeButton, CSSClasses.BUTTON_WITHOUT_LEFT_BORDER);
    FXUtils.addClassTo(buttonContainer, CSSClasses.DEF_HBOX);

    DynamicIconSupport.addSupport(addButton, removeButton);
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:35,代码来源:AbstractInterpolationInfluencerControl.java

示例15: notifyShowed

import javafx.scene.layout.VBox; //导入方法依赖的package包/类
/**
 * Notify about showed this container.
 */
@FXThread
public void notifyShowed() {
    setShowed(true);

    final VBox container = getContainer();
    final ObservableList<Node> children = container.getChildren();
    children.stream().filter(componentType::isInstance)
            .map(componentType::cast)
            .forEach(ProcessingComponent::notifyShowed);
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:14,代码来源:ProcessingComponentContainer.java


注:本文中的javafx.scene.layout.VBox.getChildren方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。