You Are Here:

Community: Developer Discussion Boards

#1 Old JSR 226 RI setTraintNS() bug? - 2005-12-30, 23:26

Join Date: Sep 2003
Posts: 17
jessicay
Offline
Registered User
Was checking out JSR 226 SVGT RI. Trying with Nokia prototype SDK.

simple.svg file
<?xml version="1.0" encoding="UTF-8"?>
<svg width="176" height="176"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xml:space="preserve" version="1.1" baseProfile="tiny">
<defs>
<rect id="rect" width="20" height="30" rx="3" fill="blue"/>
<circle id="circle" cx="15" cy="15" r="10" fill="yellow"/>
</defs>
<use id="displayshape" xlink:href="#rect"/>
</svg>

My MIDlet just trying to change the displayshape to circle instead. use the following code,

//get Document first
SVGElement shape = (SVGElement)(doc.getElementById("displayshape"));
shape.setFloatTrait("x", 30);
shape.setFloatTrait("y", 30);
shape.setTraitNS("http://www.w3.org/1999/xlink", "href", "#circle");
System.out.println("new href is"+shape.getTraitNS("http://www.w3.org/1999/xlink", "xlink:href"));

the element shown on screen does change the coordinates accordingly but not the shape, though the print out info for "new href" is "#circle". It does not matter if I use "xlink:href" instead of "href".

Counldn't find anything wrong. Anybody got ideas?

Thanks,
Reply With Quote

#2 Old Re: JSR 226 RI setTraintNS() bug? - 2007-04-12, 11:09

Join Date: Apr 2007
Posts: 2
Location: Germany
quarus
Offline
Registered User
Quote:
Originally Posted by jessicay
Was checking out JSR 226 SVGT RI. Trying with Nokia prototype SDK.

simple.svg file
<?xml version="1.0" encoding="UTF-8"?>
<svg width="176" height="176"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xml:space="preserve" version="1.1" baseProfile="tiny">
<defs>
<rect id="rect" width="20" height="30" rx="3" fill="blue"/>
<circle id="circle" cx="15" cy="15" r="10" fill="yellow"/>
</defs>
<use id="displayshape" xlink:href="#rect"/>
</svg>

My MIDlet just trying to change the displayshape to circle instead. use the following code,

//get Document first
SVGElement shape = (SVGElement)(doc.getElementById("displayshape"));
shape.setFloatTrait("x", 30);
shape.setFloatTrait("y", 30);
shape.setTraitNS("http://www.w3.org/1999/xlink", "href", "#circle");
System.out.println("new href is"+shape.getTraitNS("http://www.w3.org/1999/xlink", "xlink:href"));

the element shown on screen does change the coordinates accordingly but not the shape, though the print out info for "new href" is "#circle". It does not matter if I use "xlink:href" instead of "href".

Counldn't find anything wrong. Anybody got ideas?

Thanks,


*Sigh* .. 1.5 years later and this bug stilll seems not to be fixed. I try to change the "xlink:href" attribute in a <use> tag by invoking:

Code:
m_CurrentElement.setTraitNS("http://www.w3.org/1999/xlink", "href", "#Entry3");
But it doesn't work. Any hints? And btw: Is the JSR 226 implementation on a real NOKIA Phone broken as well?
Last edited by quarus : 2007-04-12 at 11:30.
Reply With Quote

#3 Old Re: JSR 226 RI setTraintNS() bug? - 2007-05-29, 19:49

Join Date: Mar 2003
Posts: 13
finesoft
Offline
Registered User
Hi,

Are there any news on this bug?

thks
Reply With Quote

#4 Old Re: JSR 226 RI setTraintNS() bug? - 2008-12-02, 20:12

Join Date: Dec 2008
Posts: 6
muntergator
Offline
Registered User
I see you wrote this in September 2003 .

Not exactly a timely reply then ....

I had a similar problem when I declared the elements I wanted to reuse in a defs element. This worked OK on the Sun emulator but not the Nokia S60 emulators. I believe lack of support for the defs element in SVG Tiny is the culprit. If I put the element I wanted to reuse in a g element instead which is supported by SVG Tiny 1.1 it worked Ok on the Nokia S60 emulators.


eg

SVGElement g = (SVGElement) doc.createElementNS(root.getNamespaceURI(), "g");
g.setId("example");

//Add elements for reuse as children to group g element.

...

root.appendChild(g);

//Starting reusing group
SVGElement use = (SVGElement) doc.createElementNS(root.getNamespaceURI(), "use");
use.setTraitNS("http://www.w3.org/1999/xlink",
"href",
"#example");
use.setFloatTrait("x", x1);
use.setFloatTrait("y", y1);
root.appendChild(use);
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
Jsr 226 Ri Nit1507 Mobile Java Media (Graphics & Sounds) 0 2005-08-17 14:50
S60 prototype SDK JSR 226 Simon.Chen Mobile Java Media (Graphics & Sounds) 0 2005-07-26 10:58
A bug: setColor with offscreen graphics - PLEASE, REPLY THIS TIME palmcrust Mobile Java General 11 2003-12-04 13:43
Firmware bug or code bug displaying list on 3650 blackjack75 Mobile Java General 2 2003-09-24 20:52
** Important ** Event bug in phone and emulator. fnagaton General Symbian C++ 8 2003-07-11 13:56

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia