That seems to do the trick.  Thanks!

- Bibek


On Wed, 11 Feb 2004, Cameron McCormack wrote:

> Hi Bibek.
>
> Bibek Sahu:
> > How do I get the calculated property associated with an element?  For
> > example, suppose I have the code:
>
> > ...
>
> > I've tried using SVGStylable.getPresentationAttribute(DOMString), but I
> > keep getting DOMExceptions:
>
> getPresentationAttribute returns a CSSValue that represents the actual
> XML presentation attribute, not the computed style property.  What you
> really want to do is get the computed style declaration and then get
> the individual properties from that.
>
>   Element e = ...;
>   SVGElement svg = (SVGElement) e.getOwnerDocument().getDocumentElement();
>   CSSStyleDeclaration style = svg.getComputedStyle(e, null);
>   // then you can get properties by string value...
>   String value = style.getPropertyValue("fill");
>   // ...or by CSSValue
>   CSSValue value = style.getPropertyCSSValue("fill");
>
> Cameron
>
> --
> Cameron McCormack
> |  Web: http://mcc.id.au/
> |  ICQ: 26955922


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

Reply via email to