You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Peppe <pe...@gmail.com> on 2006/11/20 12:51:51 UTC

getAttribute style

Hi, i would modified only fill color of selected shape (shape has many values
in style attribute), but fill is in style attribute...how can i modified it
leaving unchanged other value of style attribute?
-- 
View this message in context: http://www.nabble.com/getAttribute-style-tf2668578.html#a7441192
Sent from the Batik - Users mailing list archive at Nabble.com.


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


Re: getAttribute style

Posted by Peppe <pe...@gmail.com>.


Phil Wright-2 wrote:
> 
> You could take the "fill" out of your "style" attribute and set it
> separately.
> 
> e.setAttributeNS(null, "fill", "blue");
> 

No, because in my project i load svgfile and then i modify it. In these
files is used attribute "style" so must to modify they...
-- 
View this message in context: http://www.nabble.com/getAttribute-style-tf2668578.html#a7468493
Sent from the Batik - Users mailing list archive at Nabble.com.


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


Re: getAttribute style

Posted by Phil Wright <ph...@gmail.com>.
You could take the "fill" out of your "style" attribute and set it
separately.

e.setAttributeNS(null, "fill", "blue");

Fill, stroke, stroke-width can all be set separately.

   Phil

On 11/20/06, Peppe <pe...@gmail.com> wrote:
>
>
> Hi, i would modified only fill color of selected shape (shape has many
> values
> in style attribute), but fill is in style attribute...how can i modified
> it
> leaving unchanged other value of style attribute?
> --
> View this message in context:
> http://www.nabble.com/getAttribute-style-tf2668578.html#a7441192
> Sent from the Batik - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>
>


-- 
Visit http://www.darkisle.com for photos of castles, cairns and other
historic sites in the British Isles.

Re: getAttribute style

Posted by Peppe <pe...@gmail.com>.


Tonny Kohar wrote:
> 
> 
> If I am not wrong SVGElement is implement SVGStylable interface. Check
> the source file or Javadocs. So just simple casting will work.
> 
> 

I'm crazy, sorry...you have reason...now it works...
-- 
View this message in context: http://www.nabble.com/getAttribute-style-tf2668578.html#a7526843
Sent from the Batik - Users mailing list archive at Nabble.com.


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


Re: getAttribute style

Posted by Tonny Kohar <to...@kiyut.com>.
Hi,

On Thu, 2006-11-23 at 01:31 -0800, Peppe wrote:
> > 
> >    You need to use the DOM Level 2 Style interfaces:
> >         http://www.w3.org/TR/DOM-Level-2-Style/java-binding.html
> > 
> >   In particular something like:
> >         String val = element.getStyle().getPropertyValue("fill");
> >   and
> >         element.getStyle().setProperty("fill", "blue", "")
> > 
> > 
> I tried to use the dom level 2 style but i don't understand how do it,
> because getStyle is a method of SVGStylable class but i have to modify an
> element...

If I am not wrong SVGElement is implement SVGStylable interface. Check
the source file or Javadocs. So just simple casting will work.

Regards
Tonny Kohar
-- 
Sketsa 
SVG Graphics Editor
http://www.kiyut.com


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


Re: getAttribute style

Posted by Peppe <pe...@gmail.com>.


thomas.deweese wrote:
> 
> Hi Peppe,
> 
> Peppe <pe...@gmail.com> wrote on 11/20/2006 06:51:51 AM:
> 
>> Hi, i would modified only fill color of selected shape (shape has many 
> values
>> in style attribute), but fill is in style attribute...how can i modified 
> it
>> leaving unchanged other value of style attribute?
> 
>    You need to use the DOM Level 2 Style interfaces:
>         http://www.w3.org/TR/DOM-Level-2-Style/java-binding.html
> 
>   In particular something like:
>         String val = element.getStyle().getPropertyValue("fill");
>   and
>         element.getStyle().setProperty("fill", "blue", "")
> 
> 
I tried to use the dom level 2 style but i don't understand how do it,
because getStyle is a method of SVGStylable class but i have to modify an
element...

-- 
View this message in context: http://www.nabble.com/getAttribute-style-tf2668578.html#a7501049
Sent from the Batik - Users mailing list archive at Nabble.com.


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


Re: getAttribute style

Posted by th...@kodak.com.
Hi Peppe,

Peppe <pe...@gmail.com> wrote on 11/20/2006 06:51:51 AM:

> Hi, i would modified only fill color of selected shape (shape has many 
values
> in style attribute), but fill is in style attribute...how can i modified 
it
> leaving unchanged other value of style attribute?

   You need to use the DOM Level 2 Style interfaces:
        http://www.w3.org/TR/DOM-Level-2-Style/java-binding.html

  In particular something like:
        String val = element.getStyle().getPropertyValue("fill");
  and
        element.getStyle().setProperty("fill", "blue", "");


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