當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。