test_class.file: plugin/rasterizing/rasterizing/src/test/java/org/geomajas/plugin/rasterizing/legend/RenderedImageIconTest.java
test_class.identifier: RenderedImageIconTest
test_case.body: @Test
  	public void testPaint() throws IOException {
  		BufferedImage img = ImageIO.read(getClass().getResourceAsStream(
  				"/org/geomajas/plugin/rasterizing/images/testIcon.png"));
  		RenderedImageIcon icon = new RenderedImageIcon(img, 24, 24);
  
  		BufferedImage copy = new BufferedImage(24, 24, BufferedImage.TYPE_4BYTE_ABGR);
  		icon.paintIcon(null, copy.getGraphics(), 0, 0);
  		copy.getGraphics().dispose();
  
  		//ImageIO.write(copy, "png", new FileOutputStream("my.png"));
  		
  		Raster r1 = img.getData();
  		Raster r2 = copy.getData();
  		for (int i = 0; i < 24; i++) {
  			for (int j = 0; j < 24; j++) {
  				int[] p1 = r1.getPixel(i, j, (int[]) null);
  				int[] p2 = r2.getPixel(i, j, (int[]) null);
  				Assert.assertArrayEquals(p2, p1);
  			}
  		}
  
  	}
test_case.class_method_signature: RenderedImageIconTest.testPaint()
test_case.full_signature: @Test public void testPaint()
test_case.identifier: testPaint
test_case.invocations: read getResourceAsStream getClass paintIcon getGraphics dispose getGraphics getData getData getPixel getPixel assertArrayEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testPaint()
focal_class.declarator: renderedImage
focal_class.modifier: private
focal_class.original_string: private RenderedImage renderedImage;
focal_class.type: RenderedImage
focal_class.var_name: renderedImage
focal_class.declarator: width
focal_class.modifier: private
focal_class.original_string: private int width;
focal_class.type: int
focal_class.var_name: width
focal_class.declarator: height
focal_class.modifier: private
focal_class.original_string: private int height;
focal_class.type: int
focal_class.var_name: height
focal_class.file: plugin/rasterizing/rasterizing/src/main/java/org/geomajas/plugin/rasterizing/legend/RenderedImageIcon.java
focal_class.identifier: RenderedImageIcon
focal_class.interfaces: implements Icon
focal_class.class_method_signature: RenderedImageIcon.RenderedImageIcon(RenderedImage renderedImage, int width, int height)
focal_class.full_signature: public  RenderedImageIcon(RenderedImage renderedImage, int width, int height)
focal_class.identifier: RenderedImageIcon
focal_class.modifiers: public
focal_class.parameters: (RenderedImage renderedImage, int width, int height)
focal_class.signature:  RenderedImageIcon(RenderedImage renderedImage, int width, int height)
focal_class.class_method_signature: RenderedImageIcon.paintIcon(Component c, Graphics g, int x, int y)
focal_class.full_signature: public void paintIcon(Component c, Graphics g, int x, int y)
focal_class.identifier: paintIcon
focal_class.modifiers: public
focal_class.parameters: (Component c, Graphics g, int x, int y)
focal_class.return: void
focal_class.signature: void paintIcon(Component c, Graphics g, int x, int y)
focal_class.class_method_signature: RenderedImageIcon.getIconWidth()
focal_class.full_signature: public int getIconWidth()
focal_class.identifier: getIconWidth
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getIconWidth()
focal_class.class_method_signature: RenderedImageIcon.getIconHeight()
focal_class.full_signature: public int getIconHeight()
focal_class.identifier: getIconHeight
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getIconHeight()
focal_method.body: public void paintIcon(Component c, Graphics g, int x, int y) {
  		if (!(g instanceof Graphics2D)) {
  			throw new IllegalStateException("paintIcon() only works on Graphics2D.");
  		}
  		Graphics2D g2d = (Graphics2D) g;
  		AffineTransform scale = AffineTransform.getScaleInstance((double) (width) / renderedImage.getWidth(),
  				(double) (height) / renderedImage.getHeight());
  		AffineTransform translate = AffineTransform.getTranslateInstance(x, y);
  		translate.concatenate(scale);
  		g2d.drawRenderedImage(renderedImage, translate);
  	}
focal_method.class_method_signature: RenderedImageIcon.paintIcon(Component c, Graphics g, int x, int y)
focal_method.full_signature: public void paintIcon(Component c, Graphics g, int x, int y)
focal_method.identifier: paintIcon
focal_method.invocations: getScaleInstance getWidth getHeight getTranslateInstance concatenate drawRenderedImage
focal_method.modifiers: public
focal_method.parameters: (Component c, Graphics g, int x, int y)
focal_method.return: void
focal_method.signature: void paintIcon(Component c, Graphics g, int x, int y)