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

Print this page

        

@@ -208,11 +208,12 @@
      * @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);
+        @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,11 +250,11 @@
         GradientPainter(int count) {
             super(count);
         }
 
         public void paint(Component c, Graphics2D g,
-                          java.util.List gradient, int x, int y, int w,
+                          java.util.List<?> gradient, int x, int y, int w,
                           int h, boolean isVertical) {
             int imageWidth;
             int imageHeight;
             if (isVertical) {
                 imageWidth = IMAGE_SIZE;

@@ -272,11 +273,12 @@
         }
 
         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];
+            @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(),