src/share/classes/java/awt/image/renderable/RenderableImageProducer.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+ * 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

@@ -66,11 +66,11 @@
 
     /** The RenderContext to use for producing the image. */
     RenderContext rc;
 
     /** A Vector of image consumers. */
-    Vector ics = new Vector();
+    Vector<ImageConsumer> ics = new Vector<>();
 
     /**
      * Constructs a new RenderableImageProducer from a RenderableImage
      * and a RenderContext.
      *

@@ -175,16 +175,16 @@
         int minX = raster.getMinX();
         int minY = raster.getMinY();
         int width = raster.getWidth();
         int height = raster.getHeight();
 
-        Enumeration icList;
+        Enumeration<ImageConsumer> icList;
         ImageConsumer ic;
         // Set up the ImageConsumers
         icList = ics.elements();
         while (icList.hasMoreElements()) {
-            ic = (ImageConsumer)icList.nextElement();
+            ic = icList.nextElement();
             ic.setDimensions(width,height);
             ic.setHints(ImageConsumer.TOPDOWNLEFTRIGHT |
                         ImageConsumer.COMPLETESCANLINES |
                         ImageConsumer.SINGLEPASS |
                         ImageConsumer.SINGLEFRAME);

@@ -202,18 +202,18 @@
                 pix[i] = colorModel.getDataElement(tmpPixel, 0);
             }
             // Now send the scanline to the Consumers
             icList = ics.elements();
             while (icList.hasMoreElements()) {
-                ic = (ImageConsumer)icList.nextElement();
+                ic = icList.nextElement();
                 ic.setPixels(0, j, width, 1, colorModel, pix, 0, width);
             }
         }
 
         // Now tell the consumers we're done.
         icList = ics.elements();
         while (icList.hasMoreElements()) {
-            ic = (ImageConsumer)icList.nextElement();
+            ic = icList.nextElement();
             ic.imageComplete(ImageConsumer.STATICIMAGEDONE);
         }
     }
 }