Thank You Thomas,
I need to experiment a bit, and then I'm sure I'll be back with more
questions.

|eg|


-----Original Message-----
From: Thomas DeWeese [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 29, 2003 12:54 PM
To: Batik Users
Subject: Re: Cutting out awt


Grinvald, Edward wrote:

> I'm still very much interested in keeping things within java. From 
> what I understand, after the svg is parsed, an ExtendedGeneralPath is 
> generated that holds all parts of an svg.

    Actually for a variety of reasons we generate an ExtendedGeneralPath
and a regular java.awt.geom.GeneralPath.  This is done for every 'shape'
element in the DOM.

> I haven't been able to figure
> a good number of things:
> (1) how is the path generated, and is there only 1 such path for the 
> entire svg?

    No there is one for each shape element in the DOM.

> (2) What iterates over the path to create the awt shapes 
> (shapepainter?)?

    I believe we generate both the ExtendedGeneralPath and the
GeneralPath at the same time (and anyway it extends java.awt.Shape).

> (3) What actually draws the shapes on the canvas.

    We don't directly draw to the canvas we draw to an offscreen
BufferedImage using the Graphics2D interface.  The easiest (and really
not that inefficient) thing to do would be to simply have us draw to an
offscreen buffer and then display that in the SWT.

    To be complete you would have to essentially write an SWT version of
the batik.swing package.

> Ideally, I'd like to have access to the generated awt shapes right 
> before they are drawn. I actually want to try rendering them in 
> Eclipse's SWT, so I would like to establish a mapping of sorts, and 
> rather then having the generated awt shapes drawn on a awt/swing 
> canvas, generate my own set of shapes and drawn them on an draw2d 
> shell. Naturally, I'd like batik to do as much work as possible, with 
> my code only "redirecting" where the shapes are drawn.

    Well we draw a lot more than _just_ shapes.  We also draw images, we
do complex stroking, we have complex fills (gradients, patterns), we
draw text, don't forget affine transforms.

    You need to think about a lot more than just shapes.

    Can you send a reference to the draw2d shell interface?

    If you want access to the shapes (and other things) that we draw
that is available in the 'gvt' package (Graphics Vector Toolkit)  this
is a tree of GraphicsNodes.  There are graphics nodes for each of the
major types of objects drawn (ShapeNode is for shapes).


> |eg|
> 
> 
> -----Original Message-----
> From: Thomas DeWeese [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, October 29, 2003 11:36 AM
> To: Batik Users
> Subject: Re: Cutting out awt
> 
> 
> Grinvald, Edward wrote:
> 
> 
> 
>>I am trying to use batik's fascilities for parsing and rendering on a 
>>graphic platform other then awt/swing. In other words, i would like to
> 
> 
>>use everything in the JSVGCanvas, up to the point of actually putting
>>the shapes onto a Swing container. Instead, i'd like to have shapes 
>>expressed differently (let's say something like to a file for ASCII
> 
> art
> 
>>or something). Where would be the best place for me to "cut" in and
>>"redirect" the drawing of a shape from swing to elsewhere.
> 
> 
>     Well there exists Transcoders which go to things like JPEG/PNG. 
> These render to an offscreen image (a large array of ints one for each

> pixel).  This would be an excellent source of data for generating some

> forms of ASCII art.  However this still uses java.awt - but I suspect 
> you are referring to the GUI display parts of awt.
> 
> 
> 
> ---------------------------------------------------------------------
> 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]
> 
> 




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

Reply via email to