Hi Sand,

   I think you are mostly out of luck WRT Batik.  Batik makes
heavy use of Java2D which is not currently supported in J2ME.
Are you aware of the 'TinyLine' project?  This appears to be
what you want...

Sand Print wrote:

Thanks for your reply.
Let me tell you what I am trying to do.
I have to display an SVG file on a J2ME device. That is the reason that I am trying to use a very light parser, since the size is an issue. I guess I need to strip down the Batik API to reduce the size ; as my SVG file just needs to have basic functionality of display, zooming and panning.

Just ;)

I was thinking that I can do it in three steps - Parse, store as some tree structure and render.
I am not sure how I can plug the parser instead of Xerces, as Batik has a while package of micro parsers.

As I said if your parser supports SAX2 events you can replace a resource or override a method in the UserAgent class. The micro parsers are used to parse the results of parsing the XML :). They are probably one of the only pieces of Batik that will be of significant use to you - other than perhaps as a reference.

Is the css support essential for SVG rendering... Is it necessary for basic rendering also?

Full CSS is not required for any SVG implementation. However parts of CSS are required for all SVG implementations. The biggest pieces of this are inheritance (set fill on a 'g' element and all the children inherit it) and the style attribute (style="fill:blue; stroke:green")

Thanks a lot,
Sandy.



*/Thomas DeWeese <[EMAIL PROTECTED]>/* wrote:

    Sand Print wrote:

     > Thank you both for your reply.
     > I looked at the steps link, Cameron- it helped.
     > Following on that question, I am trying to parse an SVG file using a
     > very light parser. - so I get all the elements and attributes in
    the SVG
     > file. Now I need to stored it in some local data structure which
    can go
     > as an input to the renderer.

    The renderer essentially is the GVT tree. The input used to
    construct the GVT tree is the Batik DOM (which has support for
    CSS and various other stuff needed for SVG). The bridge package
    takes the DOM and builds the corresponding GVT tree.

     > I was going through the GVT classes. Can you tell me how the SVG
     > document is stored for the rendering process.

    The Bridge builds a tree of GVT nodes from the SVG. If you
    _really_really_really_ wanted to you! could write code to build
    your own GVT tree (essentially a duplicate of the Bridge) but since
    this is much of the work of Batik doing a complete job would be
    really hard.

    It is also worth pointing out that SVG makes fairly heavy use
    of forward/backwards references (gradients, use, patterns, clip,
    etc). For these you really need to store the whole tree.

    So I would suggest using your 'light parser' to build the
    Batik DOM (if your parser supports SAX 2 with namespaces you
    can simply tell Batik to use it instead of Xerces - the default).


> > Thanks a lot, > Sandy. > > */Cameron McCormack /* wrote: > > Hi Sandy. > > Sand Print: > > I am new to Batik and have just started exploring it. > > I am trying to understand the sequence of steps that the SVG file > goes > > thru to get rendered as an image. > > When the SVG f! ile gets parsed, how is it stored and how does the > > renderer get this data? What I mean is that is it stored as some > > datastructure that the renderer accepts? > > > > Urgently require an answer. Pls help. > > Have a look at the JavaDoc for the JSVGComponent class. It explains > the steps taken when an SVG document is loaded. > > http://xml.apache.org/batik/javadoc/org/apache/batik/swing/svg/JSVGComponent.html > > Cameron > > -- > Cameron McCormack > | Web: http://mcc.id.au/ > | ICQ: 26955922 > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > Do you Yahoo!? > Vote for the stars of Yahoo!'s next ad campaign! >


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Do you Yahoo!?
Vote for the stars of Yahoo!'s next ad campaign! <http://advision.webevents.yahoo.com/yahoo/votelifeengine/>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to