×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Dec 2009
    Posts
    2

    Unhappy question with dispatching mouse events to svg element

    Hi, I'm working on project for drawing some shapes on touch-enabled nokia phones. I chose SVG to draw the shapes. The requirement also includes interactions between users and these shapes. For example, users may tap a circle on the screen to do something. The problem is the mouse event cannot be dispatched to SVG model. What I did like this:

    I use SVGAnimator to render all shapes,

    ---------------------------------------------------------------
    SVGImage img = SVGImage.create...
    SVGAnimator animator = SVGAnimator.createAnimator(img);

    // ... bind to screen display

    animator.setSVGEventListener(new SVGEventListener()
    {
    //...
    public void pointerPressed(int x, int y)
    {
    img.dispatchMouseEvent("click", x, y);
    }
    //...
    });

    // ...

    SVGElement oneCircle =
    (SVGElement)img.getDocument().getElementById("circle1")
    oneCircle.addEventListener("click", new EventListener()
    {
    public void handleEvent(Event evt){
    // handle the event
    }
    }, false);

    ---------------------------------------------------------------

    But the event listener registered to the circle was never notified.

    Can anybody help me out? is anything I did wrong?

  2. #2
    Registered User
    Join Date
    Jun 2008
    Posts
    7

    Re: question with dispatching mouse events to svg element

    Hi,

    Take a look at this link:

    http://netbeans.org/kb/docs/javame/svgtouch.html

    I hope it helps.

    Cheers

Similar Threads

  1. question with dispatching mouse events to svg element
    By fanhaipeng in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2009-12-25, 16:34
  2. TinyLine SVG Player and SDK 1.8.2 released.
    By girow in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2005-03-10, 07:31
  3. TinyLine SVG Player and SDK 1.8.2 released.
    By girow in forum Mobile Java General
    Replies: 0
    Last Post: 2005-03-10, 07:30
  4. ANN TinyLine SVG Player 1.7
    By girow in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2004-05-10, 12:09
  5. ANN TinyLine SVG Player 1.7
    By girow in forum Mobile Java General
    Replies: 0
    Last Post: 2004-05-10, 12:08

Posting Permissions

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