Skip to content
Permalink
Browse files
8264137: Suppress deprecation and removal warnings of internal methods
8252820: Skins: cleanup use of deprecated snapSize/snapPosition

Reviewed-by: kcr, mhanl
  • Loading branch information
aghaisas committed Jun 23, 2021
1 parent 8e11b94 commit 063bfe877555dea9e2060e651192f95e529db56d
Showing with 134 additions and 119 deletions.
  1. +1 −0 modules/javafx.base/src/main/java/javafx/util/converter/DateStringConverter.java
  2. +1 −0 modules/javafx.base/src/main/java/javafx/util/converter/TimeStringConverter.java
  3. +6 −0 modules/javafx.base/src/shims/java/javafx/util/converter/DateTimeStringConverterShim.java
  4. +4 −4 modules/javafx.controls/src/main/java/javafx/scene/control/skin/ColorPickerSkin.java
  5. +24 −24 modules/javafx.controls/src/main/java/javafx/scene/control/skin/PaginationSkin.java
  6. +10 −10 modules/javafx.controls/src/main/java/javafx/scene/control/skin/ProgressIndicatorSkin.java
  7. +1 −1 modules/javafx.controls/src/main/java/javafx/scene/control/skin/ScrollPaneSkin.java
  8. +60 −60 modules/javafx.controls/src/main/java/javafx/scene/control/skin/TabPaneSkin.java
  9. +6 −6 modules/javafx.controls/src/main/java/javafx/scene/control/skin/TitledPaneSkin.java
  10. +4 −4 modules/javafx.controls/src/main/java/javafx/scene/control/skin/ToolBarSkin.java
  11. +2 −2 modules/javafx.controls/src/test/java/test/javafx/scene/chart/XYChartTest.java
  12. +2 −2 modules/javafx.controls/src/test/java/test/javafx/scene/control/LabeledTest.java
  13. +4 −0 modules/javafx.controls/src/test/java/test/javafx/scene/control/TreeItemTest.java
  14. +1 −0 modules/javafx.fxml/src/test/java/test/com/oracle/javafx/fxml/test/TestLoadPerformance.java
  15. +1 −0 modules/javafx.graphics/src/shims/java/javafx/scene/input/GestureEventShim.java
  16. +1 −0 modules/javafx.graphics/src/test/java/test/javafx/css/StylesheetTest.java
  17. +1 −1 modules/javafx.graphics/src/test/java/test/javafx/scene/Scenegraph_eventHandlers_Test.java
  18. +1 −1 tests/system/src/test/java/test/robot/com/sun/glass/ui/monocle/input/devices/TestTouchDevices.java
  19. +2 −2 tests/system/src/test/java/test/robot/javafx/embed/swing/JFXPanelTest.java
  20. +2 −2 tests/system/src/test/java/test/robot/javafx/embed/swing/NonFocusableJFXPanelTest.java
