/* * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package com.sun.javafx; import javafx.geometry.HPos; import javafx.geometry.Point2D; import javafx.geometry.Rectangle2D; import javafx.geometry.VPos; import javafx.scene.Node; import javafx.scene.paint.Color; import javafx.scene.paint.Stop; import javafx.stage.Screen; /** * NOTE: This functionality has been moved to the com.sun.javafx.util.Utils class. * This legacy class is used because SQE tests for 8u depend on it. * This class *must not* be propagated to FX 9 or it will violate the split * package restriction. See RT-40000 for details. * * @treatAsPrivate implementation detail * @deprecated This is an internal API that is not intended for use and will be removed in the next version */ @Deprecated public class Utils { public static float clamp(float min, float value, float max) { return com.sun.javafx.util.Utils.clamp(min, value, max); } public static int clamp(int min, int value, int max) { return com.sun.javafx.util.Utils.clamp(min, value, max); } public static double clamp(double min, double value, double max) { return com.sun.javafx.util.Utils.clamp(min, value, max); } public static double clampMin(double value, double min) { return com.sun.javafx.util.Utils.clampMin(value, min); } public static int clampMax(int value, int max) { return com.sun.javafx.util.Utils.clampMax(value, max); } public static double nearest(double less, double value, double more) { return com.sun.javafx.util.Utils.nearest(less, value, more); } public static String stripQuotes(String str) { return com.sun.javafx.util.Utils.stripQuotes(str); } public static String[] split(String str, String separator) { return com.sun.javafx.util.Utils.split(str, separator); } public static boolean contains(String src, String s) { return com.sun.javafx.util.Utils.contains(src, s); } public static double calculateBrightness(Color color) { return com.sun.javafx.util.Utils.calculateBrightness(color); } public static Color deriveColor(Color c, double brightness) { return com.sun.javafx.util.Utils.deriveColor(c, brightness); } public static Color ladder(final Color color, final Stop[] stops) { return com.sun.javafx.util.Utils.ladder(color, stops); } public static double[] HSBtoRGB(double hue, double saturation, double brightness) { return com.sun.javafx.util.Utils.HSBtoRGB(hue, saturation, brightness); } public static double[] RGBtoHSB(double r, double g, double b) { return com.sun.javafx.util.Utils.RGBtoHSB(r, g, b); } public static Color convertSRGBtoLinearRGB(Color color) { return com.sun.javafx.util.Utils.convertSRGBtoLinearRGB(color); } public static Color convertLinearRGBtoSRGB(Color color) { return com.sun.javafx.util.Utils.convertLinearRGBtoSRGB(color); } public static double sum(double[] values) { return com.sun.javafx.util.Utils.sum(values); } public static Point2D pointRelativeTo(Node parent, Node node, HPos hpos, VPos vpos, double dx, double dy, boolean reposition) { return com.sun.javafx.util.Utils.pointRelativeTo(parent, node, hpos, vpos, dx, dy, reposition); } public static Point2D pointRelativeTo(Node parent, double anchorWidth, double anchorHeight, HPos hpos, VPos vpos, double dx, double dy, boolean reposition) { return com.sun.javafx.util.Utils.pointRelativeTo(parent, anchorWidth, anchorHeight, hpos, vpos, dx, dy, reposition); } public static Point2D pointRelativeTo(Object parent, double width, double height, double screenX, double screenY, HPos hpos, VPos vpos) { return com.sun.javafx.util.Utils.pointRelativeTo(parent, width, height, screenX, screenY, hpos, vpos); } public static boolean hasFullScreenStage(final Screen screen) { return com.sun.javafx.util.Utils.hasFullScreenStage(screen); } public static boolean isQVGAScreen() { return com.sun.javafx.util.Utils.isQVGAScreen(); } public static Screen getScreen(Object obj) { return com.sun.javafx.util.Utils.getScreen(obj); } public static Screen getScreenForRectangle(final Rectangle2D rect) { return com.sun.javafx.util.Utils.getScreenForRectangle(rect); } public static Screen getScreenForPoint(final double x, final double y) { return com.sun.javafx.util.Utils.getScreenForPoint(x, y); } public static boolean assertionEnabled() { return com.sun.javafx.util.Utils.assertionEnabled(); } public static boolean isWindows(){ return com.sun.javafx.util.Utils.isWindows(); } public static boolean isMac(){ return com.sun.javafx.util.Utils.isMac(); } public static boolean isUnix(){ return com.sun.javafx.util.Utils.isUnix(); } public static String convertUnicode(String src) { return com.sun.javafx.util.Utils.convertUnicode(src); } }