private double computeErrorHeight(double errorContainerWidth) { return errorLabel.prefHeight(errorContainerWidth) + snappedBottomInset() + snappedTopInset(); }
@Override protected double computePrefHeight(double width) { double minHeight = snapSize(getSkinnable().getTabMinHeight()); double maxHeight = snapSize(getSkinnable().getTabMaxHeight()); double paddingTop = snappedTopInset(); double paddingBottom = snappedBottomInset(); double tmpPrefHeight = snapSize(tabLabel.prefHeight(width)); if (tmpPrefHeight > maxHeight) { tmpPrefHeight = maxHeight; } else if (tmpPrefHeight < minHeight) { tmpPrefHeight = minHeight; } tmpPrefHeight += paddingTop + paddingBottom; return tmpPrefHeight; }
@SuppressWarnings("MethodDoesntCallSuperMethod") @Override protected double computePrefHeight(double width) { return label.prefHeight(width) + 6; } }
@Override protected double computePrefHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset) { return topInset + Math.max(thumb.prefHeight(-1), label.prefHeight(-1)) + bottomInset; }
@Override protected double computeMinHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset) { return topInset + Math.max(thumb.prefHeight(-1), label.prefHeight(-1)) + bottomInset; }
private double computeErrorHeight(double errorContainerWidth) { return errorLabel.prefHeight(errorContainerWidth) + snappedBottomInset() + snappedTopInset(); }
final double labelHeight = titleLabel.prefHeight(-1); final double labelWidth = titleLabel.prefWidth(labelHeight) + TITLE_PADDING; titleLabel.resize(labelWidth, labelHeight);
@Override protected double computePrefHeight(double width) { double minHeight = snapSize(getSkinnable().getTabMinHeight()); double maxHeight = snapSize(getSkinnable().getTabMaxHeight()); double paddingTop = snappedTopInset(); double paddingBottom = snappedBottomInset(); double tmpPrefHeight = snapSize(tabLabel.prefHeight(width)); if (tmpPrefHeight > maxHeight) { tmpPrefHeight = maxHeight; } else if (tmpPrefHeight < minHeight) { tmpPrefHeight = minHeight; } tmpPrefHeight += paddingTop + paddingBottom; return tmpPrefHeight; }
@SuppressWarnings("MethodDoesntCallSuperMethod") @Override protected void layoutChildren() { double width = getWidth(); double height = getHeight(); double labelPrefWidth = label.prefWidth(height); double labelPrefHeight = label.prefHeight(width); rectangle.setX(0); rectangle.setY(0); rectangle.setWidth(labelPrefWidth + 10); rectangle.setHeight(labelPrefHeight + 6); label.resizeRelocate(5, 3, labelPrefWidth, labelPrefHeight); line.setStartX(width / 2.0); line.setEndX(line.getStartX()); line.setStartY(rectangle.getHeight()); line.setEndY(height); }
@Override protected void layoutChildren(double contentX, double contentY, double contentWidth, double contentHeight) { final double contentPrefHeight = content.prefHeight(contentWidth); // we calculate the pref width of the expand/collapse button. We will // ensure that the button does not get smaller than this. final double toggleButtonPrefWidth = expandCollapseButton.prefWidth(-1); expandCollapseButton.setMinWidth(toggleButtonPrefWidth); // All remaining width goes to the info label final Insets infoPanelPadding = infoPanel.getPadding(); final double infoLabelWidth = snapSize(contentWidth - toggleButtonPrefWidth - infoPanelPadding.getLeft() - infoPanelPadding.getRight()); // we then can work out the necessary height for the info panel, based on // whether it is expanded or not, and given the current state of the animation. final double prefInfoPanelHeight = (snapSize(infoLabel.prefHeight(infoLabelWidth)) + snapSpace(infoPanel.getPadding().getTop()) + snapSpace(infoPanel.getPadding().getBottom())) * transition.get(); infoLabel.setMaxWidth(infoLabelWidth); infoLabel.setMaxHeight(prefInfoPanelHeight); // position the imageView layoutInArea(content, contentX, contentY, contentWidth, contentHeight, -1, HPos.CENTER, VPos.TOP); // position the infoPanel (the HBox consisting of the Label and ToggleButton) layoutInArea(infoPanel, contentX, snapPosition(contentPrefHeight - prefInfoPanelHeight), contentWidth, prefInfoPanelHeight, 0, HPos.CENTER, VPos.BOTTOM); }