--- old/modules/controls/src/main/java/com/sun/javafx/scene/control/ContextMenuContent.java 2016-03-28 16:16:48.000000000 -0700 +++ new/modules/controls/src/main/java/com/sun/javafx/scene/control/ContextMenuContent.java 2016-03-28 16:16:48.000000000 -0700 @@ -178,36 +178,36 @@ Node n = menuItemContainer.left; if (n != null) { if (n.getContentBias() == Orientation.VERTICAL) { // width depends on height - alt = snapSize(n.prefHeight(-1)); + alt = snapSizeY(n.prefHeight(-1)); } else alt = -1; - maxLeftWidth = Math.max(maxLeftWidth, snapSize(n.prefWidth(alt))); + maxLeftWidth = Math.max(maxLeftWidth, snapSizeX(n.prefWidth(alt))); maxRowHeight = Math.max(maxRowHeight, n.prefHeight(-1)); } n = menuItemContainer.graphic; if (n != null) { if (n.getContentBias() == Orientation.VERTICAL) { // width depends on height - alt = snapSize(n.prefHeight(-1)); + alt = snapSizeY(n.prefHeight(-1)); } else alt = -1; - maxGraphicWidth = Math.max(maxGraphicWidth, snapSize(n.prefWidth(alt))); + maxGraphicWidth = Math.max(maxGraphicWidth, snapSizeX(n.prefWidth(alt))); maxRowHeight = Math.max(maxRowHeight, n.prefHeight(-1)); } n = menuItemContainer.label; if (n != null) { if (n.getContentBias() == Orientation.VERTICAL) { - alt = snapSize(n.prefHeight(-1)); + alt = snapSizeY(n.prefHeight(-1)); } else alt = -1; - maxLabelWidth = Math.max(maxLabelWidth, snapSize(n.prefWidth(alt))); + maxLabelWidth = Math.max(maxLabelWidth, snapSizeX(n.prefWidth(alt))); maxRowHeight = Math.max(maxRowHeight, n.prefHeight(-1)); } n = menuItemContainer.right; if (n != null) { if (n.getContentBias() == Orientation.VERTICAL) { // width depends on height - alt = snapSize(n.prefHeight(-1)); + alt = snapSizeY(n.prefHeight(-1)); } else alt = -1; - maxRightWidth = Math.max(maxRightWidth, snapSize(n.prefWidth(alt))); + maxRightWidth = Math.max(maxRightWidth, snapSizeX(n.prefWidth(alt))); maxRowHeight = Math.max(maxRowHeight, n.prefHeight(-1)); } } @@ -334,7 +334,7 @@ final double y = snappedTopInset(); final double w = getWidth() - x - snappedRightInset(); final double h = getHeight() - y - snappedBottomInset(); - final double contentHeight = snapSize(getContentHeight()); // itemsContainer.prefHeight(-1); + final double contentHeight = snapSizeY(getContentHeight()); // itemsContainer.prefHeight(-1); itemsContainer.resize(w,contentHeight); itemsContainer.relocate(x, y); @@ -353,18 +353,18 @@ clipRect.setHeight(h); if (upArrow.isVisible()) { - final double prefHeight = snapSize(upArrow.prefHeight(-1)); - clipRect.setHeight(snapSize(clipRect.getHeight() - prefHeight)); - clipRect.setY(snapSize(clipRect.getY()) + prefHeight); - upArrow.resize(snapSize(upArrow.prefWidth(-1)), prefHeight); + final double prefHeight = snapSizeY(upArrow.prefHeight(-1)); + clipRect.setHeight(snapSizeY(clipRect.getHeight() - prefHeight)); + clipRect.setY(snapSizeY(clipRect.getY()) + prefHeight); + upArrow.resize(snapSizeX(upArrow.prefWidth(-1)), prefHeight); positionInArea(upArrow, x, y, w, prefHeight, /*baseline ignored*/0, HPos.CENTER, VPos.CENTER); } if (downArrow.isVisible()) { - final double prefHeight = snapSize(downArrow.prefHeight(-1)); - clipRect.setHeight(snapSize(clipRect.getHeight()) - prefHeight); - downArrow.resize(snapSize(downArrow.prefWidth(-1)), prefHeight); + final double prefHeight = snapSizeY(downArrow.prefHeight(-1)); + clipRect.setHeight(snapSizeY(clipRect.getHeight()) - prefHeight); + downArrow.resize(snapSizeX(downArrow.prefWidth(-1)), prefHeight); positionInArea(downArrow, x, (y + h - prefHeight), w, prefHeight, /*baseline ignored*/0, HPos.CENTER, VPos.CENTER); } @@ -376,16 +376,16 @@ if (itemsContainer.getChildren().size() == 0) return 0; for (Node n : itemsContainer.getChildren()) { if (! n.isVisible()) continue; - prefWidth = Math.max(prefWidth, snapSize(n.prefWidth(-1))); + prefWidth = Math.max(prefWidth, snapSizeX(n.prefWidth(-1))); } - return snappedLeftInset() + snapSize(prefWidth) + snappedRightInset(); + return snappedLeftInset() + snapSizeX(prefWidth) + snappedRightInset(); } @Override protected double computePrefHeight(double width) { if (itemsContainer.getChildren().size() == 0) return 0; final double screenHeight = getScreenHeight(); final double contentHeight = getContentHeight(); // itemsContainer.prefHeight(width); - double totalHeight = snappedTopInset() + snapSize(contentHeight) + snappedBottomInset(); + double totalHeight = snappedTopInset() + snapSizeY(contentHeight) + snappedBottomInset(); // the pref height of this menu is the smaller value of the // actual pref height and the height of the screens _visual_ bounds. double prefHeight = (screenHeight <= 0) ? (totalHeight) : (Math.min(totalHeight, screenHeight)); @@ -405,7 +405,7 @@ contextMenu.getOwnerWindow().getScene() == null) { return -1; } - return snapSize(com.sun.javafx.util.Utils.getScreen( + return snapSizeY(com.sun.javafx.util.Utils.getScreen( contextMenu.getOwnerWindow().getScene().getRoot()).getVisualBounds().getHeight()); } @@ -414,7 +414,7 @@ double h = 0.0d; for (Node i : itemsContainer.getChildren()) { if (i.isVisible()) { - h += snapSize(i.prefHeight(-1)); + h += snapSizeY(i.prefHeight(-1)); } } return h; @@ -1007,8 +1007,8 @@ double yOffset = ty; for (Node n : getChildren()) { if (n.isVisible()) { - final double prefHeight = snapSize(n.prefHeight(-1)); - n.resize(snapSize(getWidth()), prefHeight); + final double prefHeight = snapSizeY(n.prefHeight(-1)); + n.resize(snapSizeX(getWidth()), prefHeight); n.relocate(snappedLeftInset(), yOffset); yOffset += prefHeight; } @@ -1070,8 +1070,8 @@ } @Override protected void layoutChildren() { - double w = snapSize(upDownArrow.prefWidth(-1)); - double h = snapSize(upDownArrow.prefHeight(-1)); + double w = snapSizeX(upDownArrow.prefWidth(-1)); + double h = snapSizeY(upDownArrow.prefHeight(-1)); upDownArrow.resize(w, h); positionInArea(upDownArrow, 0, 0, getWidth(), getHeight(),