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); }
getClip().layoutXProperty() .bind(Bindings.createDoubleBinding(() -> newVal.getLayoutX() + newVal.getWidth() / 2, newVal.widthProperty(), newVal.layoutXProperty())); getClip().layoutYProperty() newVal.widthProperty().addListener((o1, oldVal1, newVal1) -> updateToggleAnimation()); newVal.heightProperty().addListener((o1, oldVal1, newVal1) -> updateToggleAnimation()); newVal.setOnMouseClicked((click) -> togglePane());
/** * Create an element that will layout the <code>childNode</code> * at the right dialog content border. * @param childNode that should be right aligned. * @return wrapping Pane */ public Pane right(Control childNode) { final int width = IDialog.WRAPPING_WIDTH - 24; Pane g = new Pane(childNode); childNode.widthProperty().addListener((observable, oldValue, newValue) -> { double inset = (width - childNode.getWidth()); g.setLayoutX(inset); }); return g; }
/** * Create an element that will layout the <code>childNode</code> * horizontally centered within a Dialog. * @param childNode that should be centered * @return wrapping Pane */ public Pane center(Control childNode) { final int width = IDialog.WRAPPING_WIDTH - 24; Pane g = new Pane(childNode); childNode.widthProperty().addListener((observable, oldValue, newValue) -> { double inset = (width - childNode.getWidth())/2; g.setLayoutX(inset); }); return g; } /**
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); }
this.icon.layoutXProperty().bind(Bindings.createDoubleBinding(() -> { return Double.valueOf(c.getWidth() - this.icon.widthProperty().get() / 2); },this.icon.widthProperty(), c.widthProperty())); this.icon.layoutYProperty().bind(this.icon.heightProperty().divide(-2)); } else if( location == Location.BOTTOM_LEFT ) { this.icon.layoutXProperty().bind(Bindings.createDoubleBinding(() -> { return Double.valueOf(c.getWidth() - this.icon.widthProperty().get() / 2); },this.icon.widthProperty(), c.widthProperty())); this.icon.layoutYProperty().bind(Bindings.createDoubleBinding(() -> { return Double.valueOf(c.getHeight() - this.icon.heightProperty().get() / 2);
getClip().layoutXProperty() .bind(Bindings.createDoubleBinding(() -> newVal.getLayoutX() + newVal.getWidth() / 2, newVal.widthProperty(), newVal.layoutXProperty())); getClip().layoutYProperty() newVal.widthProperty().addListener((o1, oldVal1, newVal1) -> updateToggleAnimation()); newVal.heightProperty().addListener((o1, oldVal1, newVal1) -> updateToggleAnimation()); newVal.setOnMouseClicked((click) -> togglePane());