@Override protected double computePrefWidth(double height) { return control.prefWidth(height); }
@Override protected double computePrefWidth(double height) { if (!getChildren().isEmpty()) { return getChildren().get(0).prefWidth(height); } return super.computePrefWidth(height); }
@Override protected double computePrefWidth(double height) { double width = 0.0F; for (Node child : getChildren()) { if (child instanceof TabHeaderContainer && child.isVisible() && (measureClosingTabs || !((TabHeaderContainer) child).isClosing)) { width += child.prefWidth(height); } } return snapSize(width) + snappedLeftInset() + snappedRightInset(); }
private void updateScrollOffset(double newOffset) { double tabPaneWidth = snapSize(isHorizontal() ? getSkinnable().getWidth() : getSkinnable().getHeight()); double controlTabWidth = 2 * snapSize(rightControlButton.getWidth()); double visibleWidth = tabPaneWidth - controlTabWidth - snappedLeftInset() - SPACER; // compute all tabs headers width double offset = 0.0; for (Node node : headersRegion.getChildren()) { if (node instanceof TabHeaderContainer) { double tabHeaderPrefWidth = snapSize(node.prefWidth(-1)); offset += tabHeaderPrefWidth; } } double actualOffset = newOffset; if ((visibleWidth - newOffset) > offset && newOffset < 0) { actualOffset = visibleWidth - offset; } else if (newOffset > 0) { actualOffset = 0; } if (actualOffset != scrollOffset) { scrollOffset = actualOffset; headersRegion.requestLayout(); if (!isAnimating()) { selectedTabLine.setTranslateX(selectedTabLineOffset + scrollOffset * direction); } } }
@Override protected double computePrefWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset) { return content == null ? 0 : content.prefWidth(height); };
@Override protected double computePrefWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset) { double insets = leftInset + rightInset; return insets + (content == null ? 0 : content.prefWidth(height)); }
@Override public double prefBreadth(Node node) { return node.prefWidth(-1); }
@Override protected double computePrefWidth(double height) { return control.prefWidth(height); }
double getGraphicPrefWidth() { if(graphic.isPresent()) { return graphic.getValue().prefWidth(-1); } else { return 0.0; } }
private double calculateNodeWidth(Node n, MinPrefMax size) { if (size == MinPrefMax.MIN) { return n.minWidth(-1); } if (size == MinPrefMax.MAX) { return n.maxWidth(-1); } return n.prefWidth(-1); }
protected double computePrefWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset) { double prefWidth; if (getSkinnable().getOrientation() == Orientation.VERTICAL) prefWidth = biggest(n -> n.prefWidth(height)) + leftInset + rightInset; else prefWidth = acc(n -> n.prefWidth(height)) + leftInset + rightInset; return Math.max(prefWidth, getSkinnable().getPrefWidth()); }
@Override protected double computePrefWidth(double height) { boolean isDefault = true; double pw = 0; for (ButtonType buttonType : getDialogPane().getButtonTypes()) { Button button = (Button) getDialogPane().lookupButton(buttonType); double buttonPrefWidth = button.getGraphic().prefWidth(-1); if (isDefault) { pw = buttonPrefWidth; isDefault = false; } else { pw = Math.min(pw, buttonPrefWidth); } } return pw + gapSize; }
@Override protected double computePrefWidth(double height) { double width = 0.0F; for (Node child : getChildren()) { if (child instanceof TabHeaderContainer && child.isVisible() && (measureClosingTabs || !((TabHeaderContainer) child).isClosing)) { width += child.prefWidth(height); } } return snapSize(width) + snappedLeftInset() + snappedRightInset(); }
@Override protected double computePrefWidth(double width, double topInset, double rightInset, double bottomInset, double leftInset) { if (getSkinnable().getOrientation().equals(Orientation.VERTICAL)) { OptionalDouble maxWidth = getChildren().stream().mapToDouble(node -> node.prefWidth(-1)).max(); if (maxWidth.isPresent()) { return maxWidth.getAsDouble(); } } return getSkinnable().getPrefWidth(); }
@Override protected double computePrefWidth(double height) { if (!getChildren().isEmpty()) { return getChildren().get(0).prefWidth(height); } return super.computePrefWidth(height); }
protected double computePrefWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset) { double w = text.prefWidth(height); if (getSkinnable().getGraphic() != null && iconPosition().isVertical()) w += Math.max(getSkinnable().getGraphic().prefWidth(-1), graphicFixedSize()); return w + leftInset + rightInset; }
private static Size computeSize(@NonNull Node control, boolean flushCache) { int wHint = FX_DEFAULT, hHint = FX_DEFAULT; RowData data = getConstraint(control); if (data != null) { wHint = data.getWidth(); hHint = data.getHeight(); } return new Size(control.prefWidth(wHint), control.prefHeight(hHint)); }
private static Size computeSize(@NonNull Node control, boolean flushCache) { int wHint = FX_DEFAULT, hHint = FX_DEFAULT; RowData data = getConstraint(control); if (data != null) { wHint = data.getWidth(); hHint = data.getHeight(); } return new Size(control.prefWidth(wHint), control.prefHeight(hHint)); }
protected void layoutChildren(double x, double y, double w, double h) { for (Node node : getChildren()) { if (getSkinnable().getOrientation() == Orientation.VERTICAL) { double prefHeight = node.prefHeight(-1); node.resizeRelocate(x, y, w, prefHeight); y += prefHeight; } else { double prefWidth = node.prefWidth(-1); node.resizeRelocate(x, y, prefWidth, h); x += prefWidth; } } }
for (Data<X, Y> horizontalMarker : horizontalMarkers) { Line line = (Line) horizontalMarker.getNode(); line.setStartX(0); line.setEndX(getBoundsInLocal().getWidth()); line.setStartY(getYAxis().getDisplayPosition(horizontalMarker.getYValue()) + 0.5); // 0.5 for crispness line.setEndY(line.getStartY()); line.toFront(); Node text = nodeMap.get(line); text.relocate(line.getBoundsInParent().getMinX() + line.getBoundsInParent().getWidth()/2 - text.prefWidth(-1) / 2, line.getBoundsInParent().getMinY() - 30); }