@Override protected void layoutChildren() { performingLayout = true; List<Node> managed = getManagedChildren(); final double width = getWidth(); double height = getHeight(); double top = getInsets().getTop(); double right = getInsets().getRight(); double left = getInsets().getLeft(); double bottom = getInsets().getBottom(); double contentWidth = width - left - right; double contentHeight = height - top - bottom; for (int i = 0, size = managed.size(); i < size; i++) { Node child = managed.get(i); layoutInArea(child, left, top, contentWidth, contentHeight, 0, Insets.EMPTY, HPos.CENTER, VPos.CENTER); } performingLayout = false; }
@Override protected double computePrefWidth(double height) { final int nCols = daysPerWeek + (datePicker.isShowWeekNumbers() ? 1 : 0); final double leftSpace = snapSpace(getInsets().getLeft()); final double rightSpace = snapSpace(getInsets().getRight()); final double hgaps = snapSpace(getHgap()) * (nCols - 1); // compute content width final double contentWidth = super.computePrefWidth(height) - leftSpace - rightSpace - hgaps; return ((snapSize(contentWidth / nCols)) * nCols) + leftSpace + rightSpace + hgaps; }
@Override protected void layoutChildren() { performingLayout = true; List<Node> managed = getManagedChildren(); final double width = getWidth(); double height = getHeight(); double top = getInsets().getTop(); double right = getInsets().getRight(); double left = getInsets().getLeft(); double bottom = getInsets().getBottom(); double contentWidth = width - left - right; double contentHeight = height - top - bottom; for (Node child : managed) { layoutInArea(child, left, top, contentWidth, contentHeight, 0, Insets.EMPTY, HPos.CENTER, VPos.CENTER); } performingLayout = false; }
private int getHorIns() { Insets insets = getInsets(); return (int) Math.ceil(snapSpace(insets.getLeft()) + snapSpace(insets.getRight())); }
@Override protected void layoutChildren() { Insets ins = getInsets(); double w = getWidth() - ins.getLeft() - ins.getRight(); double h = getHeight() - ins.getTop() - ins.getBottom(); double graphicWidth = getGraphicPrefWidth(); text.resizeRelocate(graphicWidth + ins.getLeft(), ins.getTop(), w - graphicWidth, h); graphic.ifPresent(g -> g.resizeRelocate(graphicOffset.get() + ins.getLeft(), ins.getTop(), graphicWidth, h)); }
@Override protected void layoutChildren() { if (progressBar != null) { Insets insets = getInsets(); double w = getWidth() - insets.getLeft() - insets.getRight(); double h = getHeight() - insets.getTop() - insets.getBottom(); double prefH = progressBar.prefHeight(-1); double x = insets.getLeft() + (w - w) / 2.0; double y = insets.getTop() + (h - prefH) / 2.0; progressBar.resizeRelocate(x, y, w, prefH); } } }
@Override public String getAsText() { if (null == getValue()) return null; Insets i = (Insets) getValue(); return i.getTop() + ", " + i.getRight() + ", " + i.getBottom() + ", " + i.getLeft(); }
@Override protected double computePrefWidth(double ignoredHeight) { Insets insets = getInsets(); return wrapText.get() ? 0 // return 0, VirtualFlow will size it to its width anyway : getGraphicPrefWidth() + text.prefWidth(-1) + insets.getLeft() + insets.getRight(); }
@Override protected double computeMinWidth(double width, double topInset, double rightInset, double bottomInset, double leftInset) { double result = root.minWidth(width); double minWidth = Math.max(titleBar.minWidth(width), control.getContentPane().minWidth(width) + getSkinnable().getInsets().getLeft() + getSkinnable().getInsets().getRight()); result = Math.max(result, minWidth); return result; }
public double computeMinWidth() { double result = root.minWidth(-1); double minWidth = Math.max(titleBar.minWidth(-1), control.getContentPane().minWidth(-1) + getSkinnable().getInsets().getLeft() + getSkinnable().getInsets().getRight()); result = Math.max(result, minWidth); return result; }
@Override protected double computePrefHeight(double width) { Insets insets = getInsets(); double overhead = getGraphicPrefWidth() - insets.getLeft() - insets.getRight(); return text.prefHeight(width - overhead) + insets.getTop() + insets.getBottom(); }
public CharacterHit hit(double x, double y) { Point2D onScreen = this.localToScreen(x, y); Point2D inText = text.screenToLocal(onScreen); Insets textInsets = text.getInsets(); return text.hit(inText.getX() - textInsets.getLeft(), inText.getY() - textInsets.getTop()); }
@Override protected double computePrefWidth(double height) { final int nCols = daysPerWeek + (datePicker.isShowWeekNumbers() ? 1 : 0); final double leftSpace = snapSpace(getInsets().getLeft()); final double rightSpace = snapSpace(getInsets().getRight()); final double hgaps = snapSpace(getHgap()) * (nCols - 1); // compute content width final double contentWidth = super.computePrefWidth(height) - leftSpace - rightSpace - hgaps; return ((snapSize(contentWidth / nCols)) * nCols) + leftSpace + rightSpace + hgaps; }
@Override protected void layoutChildren(double x, double y, double w, double h) { double x1 = getSkinnable().getInsets().getLeft(); double y1 = getSkinnable().getInsets().getTop(); double w1 = getSkinnable().getWidth() - (getSkinnable().getInsets().getLeft() + getSkinnable().getInsets().getRight()); double h1 = getSkinnable().getHeight() - (getSkinnable().getInsets().getTop() + getSkinnable().getInsets().getBottom()); flow.resizeRelocate(x1, y1, w1, h1); }
@Override protected void layoutChildren() { super.layoutChildren(); Insets pad = getPadding(); double width = getWidth() * this.leftRightRatio; double height = getHeight() - (pad.getTop() + pad.getBottom()); this.left.resizeRelocate(pad.getLeft(), pad.getTop(), width, height); this.right.resizeRelocate(getWidth() - pad.getRight() - width, pad.getTop(), width, height); this.top.resizeRelocate(this.left.getLayoutX() + this.left.getWidth(), this.left.getLayoutY(), getWidth() - width * 2, height / 2); this.bottom.resizeRelocate(this.left.getLayoutX() + this.left.getWidth(), this.top.getLayoutY() + this.top.getHeight(), getWidth() - width * 2, height / 2); } }
@Override protected void layoutChildren() { super.layoutChildren(); Insets pad = getPadding(); double width = getWidth() * this.leftRightRatio; double height = getHeight() - (pad.getTop() + pad.getBottom()); this.left.resizeRelocate(pad.getLeft(), pad.getTop(), width, height); this.right.resizeRelocate(getWidth() - pad.getRight() - width, pad.getTop(), width, height); this.top.resizeRelocate(this.left.getLayoutX() + this.left.getWidth(), this.left.getLayoutY(), getWidth() - width * 2, height / 2); this.bottom.resizeRelocate(this.left.getLayoutX() + this.left.getWidth(), this.top.getLayoutY() + this.top.getHeight(), getWidth() - width * 2, height / 2); } }
@Override protected void layoutChildren() { super.layoutChildren(); leftIconPane.resizeRelocate(getInsets().getLeft(), getInsets().getTop(), leftIconPane.prefWidth(USE_PREF_SIZE), getHeight() - getInsets().getTop() - getInsets().getBottom()); rightIconPane.resize(rightIconPane.prefWidth(USE_PREF_SIZE), getHeight() - getInsets().getTop() - getInsets().getBottom()); rightIconPane.relocate(getWidth() - rightIconPane.getWidth() - getInsets().getRight(), getInsets().getTop()); }
@Override protected void layoutChildren() { super.layoutChildren(); leftIconPane.resizeRelocate(getInsets().getLeft(), getInsets().getTop(), leftIconPane.prefWidth(USE_PREF_SIZE), getHeight() - getInsets().getTop() - getInsets().getBottom()); rightIconPane.resize(rightIconPane.prefWidth(USE_PREF_SIZE), getHeight() - getInsets().getTop() - getInsets().getBottom()); rightIconPane.relocate(getWidth() - rightIconPane.getWidth() - getInsets().getRight(), getInsets().getTop()); }
@Override protected void layoutChildren() { super.layoutChildren(); leftIconPane.resizeRelocate(getInsets().getLeft(), getInsets().getTop(), leftIconPane.prefWidth(USE_PREF_SIZE), getHeight() - getInsets().getTop() - getInsets().getBottom()); rightIconPane.resize(rightIconPane.prefWidth(USE_PREF_SIZE), getHeight() - getInsets().getTop() - getInsets().getBottom()); rightIconPane.relocate(getWidth() - rightIconPane.getWidth() - getInsets().getRight(), getInsets().getTop()); }