Search in sources :

Example 31 with Region

use of javafx.scene.layout.Region in project blue by kunstmusik.

the class BSBEditPane method getEditorForBSBObject.

private BSBObjectViewHolder getEditorForBSBObject(BSBObject bsbObj) {
    Region objectView = BSBObjectEditorFactory.getView(bsbObj);
    BooleanProperty editEnabledProperty = allowEditing ? bsbInterface.editEnabledProperty() : null;
    BSBObjectViewHolder viewHolder = new BSBObjectViewHolder(editEnabledProperty, selection, groupsList, objectView);
    if (objectView instanceof EditModeOnly) {
        if (allowEditing) {
            viewHolder.visibleProperty().bind(bsbInterface.editEnabledProperty());
        } else {
            viewHolder.setVisible(false);
        }
    }
    if (bsbObj instanceof BSBGroup) {
        BSBGroupView bsbGroupView = (BSBGroupView) objectView;
        bsbGroupView.initialize(editEnabledProperty, selection, groupsList);
    }
    return viewHolder;
}
Also used : BooleanProperty(javafx.beans.property.BooleanProperty) SimpleBooleanProperty(javafx.beans.property.SimpleBooleanProperty) Region(javafx.scene.layout.Region) EditModeOnly(blue.orchestra.editor.blueSynthBuilder.EditModeOnly) BSBGroup(blue.orchestra.blueSynthBuilder.BSBGroup)

Example 32 with Region

use of javafx.scene.layout.Region in project latexdraw by arnobl.

the class TestLatexdrawGUI method start.

@Override
public void start(final Stage aStage) {
    Canvas.setMargins(20);
    Canvas.setDefaultPage(Page.HORIZONTAL);
    stage = aStage;
    try {
        injector = createInjector();
        injectorFactory = injector::getInstance;
        final Parent root = FXMLLoader.load(LaTeXDraw.class.getResource(getFXMLPathFromLatexdraw()), LangTool.INSTANCE.getBundle(), new LatexdrawBuilderFactory(injector), injectorFactory);
        Parent parent = root;
        // So, need to add a fictive pane to contain the widgets.
        if (root instanceof Pane) {
            parent = root;
        } else {
            // TitledPane leads to flaky tests with TestFX. So, replacing the TitlePane with a classical pane.
            if (parent instanceof TitledPane) {
                titledPane = (TitledPane) parent;
                final Node content = ((TitledPane) parent).getContent();
                if (content instanceof Parent) {
                    parent = (Parent) content;
                } else {
                    final BorderPane pane = new BorderPane();
                    pane.setCenter(content);
                    parent = pane;
                }
            }
        }
        final Scene scene = new Scene(parent);
        aStage.setScene(scene);
        aStage.show();
        aStage.toFront();
        if (root instanceof Region) {
            aStage.minHeightProperty().bind(((Region) root).heightProperty());
            aStage.minWidthProperty().bind(((Region) root).widthProperty());
        }
        aStage.sizeToScene();
    } catch (final IOException ex) {
        ex.printStackTrace();
    }
}
Also used : TitledPane(javafx.scene.control.TitledPane) BorderPane(javafx.scene.layout.BorderPane) Parent(javafx.scene.Parent) LaTeXDraw(net.sf.latexdraw.LaTeXDraw) Node(javafx.scene.Node) Region(javafx.scene.layout.Region) IOException(java.io.IOException) Scene(javafx.scene.Scene) Pane(javafx.scene.layout.Pane) TitledPane(javafx.scene.control.TitledPane) BorderPane(javafx.scene.layout.BorderPane)

Example 33 with Region

use of javafx.scene.layout.Region in project tilesfx by HanSolo.

the class WeatherSymbol method initGraphics.

// ******************** Initialization ************************************
private void initGraphics() {
    if (Double.compare(getPrefWidth(), 0.0) <= 0 || Double.compare(getPrefHeight(), 0.0) <= 0 || Double.compare(getWidth(), 0.0) <= 0 || Double.compare(getHeight(), 0.0) <= 0) {
        if (getPrefWidth() > 0 && getPrefHeight() > 0) {
            setPrefSize(getPrefWidth(), getPrefHeight());
        } else {
            setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT);
        }
    }
    getStyleClass().setAll("weather-symbol");
    conditionIcon = new Region();
    conditionIcon.setId(condition.get().styleClass);
    conditionIcon.setStyle("-symbol-color: " + getSymbolColor().toString().replace("0x", "#") + ";");
    pane = new Pane(conditionIcon);
    getChildren().setAll(pane);
}
Also used : Region(javafx.scene.layout.Region) Pane(javafx.scene.layout.Pane)

Example 34 with Region

use of javafx.scene.layout.Region in project phoenicis by PhoenicisOrg.

the class StepRepresentationSpin method drawStepContent.

@Override
protected void drawStepContent() {
    super.drawStepContent();
    Region spacerAbove = new Region();
    VBox.setVgrow(spacerAbove, Priority.ALWAYS);
    this.addToContentPane(spacerAbove);
    ProgressIndicator progressIndicator = new ProgressIndicator();
    this.addToContentPane(progressIndicator);
    Region spacerBelow = new Region();
    VBox.setVgrow(spacerBelow, Priority.ALWAYS);
    this.addToContentPane(spacerBelow);
}
Also used : ProgressIndicator(javafx.scene.control.ProgressIndicator) Region(javafx.scene.layout.Region)

Example 35 with Region

use of javafx.scene.layout.Region in project phoenicis by PhoenicisOrg.

the class DetailsView method populateHeader.

/**
 * Populate the header with a label for the title of this details view and a close button
 */
private void populateHeader() {
    this.titleLabel = new Label();
    this.titleLabel.getStyleClass().add("descriptionTitle");
    this.titleLabel.setAlignment(Pos.CENTER_LEFT);
    this.titleLabel.setWrapText(true);
    this.closeButton = new Button();
    this.closeButton.getStyleClass().add("closeIcon");
    this.closeButton.setOnAction(event -> onClose.run());
    this.closeButton.setAlignment(Pos.CENTER_RIGHT);
    Region filler = new Region();
    HBox headerBox = new HBox();
    headerBox.getChildren().setAll(titleLabel, filler, closeButton);
    HBox.setHgrow(filler, Priority.ALWAYS);
    this.setTop(headerBox);
}
Also used : HBox(javafx.scene.layout.HBox) Button(javafx.scene.control.Button) Label(javafx.scene.control.Label) Region(javafx.scene.layout.Region)

Aggregations

Region (javafx.scene.layout.Region)106 Text (javafx.scene.text.Text)25 VBox (javafx.scene.layout.VBox)22 Label (javafx.scene.control.Label)21 Pane (javafx.scene.layout.Pane)21 Button (javafx.scene.control.Button)18 InnerShadow (javafx.scene.effect.InnerShadow)17 Scene (javafx.scene.Scene)16 Node (javafx.scene.Node)15 Insets (javafx.geometry.Insets)14 HBox (javafx.scene.layout.HBox)14 DropShadow (javafx.scene.effect.DropShadow)13 ArrayList (java.util.ArrayList)12 StackPane (javafx.scene.layout.StackPane)12 Canvas (javafx.scene.canvas.Canvas)11 Color (javafx.scene.paint.Color)11 GridPane (javafx.scene.layout.GridPane)10 Group (javafx.scene.Group)9 Background (javafx.scene.layout.Background)8 BackgroundFill (javafx.scene.layout.BackgroundFill)8