xmlgraphics-fop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From COFFMAN Steven <SCoff...@CBSINC.com>
Subject RE: org.apache.fop.render.awt.AWTRenderer, again
Date Wed, 04 Oct 2000 19:29:55 GMT
Since Eric's a bit busy after just getting married (Congratulations!), and I
have a high level of confidence in you from your last patches/messages, I
was going to commit this for him, but you don't handle your exceptions! The
catch is empty, and I don't think it handles all the possible exceptions
that the old code did.

This might be ok (I'm not familiar with whether it's really possible to get
an exception at this point), but it kind of scares me, so I'm going to wait
on Eric or a patch that's less scary.
-Steve

-----Original Message-----
From: Domagoj Cosic [mailto:Domagoj.Cosic@hypercis.de]
Sent: Wednesday, October 04, 2000 4:39 AM
To: 'fop-dev@xml.apache.org'
Subject: org.apache.fop.render.awt.AWTRenderer, again


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

A few weeks ago, I posted a patch for the AWTRenderer. However, due to
changes between 0.13.0 an 0.14.0, this patch was not completely correct.
Here is a correct, functioning version:

	public void renderImageArea(ImageArea area) {
		int x = currentAreaContainerXPositionShadow +
		    area.getXOffset();
		int y = currentYPosition;
		int w = area.getContentWidth();
		int h = area.getHeight();
		
		FopImage img = area.getImage();
		
		if (img == null) {
		    System.out.println("area.getImage() is null");
		}
		
		String urlString = img.getURL();
		try {
			URL url = new URL(urlString);
			
			ImageIcon icon = new ImageIcon(url);
			Image image = icon.getImage();
			
			graphics.drawImage(image, x / 1000,
					   pageHeight - y / 1000,
					   w / 1000,
					   h / 1000,
					   null);
		} catch(MalformedURLException mue) {
		}
		
		currentYPosition -= h;
	}

It produces same results as the PDF renderer, as one would expect.

I wonder about why my other patch (DOM tree formatting) caused no reaction
at all...

Regards,

Domagoj

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 6.0.2i

iQA/AwUBOdresTZvP6Gs5imAEQJ5cQCcCNXKE4tDcMVMJUi8zExQMQ7XQvYAoIBK
SM50TvRcpNaiCfZnwDBm20cE
=Zqpk
-----END PGP SIGNATURE-----

Mime
View raw message