@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 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; }
double borderWidth = ripplerPane.getBorder() != null ? ripplerPane.getBorder().getInsets().getTop() : 0; Bounds bounds = control.getBoundsInParent(); double width = control.getLayoutBounds().getWidth();
this.setPadding(new Insets(this.getPadding().getTop(), 0, this.getPadding().getBottom(),
box.setButtonCell(new ListCell<String>() { @Override public void updateItem(String item, boolean empty) { super.updateItem(item, empty); if (item != null) { setText(item); setAlignment(Pos.CENTER_RIGHT); Insets old = getPadding(); setPadding(new Insets(old.getTop(), 0, old.getBottom(), 0)); } } });
private int getVerIns() { Insets insets = getInsets(); return (int) Math.ceil(snapSpace(insets.getTop()) + snapSpace(insets.getBottom())); }
@Override protected double computePrefHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset) { if (isHorizontal()) { return getSkinnable().getInsets().getTop() + Math.max(lowThumb.prefHeight(-1), track.prefHeight(-1)) + ((showTickMarks) ? (trackToTickGap+tickLine.prefHeight(-1)) : 0) + bottomInset; } else { if(showTickMarks) { return Math.max(140, tickLine.prefHeight(-1)); } else { return 140; } } }
/** * Calculate the initial height of the content without content. * @return initial height of the content. */ private double calculateContentInitialHeigth() { Insets insets = contentContainer.getInsets(); double top = snapSpaceY(insets.getTop()); double bottom = snapSpaceY(insets.getBottom()); return top+bottom; } /**
@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 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()); }
@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(); }
@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); } }
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 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); }