public void setControl(Control control) { maxWidthProperty().bind(control.maxWidthProperty()); prefWidthProperty().bind(control.prefWidthProperty()); prefHeightProperty().bind(control.prefHeightProperty()); errorContainer.setMaxWidth(control.getMaxWidth() > -1 ? control.getMaxWidth() : control.getPrefWidth()); errorContainer.prefWidthProperty().bind(control.widthProperty()); errorContainer.prefHeightProperty().bind(control.heightProperty()); getChildren().clear(); getChildren().add(control); getChildren().add(errorContainer); this.controlProperty.set(control); }
sizeSlider.getStyleClass().add("svg-slider"); HBox sizeControl = new HBox(5, sizeLabel, sizeSlider); sizeControl.prefWidthProperty().bind(colorPicker.widthProperty());
/** * @return */ public static Node headerVerticalSeparator() { final HBox box = new HBox(); box.setStyle("-fx-background-color:white;-fx-opacity:0.70"); box.minHeightProperty().bind(box.prefHeightProperty()); box.maxHeightProperty().bind(box.prefHeightProperty()); box.minWidthProperty().bind(box.prefWidthProperty()); box.maxWidthProperty().bind(box.prefWidthProperty()); box.setPrefWidth(2); box.setPrefHeight(30); // translate the box because the toolbar is top right aligned // we can not align the toolbar center, too complex to handle!!! box.setTranslateY(-2); return box; }
/** * Constructor */ public HeaderLeftToolBar() { super(); minWidthProperty().bind(prefWidthProperty()); maxWidthProperty().bind(prefWidthProperty()); getStyleClass().add(EP_HEADER_LEFT_TOOLBAR); getChildren().addAll(topToolbar, bottomToolbar); NodeHelper.setVgrow(topToolbar, bottomToolbar); topToolbar.minWidthProperty().bind(topToolbar.prefWidthProperty()); topToolbar.maxWidthProperty().bind(topToolbar.prefWidthProperty()); topToolbar.minHeightProperty().bind(topToolbar.prefHeightProperty()); topToolbar.maxHeightProperty().bind(topToolbar.prefHeightProperty()); bottomToolbar.minWidthProperty().bind(bottomToolbar.prefWidthProperty()); bottomToolbar.maxWidthProperty().bind(bottomToolbar.prefWidthProperty()); bottomToolbar.minHeightProperty().bind(bottomToolbar.prefHeightProperty()); bottomToolbar.maxHeightProperty().bind(bottomToolbar.prefHeightProperty()); }
@Override public void buildFrom(IEmaginController controller, VLViewComponentXML configuration) { super.buildFrom(controller, configuration); leftTabItemsContainer.setVisible(false); rightTabItemsContainer.setVisible(false); leftTabItemsContainer.setManaged(false); rightTabItemsContainer.setManaged(false); centerTabItemsContainer.prefWidthProperty().bind(tabItemsContainer.prefWidthProperty().multiply(0.9)); // todo handle with max according to running platform if(ViewStructure.instance().platformSceneWidth().get() > 100) { double w = ViewStructure.instance().platformSceneWidth().get(); updateTabsSize(); } ViewStructure.instance().platformSceneWidth().addListener(new ChangeListener<Number>() { @Override public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) { updateTabsSize(); }}); }
ToolBar tb = new ToolBar(); TextField tf = new TextField(); HBox hbox = new HBox(8); hbox.prefWidthProperty().bind(tb.widthProperty().subtract(20)); HBox.setHgrow(tf, Priority.ALWAYS); hbox.getChildren().add(new Button("<-")); hbox.getChildren().add(new Button("->")); hbox.getChildren().add(tf); tb.getItems().add(hbox);
/** * Constructor */ public HeaderCenterToolBar() { super(); minWidthProperty().bind(prefWidthProperty()); maxWidthProperty().bind(prefWidthProperty()); getChildren().addAll(topToolbar, bottomToolbar); NodeHelper.setVgrow(topToolbar, bottomToolbar); topToolbar.minWidthProperty().bind(topToolbar.prefWidthProperty()); topToolbar.maxWidthProperty().bind(topToolbar.prefWidthProperty()); topToolbar.minHeightProperty().bind(topToolbar.prefHeightProperty()); topToolbar.maxHeightProperty().bind(topToolbar.prefHeightProperty()); bottomToolbar.minWidthProperty().bind(bottomToolbar.prefWidthProperty()); bottomToolbar.maxWidthProperty().bind(bottomToolbar.prefWidthProperty()); bottomToolbar.minHeightProperty().bind(bottomToolbar.prefHeightProperty()); bottomToolbar.maxHeightProperty().bind(bottomToolbar.prefHeightProperty()); bottomToolbar.managedProperty().bind(bottomToolbar.visibleProperty()); bottomToolbar.setVisible(false); }
public void setControl(Control control) { maxWidthProperty().bind(control.maxWidthProperty()); prefWidthProperty().bind(control.prefWidthProperty()); prefHeightProperty().bind(control.prefHeightProperty()); errorContainer.setMaxWidth(control.getMaxWidth() > -1 ? control.getMaxWidth() : control.getPrefWidth()); errorContainer.prefWidthProperty().bind(control.widthProperty()); errorContainer.prefHeightProperty().bind(control.heightProperty()); getChildren().clear(); getChildren().add(control); getChildren().add(errorContainer); this.controlProperty.set(control); }
/** * Constructor */ public SingleLocationPrimaryMenuWithNavigationBar() { super(); IconUtils.setHeaderNavigationBack(backIcon); backIcon.setOnAction(e -> goBack()); backIcon.getStyleClass().remove("jfx-button"); backIcon.getStyleClass().remove("button"); backIcon.managedProperty().bind(backIcon.visibleProperty()); backIcon.setVisible(false); final HBox box = NodeHelper.wrapInHbox(backIcon); box.getStyleClass().add("ep-navbar-top-toolbar-back-icon-container"); topToolbar.getChildren().addAll(box, locationContainer); getChildren().addAll(topToolbar, bottomToolbar); topToolbar.getStyleClass().add("ep-primary-menu-with-navbar-top-toolbar"); bottomToolbar.getStyleClass().add("ep-primary-menu-with-navbar-bottom-toolbar"); getStyleClass().add("ep-primary-menu-with-navbar-toolbar"); // location0.getStyleClass().add("current-location-item-label"); topToolbar.minWidthProperty().bind(topToolbar.prefWidthProperty()); topToolbar.minHeightProperty().bind(topToolbar.prefHeightProperty()); topToolbar.maxHeightProperty().bind(topToolbar.prefHeightProperty()); bottomToolbar.minWidthProperty().bind(bottomToolbar.prefWidthProperty()); bottomToolbar.minHeightProperty().bind(bottomToolbar.prefHeightProperty()); bottomToolbar.maxHeightProperty().bind(bottomToolbar.prefHeightProperty()); bottomToolbar.managedProperty().bind(bottomToolbar.visibleProperty()); NodeHelper.setHVGrow(topToolbar, bottomToolbar, this); bottomToolbar.setVisible(false); }
/** * Constructor */ public PrimaryMenuWithNavigationBar() { super(); IconUtils.setHeaderNavigationBack(backIcon); backIcon.setOnAction(e -> goBack()); backIcon.getStyleClass().addAll("app-header-button", "hand-hover"); backIcon.managedProperty().bind(backIcon.visibleProperty()); // TO DO HANDLE PREVIOUS AND CURRENT previousLocation.managedProperty().bind(previousLocation.visibleProperty()); previousLocation.setVisible(false); topToolbar.getChildren().addAll(backIcon, currentLocation); bottomToolbar.getChildren().add(previousLocation); getChildren().addAll(topToolbar, bottomToolbar); topToolbar.getStyleClass().add("ep-primary-menu-with-navbar-top-toolbar"); bottomToolbar.getStyleClass().add("ep-primary-menu-with-navbar-bottom-toolbar"); getStyleClass().add("ep-primary-menu-with-navbar-toolbar"); topToolbar.minWidthProperty().bind(topToolbar.prefWidthProperty()); // topToolbar.maxWidthProperty().bind(topToolbar.prefWidthProperty()); topToolbar.minHeightProperty().bind(topToolbar.prefHeightProperty()); topToolbar.maxHeightProperty().bind(topToolbar.prefHeightProperty()); bottomToolbar.minWidthProperty().bind(bottomToolbar.prefWidthProperty()); // bottomToolbar.maxWidthProperty().bind(bottomToolbar.prefWidthProperty()); bottomToolbar.minHeightProperty().bind(bottomToolbar.prefHeightProperty()); bottomToolbar.maxHeightProperty().bind(bottomToolbar.prefHeightProperty()); bottomToolbar.managedProperty().bind(bottomToolbar.visibleProperty()); NodeHelper.setHVGrow(topToolbar, bottomToolbar, this); bottomToolbar.setVisible(false); }
leftBox.prefWidthProperty().bind(widthProperty());