×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Sep 2003
    Posts
    17

    JSR 226 RI setTraintNS() bug?

    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,

  2. #2
    Registered User
    Join Date
    Apr 2007
    Location
    Germany
    Posts
    2

    Re: JSR 226 RI setTraintNS() bug?

    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 10:30.

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    13

    Re: JSR 226 RI setTraintNS() bug?

    Hi,

    Are there any news on this bug?

    thks

  4. #4
    Registered User
    Join Date
    Dec 2008
    Posts
    6

    Re: JSR 226 RI setTraintNS() bug?

    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);

Similar Threads

  1. Jsr 226 Ri
    By Nit1507 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2005-08-17, 13:50
  2. S60 prototype SDK JSR 226
    By Simon.Chen in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2005-07-26, 09:58
  3. A bug: setColor with offscreen graphics - PLEASE, REPLY THIS TIME
    By palmcrust in forum Mobile Java General
    Replies: 11
    Last Post: 2003-12-04, 12:43
  4. Firmware bug or code bug displaying list on 3650
    By blackjack75 in forum Mobile Java General
    Replies: 2
    Last Post: 2003-09-24, 19:52
  5. Replies: 8
    Last Post: 2003-07-11, 12:56

Posting Permissions

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