modules/javafx.controls/src/main/java/javafx/scene/control/skin/CheckBoxSkin.java

Print this page

        

*** 109,130 **** } } /** {@inheritDoc} */ @Override protected double computeMinWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset) { ! return super.computeMinWidth(height, topInset, rightInset, bottomInset, leftInset) + snapSize(box.minWidth(-1)); } /** {@inheritDoc} */ @Override protected double computeMinHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset) { return Math.max(super.computeMinHeight(width - box.minWidth(-1), topInset, rightInset, bottomInset, leftInset), topInset + box.minHeight(-1) + bottomInset); } /** {@inheritDoc} */ @Override protected double computePrefWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset) { ! return super.computePrefWidth(height, topInset, rightInset, bottomInset, leftInset) + snapSize(box.prefWidth(-1)); } /** {@inheritDoc} */ @Override protected double computePrefHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset) { return Math.max(super.computePrefHeight(width - box.prefWidth(-1), topInset, rightInset, bottomInset, leftInset), --- 109,130 ---- } } /** {@inheritDoc} */ @Override protected double computeMinWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset) { ! return super.computeMinWidth(height, topInset, rightInset, bottomInset, leftInset) + snapSizeX(box.minWidth(-1)); } /** {@inheritDoc} */ @Override protected double computeMinHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset) { return Math.max(super.computeMinHeight(width - box.minWidth(-1), topInset, rightInset, bottomInset, leftInset), topInset + box.minHeight(-1) + bottomInset); } /** {@inheritDoc} */ @Override protected double computePrefWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset) { ! return super.computePrefWidth(height, topInset, rightInset, bottomInset, leftInset) + snapSizeX(box.prefWidth(-1)); } /** {@inheritDoc} */ @Override protected double computePrefHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset) { return Math.max(super.computePrefHeight(width - box.prefWidth(-1), topInset, rightInset, bottomInset, leftInset),
*** 133,146 **** /** {@inheritDoc} */ @Override protected void layoutChildren(final double x, final double y, final double w, final double h) { final CheckBox checkBox = getSkinnable(); ! final double boxWidth = snapSize(box.prefWidth(-1)); ! final double boxHeight = snapSize(box.prefHeight(-1)); final double computeWidth = Math.max(checkBox.prefWidth(-1), checkBox.minWidth(-1)); ! final double labelWidth = Math.min( computeWidth - boxWidth, w - snapSize(boxWidth)); final double labelHeight = Math.min(checkBox.prefHeight(labelWidth), h); final double maxHeight = Math.max(boxHeight, labelHeight); final double xOffset = Utils.computeXOffset(w, labelWidth + boxWidth, checkBox.getAlignment().getHpos()) + x; final double yOffset = Utils.computeYOffset(h, maxHeight, checkBox.getAlignment().getVpos()) + x; --- 133,146 ---- /** {@inheritDoc} */ @Override protected void layoutChildren(final double x, final double y, final double w, final double h) { final CheckBox checkBox = getSkinnable(); ! final double boxWidth = snapSizeX(box.prefWidth(-1)); ! final double boxHeight = snapSizeY(box.prefHeight(-1)); final double computeWidth = Math.max(checkBox.prefWidth(-1), checkBox.minWidth(-1)); ! final double labelWidth = Math.min( computeWidth - boxWidth, w - snapSizeX(boxWidth)); final double labelHeight = Math.min(checkBox.prefHeight(labelWidth), h); final double maxHeight = Math.max(boxHeight, labelHeight); final double xOffset = Utils.computeXOffset(w, labelWidth + boxWidth, checkBox.getAlignment().getHpos()) + x; final double yOffset = Utils.computeYOffset(h, maxHeight, checkBox.getAlignment().getVpos()) + x;