[prev in list] [next in list] [prev in thread] [next in thread] 

List:       batik-users
Subject:    Re: Getting CSS values
From:       Thomas E Deweese <thomas.deweese () kodak ! com>
Date:       2003-04-25 11:13:27
[Download RAW message or body]

>>>>> "CM" == Cameron McCormack <clm@csse.monash.edu.au> writes:

CM> Cameron McCormack:
>> How do you manipulate the CSS of SVG Elements?

CM> OK, I have come to the conclusion that I use the getComputedStyle
CM> method of the ViewCSS interface to get the current style of an
CM> object.  I ran into the same problems, though, as described in
CM> this post from the archive:

CM>
CM> http://koala.ilog.fr/batik/mlists/batik-users/archives/msg02176.html

CM> This says that "You get a NullPointerException because you do not
CM> initialize the CSSEngine.  In Batik this is done in
CM> org.apache.batik.bridge.BridgeContext."

CM> So how do I initialise the CSSEngine for my SVGDocument?  Do I
CM> need to create a BridgeContext which will do this for me?  Can I
CM> initialise the CSSEngine myself?

    You should be able to initialize the CSSEngine yourself without
the bridge context (just follow the code in the bridge context as an
example - I think you need to provide some sort of UserAgent
interface), but depending on what you are planning on doing you may
still want to use the Bridge.  

    In particular by using the bridge to build the rendering tree you
can use all the nice SVG DOM methods to query geometry etc.  However,
if you have no need for the rendering tree just initializing the
CSSEngine should be faster and use less memory.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic