xmlgraphics-fop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric SCHAEFFER" <eschaef...@posterconseil.com>
Subject Re: org.apache.fop.render.awt.AWTRenderer, again
Date Thu, 05 Oct 2000 09:35:24 GMT
Sorry, I'm really very busy. Hum, not because I'm just married, even if it
takes time and energy ;-) , but because I'm going in another company
(changing job).

----- Original Message -----
From: "COFFMAN Steven" <SCoffman@CBSINC.com>
To: <fop-dev@xml.apache.org>
Sent: Wednesday, October 04, 2000 9:29 PM
Subject: RE: org.apache.fop.render.awt.AWTRenderer, again


> Since Eric's a bit busy after just getting married (Congratulations!), and
I

Thank's

> 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.

1 - The problem is that I don't know the AWTRenderer.
I agree that exceptions should be handled, but it's also true that if an
error occur, we only don't show the image... (maybe we should draw an
"error" image or something like that)

2 - As I can see, the image data is read "again" during rendering (when
creating an ImageIcon). When I tried to create the FopImage interface, I
asked to people writing the AWTRenderer class if the interface befit them.
But if the FopImage interface was returning the image data as an int array
(like Java does), maybe it would make things easier.
Comments and ideas wellcomed ....

Eric.

> -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