----- Original Message -----
From: "Thomas E Deweese" <[EMAIL PROTECTED]>
To: "Batik Users" <[EMAIL PROTECTED]>
Sent: Friday, February 14, 2003 7:06 PM
Subject: RE: Is it possible to create a rect filled with SVGGraphics2D?
> >>>>> "SJ" == Selber Jean-Fran�ois <[EMAIL PROTECTED]> writes:
>
> SJ> Hello, I am trying to use SVGGraphics2D class of batik to get an
> SJ> SVG result; What I want to get in the resulting SVG the following:
> SJ> <rect x="445" y="50" width="119" height="150" fill="green"
> SJ> stroke="blue" stroke-width="1"/>
>
> SJ> But looking at the SVGGraphics2D class I only find function to
> SJ> draw a rectangle or to fill it (fill(Rect) and draw(Rect);) Using
> SJ> these functions I get the following result:
>
> I don't know for sure, but since SVG defines fill to be drawn
> before stoke I suspect that you had your draw and fill out of order
> given the SVG generated. It certainly shouldn't collapse them if you
> do this, try reversing them. Otherwise the source is available (there
> is an issue that it possible for the shape to change between calls
> which might make it difficult for the class to know they were the
> same).
I have tried with your remarks see bellow an example of the code. But it
doesn't work. In each case I obtain 2 rectangles. May be I have not
understood your comments:
1-
Java Code:
svgGraphics2D.setColor(Color.black);
svgGraphics2D.drawRect(74, 205, 41, 28);
svgGraphics2D.setColor(Color.red);
svgGraphics2D.fillRect(74, 205, 41, 28);
SVG Result:
<rect x="74" y="205" width="41" style="fill:none; stroke:black;"
height="28" />
<rect x="74" y="205" width="41" style="fill:red; stroke:none;"
height="28" />
2-
Java Code:
svgGraphics2D.setColor(Color.red);
svgGraphics2D.fillRect(74, 205, 41, 28);
svgGraphics2D.setColor(Color.black);
svgGraphics2D.drawRect(74, 205, 41, 28);
SVG Result:
<rect x="74" y="205" width="41" style="fill:red; stroke:none;"
height="28" />
<rect x="74" y="205" width="41" style="fill:none; stroke:black;"
height="28" />
How can I write java code in order to obtain svg as follow:
<rect x="74" y="205" width="41" style="fill:red; stroke:black;"
height="28" />
Thank you
Best regards
Jean-Fran�ois Selber
>
> SJ> <rect x="445" y="50" width="119" height="150" fill="none"
> SJ> stroke="blue" stroke-width="1"/> <rect x="445" y="50" width="119"
> SJ> height="150" fill="green" />
>
> SJ> Is there a way that I can use so that the resulting svg will only
> SJ> contain one rectangle definition including properly the stroke and
> SJ> fill attributes;
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]