@Override protected double computePrefHeight(double width) { double h = 0; for (Node child : getChildren()) { if (child instanceof Region) { Region region = (Region) child; if (region.getShape() != null) { h = Math.max(h, region.getShape().getLayoutBounds().getMaxY()); } else { h = Math.max(h, region.prefHeight(width)); } } } return h; }
@Override protected double computePrefWidth(double height) { double w = 0; for (Node child : getChildren()) { if (child instanceof Region) { Region region = (Region) child; if (region.getShape() != null) { w = Math.max(w, region.getShape().getLayoutBounds().getMaxX()); } else { w = Math.max(w, region.prefWidth(height)); } } } return w; }
@Override protected double computePrefHeight(double width) { final Insets controlInsets = control.getInsets(); final double top = snapSize(controlInsets.getTop()); final double bottom = snapSize(controlInsets.getBottom()); final Insets indicatorInsets = indicator.getInsets(); final double iLeft = snapSize(indicatorInsets.getLeft()); final double iRight = snapSize(indicatorInsets.getRight()); final double iTop = snapSize(indicatorInsets.getTop()); final double iBottom = snapSize(indicatorInsets.getBottom()); final double indicatorMax = snapSize(Math.max(Math.max(iLeft, iRight), Math.max(iTop, iBottom))); final Insets progressInsets = progress.getInsets(); final double pLeft = snapSize(progressInsets.getLeft()); final double pRight = snapSize(progressInsets.getRight()); final double pTop = snapSize(progressInsets.getTop()); final double pBottom = snapSize(progressInsets.getBottom()); final double progressMax = snapSize(Math.max(Math.max(pLeft, pRight), Math.max(pTop, pBottom))); final Insets tickInsets = tick.getInsets(); final double tTop = snapSize(tickInsets.getTop()); final double tBottom = snapSize(tickInsets.getBottom()); final double indicatorHeight = indicatorMax + progressMax + tTop + tBottom + progressMax + indicatorMax; return top + indicatorHeight /*+ textGap + doneText.getLayoutBounds().getHeight()*/ + bottom; }
@Override protected double computePrefWidth(double height) { final Insets controlInsets = control.getInsets(); final double left = snapSize(controlInsets.getLeft()); final double right = snapSize(controlInsets.getRight()); final Insets indicatorInsets = indicator.getInsets(); final double iLeft = snapSize(indicatorInsets.getLeft()); final double iRight = snapSize(indicatorInsets.getRight()); final double iTop = snapSize(indicatorInsets.getTop()); final double iBottom = snapSize(indicatorInsets.getBottom()); final double indicatorMax = snapSize(Math.max(Math.max(iLeft, iRight), Math.max(iTop, iBottom))); final Insets progressInsets = progress.getInsets(); final double pLeft = snapSize(progressInsets.getLeft()); final double pRight = snapSize(progressInsets.getRight()); final double pTop = snapSize(progressInsets.getTop()); final double pBottom = snapSize(progressInsets.getBottom()); final double progressMax = snapSize(Math.max(Math.max(pLeft, pRight), Math.max(pTop, pBottom))); final Insets tickInsets = tick.getInsets(); final double tLeft = snapSize(tickInsets.getLeft()); final double tRight = snapSize(tickInsets.getRight()); final double indicatorWidth = indicatorMax + progressMax + tLeft + tRight + progressMax + indicatorMax; return left + indicatorWidth + /*Math.max(indicatorWidth, doneText.getLayoutBounds().getWidth()) + */ right; }