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;
}
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();
}
}
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);
}
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);
}
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);
}
Aggregations