src/share/classes/javax/swing/plaf/metal/MetalUtils.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1998, 2005, 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 --- 1,7 ---- /* ! * Copyright (c) 1998, 2014, 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
*** 208,218 **** * @param vertical Direction of the gradient * @return true if <code>key</code> exists, otherwise false. */ static boolean drawGradient(Component c, Graphics g, String key, int x, int y, int w, int h, boolean vertical) { ! java.util.List gradient = (java.util.List)UIManager.get(key); if (gradient == null || !(g instanceof Graphics2D)) { return false; } if (w <= 0 || h <= 0) { --- 208,219 ---- * @param vertical Direction of the gradient * @return true if <code>key</code> exists, otherwise false. */ static boolean drawGradient(Component c, Graphics g, String key, int x, int y, int w, int h, boolean vertical) { ! @SuppressWarnings("unchecked") ! java.util.List<?> gradient = (java.util.List)UIManager.get(key); if (gradient == null || !(g instanceof Graphics2D)) { return false; } if (w <= 0 || h <= 0) {
*** 249,259 **** GradientPainter(int count) { super(count); } public void paint(Component c, Graphics2D g, ! java.util.List gradient, int x, int y, int w, int h, boolean isVertical) { int imageWidth; int imageHeight; if (isVertical) { imageWidth = IMAGE_SIZE; --- 250,260 ---- GradientPainter(int count) { super(count); } public void paint(Component c, Graphics2D g, ! java.util.List<?> gradient, int x, int y, int w, int h, boolean isVertical) { int imageWidth; int imageHeight; if (isVertical) { imageWidth = IMAGE_SIZE;
*** 272,282 **** } protected void paintToImage(Component c, Image image, Graphics g, int w, int h, Object[] args) { Graphics2D g2 = (Graphics2D)g; ! java.util.List gradient = (java.util.List)args[0]; boolean isVertical = ((Boolean)args[1]).booleanValue(); // Render to the VolatileImage if (isVertical) { drawVerticalGradient(g2, ((Number)gradient.get(0)).floatValue(), --- 273,284 ---- } protected void paintToImage(Component c, Image image, Graphics g, int w, int h, Object[] args) { Graphics2D g2 = (Graphics2D)g; ! @SuppressWarnings("unchecked") ! java.util.List<?> gradient = (java.util.List)args[0]; boolean isVertical = ((Boolean)args[1]).booleanValue(); // Render to the VolatileImage if (isVertical) { drawVerticalGradient(g2, ((Number)gradient.get(0)).floatValue(),