@@ -127,6 +127,7 @@ private DateStringConverter(Locale locale, String pattern, DateFormat dateFormat
// --------------------------------------------------------- Private Methods

/** {@inheritDoc} */
@SuppressWarnings("removal")
@Override protected DateFormat getDateFormat() {
DateFormat df = null;

@@ -128,6 +128,7 @@ private TimeStringConverter(Locale locale, String pattern, DateFormat dateFormat
// --------------------------------------------------------- Private Methods

/** {@inheritDoc} */
@SuppressWarnings("removal")
@Override protected DateFormat getDateFormat() {
DateFormat df = null;

@@ -30,26 +30,32 @@

public class DateTimeStringConverterShim {

@SuppressWarnings("removal")
public static int getTimeStyle(DateTimeStringConverter tsc) {
return tsc.timeStyle;
}

@SuppressWarnings("removal")
public static String getPattern(DateTimeStringConverter tsc) {
return tsc.pattern;
}

@SuppressWarnings("removal")
public static int getDateStyle(DateTimeStringConverter tsc) {
return tsc.dateStyle;
}

@SuppressWarnings("removal")
public static DateFormat getDateFormat(DateTimeStringConverter tsc) {
return tsc.getDateFormat();
}

@SuppressWarnings("removal")
public static DateFormat getDateFormatVar(DateTimeStringConverter tsc) {
return tsc.dateFormat;
}

@SuppressWarnings("removal")
public static Locale getLocale(DateTimeStringConverter tsc) {
return tsc.locale;
}
@@ -584,10 +584,10 @@ private void updateColor() {
final double height = getHeight();
final double right = snappedRightInset();
final double bottom = snappedBottomInset();
colorRect.setX(snapPosition(colorRectX.get()));
colorRect.setY(snapPosition(colorRectY.get()));
colorRect.setWidth(snapSize(colorRectWidth.get()));
colorRect.setHeight(snapSize(colorRectHeight.get()));
colorRect.setX(snapPositionX(colorRectX.get()));
colorRect.setY(snapPositionY(colorRectY.get()));
colorRect.setWidth(snapSizeX(colorRectWidth.get()));
colorRect.setHeight(snapSizeY(colorRectHeight.get()));
if (getChildren().size() == 2) {
final ImageView icon = (ImageView) getChildren().get(1);
Pos childAlignment = StackPane.getAlignment(icon);
@@ -838,7 +838,7 @@ public NavigationControl() {
leftArrowButton.prefHeightProperty().bind(leftArrowButton.minHeightProperty());
leftArrowButton.getStyleClass().add("left-arrow-button");
leftArrowButton.setFocusTraversable(false);
HBox.setMargin(leftArrowButton, new Insets(0, snapSize(arrowButtonGap.get()), 0, 0));
HBox.setMargin(leftArrowButton, new Insets(0, snapSizeX(arrowButtonGap.get()), 0, 0));
leftArrow = new StackPane();
leftArrow.setMaxSize(USE_PREF_SIZE, USE_PREF_SIZE);
leftArrowButton.setGraphic(leftArrow);
@@ -851,7 +851,7 @@ public NavigationControl() {
rightArrowButton.prefHeightProperty().bind(rightArrowButton.minHeightProperty());
rightArrowButton.getStyleClass().add("right-arrow-button");
rightArrowButton.setFocusTraversable(false);
HBox.setMargin(rightArrowButton, new Insets(0, 0, 0, snapSize(arrowButtonGap.get())));
HBox.setMargin(rightArrowButton, new Insets(0, 0, 0, snapSizeX(arrowButtonGap.get())));
rightArrow = new StackPane();
rightArrow.setMaxSize(USE_PREF_SIZE, USE_PREF_SIZE);
rightArrowButton.setGraphic(rightArrow);
@@ -874,8 +874,8 @@ public NavigationControl() {
HBox.setMargin(rightArrowButton, null);

} else {
HBox.setMargin(leftArrowButton, new Insets(0, snapSize(newValue.doubleValue()), 0, 0));
HBox.setMargin(rightArrowButton, new Insets(0, 0, 0, snapSize(newValue.doubleValue())));
HBox.setMargin(leftArrowButton, new Insets(0, snapSizeX(newValue.doubleValue()), 0, 0));
HBox.setMargin(rightArrowButton, new Insets(0, 0, 0, snapSizeX(newValue.doubleValue())));
}
});
}
@@ -970,18 +970,18 @@ private void updatePageInformation() {
private void layoutPageIndicators() {
final double left = snappedLeftInset();
final double right = snappedRightInset();
final double width = snapSize(getWidth()) - (left + right);
final double width = snapSizeX(getWidth()) - (left + right);
final double controlBoxleft = controlBox.snappedLeftInset();
final double controlBoxRight = controlBox.snappedRightInset();
final double leftArrowWidth = snapSize(Utils.boundedSize(leftArrowButton.prefWidth(-1), leftArrowButton.minWidth(-1), leftArrowButton.maxWidth(-1)));
final double rightArrowWidth = snapSize(Utils.boundedSize(rightArrowButton.prefWidth(-1), rightArrowButton.minWidth(-1), rightArrowButton.maxWidth(-1)));
final double spacing = snapSize(controlBox.getSpacing());
final double leftArrowWidth = snapSizeX(Utils.boundedSize(leftArrowButton.prefWidth(-1), leftArrowButton.minWidth(-1), leftArrowButton.maxWidth(-1)));
final double rightArrowWidth = snapSizeX(Utils.boundedSize(rightArrowButton.prefWidth(-1), rightArrowButton.minWidth(-1), rightArrowButton.maxWidth(-1)));
final double spacing = snapSizeX(controlBox.getSpacing());
double w = width - (controlBoxleft + leftArrowWidth + 2* arrowButtonGap.get() + spacing + rightArrowWidth + controlBoxRight);

if (isPageInformationVisible() &&
(Side.LEFT.equals(getPageInformationAlignment()) ||
Side.RIGHT.equals(getPageInformationAlignment()))) {
w -= snapSize(pageInformation.prefWidth(-1));
w -= snapSizeX(pageInformation.prefWidth(-1));
}

double x = 0;
@@ -991,7 +991,7 @@ private void layoutPageIndicators() {
double iw = minButtonSize;
if (index != -1) {
IndicatorButton ib = (IndicatorButton)indicatorButtons.getToggles().get(index);
iw = snapSize(Utils.boundedSize(ib.prefWidth(-1), ib.minWidth(-1), ib.maxWidth(-1)));
iw = snapSizeX(Utils.boundedSize(ib.prefWidth(-1), ib.minWidth(-1), ib.maxWidth(-1)));
}

x += (iw + spacing);
@@ -1159,13 +1159,13 @@ private Pos sideToPos(Side s) {
@Override protected double computeMinWidth(double height) {
double left = snappedLeftInset();
double right = snappedRightInset();
double leftArrowWidth = snapSize(Utils.boundedSize(leftArrowButton.prefWidth(-1), leftArrowButton.minWidth(-1), leftArrowButton.maxWidth(-1)));
double rightArrowWidth = snapSize(Utils.boundedSize(rightArrowButton.prefWidth(-1), rightArrowButton.minWidth(-1), rightArrowButton.maxWidth(-1)));
double spacing = snapSize(controlBox.getSpacing());
double leftArrowWidth = snapSizeX(Utils.boundedSize(leftArrowButton.prefWidth(-1), leftArrowButton.minWidth(-1), leftArrowButton.maxWidth(-1)));
double rightArrowWidth = snapSizeX(Utils.boundedSize(rightArrowButton.prefWidth(-1), rightArrowButton.minWidth(-1), rightArrowButton.maxWidth(-1)));
double spacing = snapSizeX(controlBox.getSpacing());
double pageInformationWidth = 0;
Side side = getPageInformationAlignment();
if (Side.LEFT.equals(side) || Side.RIGHT.equals(side)) {
pageInformationWidth = snapSize(pageInformation.prefWidth(-1));
pageInformationWidth = snapSizeX(pageInformation.prefWidth(-1));
}
double arrowGap = arrowButtonGap.get();

@@ -1180,11 +1180,11 @@ private Pos sideToPos(Side s) {
@Override protected double computePrefWidth(double height) {
final double left = snappedLeftInset();
final double right = snappedRightInset();
final double controlBoxWidth = snapSize(controlBox.prefWidth(height));
final double controlBoxWidth = snapSizeX(controlBox.prefWidth(height));
double pageInformationWidth = 0;
Side side = getPageInformationAlignment();
if (Side.LEFT.equals(side) || Side.RIGHT.equals(side)) {
pageInformationWidth = snapSize(pageInformation.prefWidth(-1));
pageInformationWidth = snapSizeX(pageInformation.prefWidth(-1));
}

return left + controlBoxWidth + right + pageInformationWidth;
@@ -1193,11 +1193,11 @@ private Pos sideToPos(Side s) {
@Override protected double computePrefHeight(double width) {
final double top = snappedTopInset();
final double bottom = snappedBottomInset();
final double boxHeight = snapSize(controlBox.prefHeight(width));
final double boxHeight = snapSizeY(controlBox.prefHeight(width));
double pageInformationHeight = 0;
Side side = getPageInformationAlignment();
if (Side.TOP.equals(side) || Side.BOTTOM.equals(side)) {
pageInformationHeight = snapSize(pageInformation.prefHeight(-1));
pageInformationHeight = snapSizeY(pageInformation.prefHeight(-1));
}

return top + boxHeight + pageInformationHeight + bottom;
@@ -1208,12 +1208,12 @@ private Pos sideToPos(Side s) {
final double bottom = snappedBottomInset();
final double left = snappedLeftInset();
final double right = snappedRightInset();
final double width = snapSize(getWidth()) - (left + right);
final double height = snapSize(getHeight()) - (top + bottom);
final double controlBoxWidth = snapSize(controlBox.prefWidth(-1));
final double controlBoxHeight = snapSize(controlBox.prefHeight(-1));
final double pageInformationWidth = snapSize(pageInformation.prefWidth(-1));
final double pageInformationHeight = snapSize(pageInformation.prefHeight(-1));
final double width = snapSizeX(getWidth()) - (left + right);
final double height = snapSizeY(getHeight()) - (top + bottom);
final double controlBoxWidth = snapSizeX(controlBox.prefWidth(-1));
final double controlBoxHeight = snapSizeY(controlBox.prefHeight(-1));
final double pageInformationWidth = snapSizeX(pageInformation.prefWidth(-1));
final double pageInformationHeight = snapSizeY(pageInformation.prefHeight(-1));

leftArrowButton.setDisable(false);
rightArrowButton.setDisable(false);
@@ -593,15 +593,15 @@ private void updateProgress(double progress) {
final double radiusW = areaW / 2;
final double radiusH = areaH / 2;
final double radius = Math.floor(Math.min(radiusW, radiusH));
final double centerX = snapPosition(left + radiusW);
final double centerY = snapPosition(top + radius);
final double centerX = snapPositionX(left + radiusW);
final double centerY = snapPositionY(top + radius);

// find radius that fits inside radius - insetsPadding
final double iLeft = indicator.snappedLeftInset();
final double iRight = indicator.snappedRightInset();
final double iTop = indicator.snappedTopInset();
final double iBottom = indicator.snappedBottomInset();
final double progressRadius = snapSize(Math.min(
final double progressRadius = snapSizeX(Math.min(
Math.min(radius - iLeft, radius - iRight),
Math.min(radius - iTop, radius - iBottom)));

@@ -619,7 +619,7 @@ private void updateProgress(double progress) {
final double pRight = progress.snappedRightInset();
final double pTop = progress.snappedTopInset();
final double pBottom = progress.snappedBottomInset();
final double indicatorRadius = snapSize(Math.min(
final double indicatorRadius = snapSizeX(Math.min(
Math.min(progressRadius - pLeft, progressRadius - pRight),
Math.min(progressRadius - pTop, progressRadius - pBottom)));

@@ -636,8 +636,8 @@ private void updateProgress(double progress) {
double textHeight = text.getLayoutBounds().getHeight();
if (control.getWidth() >= textWidth && control.getHeight() >= textHeight) {
if (!text.isVisible()) text.setVisible(true);
text.setLayoutY(snapPosition(centerY + radius + textGap));
text.setLayoutX(snapPosition(centerX - (textWidth/2)));
text.setLayoutY(snapPositionY(centerY + radius + textGap));
text.setLayoutX(snapPositionX(centerX - (textWidth/2)));
} else {
if (text.isVisible()) text.setVisible(false);
}
@@ -650,12 +650,12 @@ private void updateProgress(double progress) {
final double iRight = indicator.snappedRightInset();
final double iTop = indicator.snappedTopInset();
final double iBottom = indicator.snappedBottomInset();
final double indicatorMax = snapSize(Math.max(Math.max(iLeft, iRight), Math.max(iTop, iBottom)));
final double indicatorMax = snapSizeX(Math.max(Math.max(iLeft, iRight), Math.max(iTop, iBottom)));
final double pLeft = progress.snappedLeftInset();
final double pRight = progress.snappedRightInset();
final double pTop = progress.snappedTopInset();
final double pBottom = progress.snappedBottomInset();
final double progressMax = snapSize(Math.max(Math.max(pLeft, pRight), Math.max(pTop, pBottom)));
final double progressMax = snapSizeX(Math.max(Math.max(pLeft, pRight), Math.max(pTop, pBottom)));
final double tLeft = tick.snappedLeftInset();
final double tRight = tick.snappedRightInset();
final double indicatorWidth = indicatorMax + progressMax + tLeft + tRight + progressMax + indicatorMax;
@@ -669,12 +669,12 @@ private void updateProgress(double progress) {
final double iRight = indicator.snappedRightInset();
final double iTop = indicator.snappedTopInset();
final double iBottom = indicator.snappedBottomInset();
final double indicatorMax = snapSize(Math.max(Math.max(iLeft, iRight), Math.max(iTop, iBottom)));
final double indicatorMax = snapSizeY(Math.max(Math.max(iLeft, iRight), Math.max(iTop, iBottom)));
final double pLeft = progress.snappedLeftInset();
final double pRight = progress.snappedRightInset();
final double pTop = progress.snappedTopInset();
final double pBottom = progress.snappedBottomInset();
final double progressMax = snapSize(Math.max(Math.max(pLeft, pRight), Math.max(pTop, pBottom)));
final double progressMax = snapSizeY(Math.max(Math.max(pLeft, pRight), Math.max(pTop, pBottom)));
final double tTop = tick.snappedTopInset();
final double tBottom = tick.snappedBottomInset();
final double indicatorHeight = indicatorMax + progressMax + tTop + tBottom + progressMax + indicatorMax;
@@ -684,7 +684,7 @@ private void initialize() {
computeScrollNodeSize(getWidth(),getHeight());
}
if (scrollNode != null && scrollNode.isResizable()) {
scrollNode.resize(snapSize(nodeWidth), snapSize(nodeHeight));
scrollNode.resize(snapSizeX(nodeWidth), snapSizeY(nodeHeight));
if (vsbvis != determineVerticalSBVisible() || hsbvis != determineHorizontalSBVisible()) {
getSkinnable().requestLayout();
}

1 comment on commit 063bfe8

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on 063bfe8 Jun 23, 2021

Please sign in to comment.