container.getChildren().add(new Label("Selection Path...")); container.setAlignment(Pos.CENTER_LEFT); container.widthProperty().addListener(observable -> setHvalue(getHmax())); setContent(container); setPannable(true);
HBox buttonLayout = new HBox(); buttonLayout.getChildren().add(button1); buttonLayout.getChildren().add(button1); HBox.setHgrow(button1, Priority.ALWAYS); HBox.setHgrow(button2, Priority.ALWAYS); int btnCount = buttonLayout.getChildren().size(); button1.prefWidthProperty().bind(buttonLayout.widthProperty().divide(btnCount)); button2.prefWidthProperty().bind(buttonLayout.widthProperty().divide(btnCount));
public static HBox horizontalViewActions(AbstractViewController controller, VLViewComponentXML actionsConfiguration, OperationData forModel) { HBox box = new HBox(); if(!AbstractApplicationRunner.isDesktop()) { NodeHelper.setHgrow(box); box.widthProperty().addListener(new ChangeListener<Number>() { @Override public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) { double d = newValue.doubleValue() / box.getChildren().size(); for(Node node: box.getChildren()) { ReflectionUIUtils.setPrefWidth(node, d); } }}); } box.getStyleClass().add("ep-view-actions-container"); NodeHelper.setStyleClass(box, actionsConfiguration, "styleClass", true); List<Node> actionPresenters = process(controller, actionsConfiguration, forModel); for(Node n : actionPresenters) { box.getChildren().add(n); if(!AbstractApplicationRunner.isDesktop()) { NodeHelper.setHgrow(n); } } return box; }
msgArea.prefWidthProperty().bind(msgBox.widthProperty().subtract(sendButton.widthProperty())); msgArea.addEventFilter(KeyEvent.KEY_PRESSED, e -> { if (e.getCode().equals(KeyCode.ENTER)) {
navigationBar.getChildren().addAll(back, action, next); navigationBar.setLayoutX((CloseButtonDialog.WIDTH - navigationBar.getWidth()) / 2); navigationBar.widthProperty().addListener((observable, oldWidth, newWidth) -> navigationBar.setLayoutX((CloseButtonDialog.WIDTH - newWidth.doubleValue()) / 2)); navigationBar.setLayoutY(CLOSE_BTN_Y_POS - 64);
rect.widthProperty().bind(hBox.widthProperty().subtract(20));
dataPane.prefWidthProperty().bind(hbox.widthProperty());
container.getChildren().add(new Label("Selection Path...")); container.setAlignment(Pos.CENTER_LEFT); container.widthProperty().addListener(observable -> setHvalue(getHmax())); setContent(container); setPannable(true);