src/share/classes/java/awt/SplashScreen.java

Print this page

        

*** 243,253 **** * @throws IllegalStateException if the splash screen has already been closed */ public Rectangle getBounds() throws IllegalStateException { synchronized (SplashScreen.class) { checkVisible(); ! return _getBounds(splashPtr); } } /** * Returns the size of the splash screen window as a {@link Dimension}. --- 243,259 ---- * @throws IllegalStateException if the splash screen has already been closed */ public Rectangle getBounds() throws IllegalStateException { synchronized (SplashScreen.class) { checkVisible(); ! float scale = _getScaleFactor(splashPtr); ! Rectangle bounds = _getBounds(splashPtr); ! if (scale != 1) { ! bounds.setSize((int) (bounds.getWidth() / scale), ! (int) (bounds.getWidth() / scale)); ! } ! return bounds; } } /** * Returns the size of the splash screen window as a {@link Dimension}.
*** 285,298 **** * @throws IllegalStateException if the splash screen has already been closed */ public Graphics2D createGraphics() throws IllegalStateException { synchronized (SplashScreen.class) { if (image==null) { ! Dimension dim = getSize(); ! image = new BufferedImage(dim.width, dim.height, BufferedImage.TYPE_INT_ARGB); ! } ! return image.createGraphics(); } } /** * Updates the splash window with current contents of the overlay image. --- 291,309 ---- * @throws IllegalStateException if the splash screen has already been closed */ public Graphics2D createGraphics() throws IllegalStateException { synchronized (SplashScreen.class) { if (image==null) { ! // get unscaled splash image size ! Dimension dim = _getBounds(splashPtr).getSize(); ! image = new BufferedImage(dim.width, dim.height, ! BufferedImage.TYPE_INT_ARGB); ! } ! float scale = _getScaleFactor(splashPtr); ! Graphics2D g = image.createGraphics(); ! g.scale(scale, scale); ! return g; } } /** * Updates the splash window with current contents of the overlay image.
*** 399,405 **** --- 410,417 ---- private native static long _getInstance(); private native static void _close(long splashPtr); private native static String _getImageFileName(long splashPtr); private native static String _getImageJarName(long SplashPtr); private native static boolean _setImageData(long SplashPtr, byte[] data); + private native static float _getScaleFactor(long SplashPtr); };