getClip().layoutYProperty().unbind(); getClip().layoutXProperty() .bind(Bindings.createDoubleBinding(() -> newVal.getLayoutX() + newVal.getWidth() / 2, newVal.widthProperty(), newVal.layoutXProperty()));
/** * 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; } /**
/** * 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; }
} else if( location == Location.TOP_RIGHT ) { 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_RIGHT ) { 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(() -> {
getClip().layoutYProperty().unbind(); getClip().layoutXProperty() .bind(Bindings.createDoubleBinding(() -> newVal.getLayoutX() + newVal.getWidth() / 2, newVal.widthProperty(), newVal.layoutXProperty()));