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 Andres Toussaint <an...@onemileup.com> on 2003/08/08 22:02:28 UTC

mousedrag and mousedown not detected

Hi all,

I am trying to create a drag SVG component within my JSVGCanvas, i have 
created and registered the listeners. My SVG has embedded SVG´s it reads 
from external files and PNG´s. I register each external item as a SVG 
component, when loading.

The EventListener gives me a proper event in the SVG components for the 
CLICK and OVER events, but no response for the DRAG, UP or DOWN events.

The PNG file responds to the CLICK, OVER, DOWN and DRAG events.

Basically what i want to accomplish is to drag inside the JSVGCanvas the 
individual SVG components. I have managed to accomplish dragging PNG´s 
only using ecmascript scripting functions in the SVG, but I need to be 
able to drag SVG´s also.

I am using j2SDK1.4.1_01, with Batik 1.5 on a windows 2000 professional 
system.

Any help or guidance will be trully appreciated.

Andres Toussaint










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


Re: rect element mouseclick triggers ClassCastExeption

Posted by Andres Toussaint <an...@onemileup.com>.
Hi Thomas, thanks for your support, i will try to track down the error.

Best regards, Andres,

Thomas DeWeese wrote:

> Hi Andres,
>
>    I think the problem is your code:
>
> > java.lang.ClassCastException
> >        at
> > com.onemileup.client.draw.BaseDrawing$OnDownAction.handleEvent(Unknown
> > Source)
>
>     The class cast exception is happening in com.onemileup code which
> is yours judging by your mail address.
>
> Andres Toussaint wrote:
>
>> Hello all,
>>
>> Previously I had a trouble with the mouseaction events on a 
>> JSVGCanvas, that Thomas DeWeese was so kind to solve for us (covered 
>> in the thread "mousedrag and mousedown not detected").
>>
>> My actual problem is i add a RECT element to my JSVGCanvas, doing this:
>> document = e.getSVGDocument();
>> documentElement = (SVGOMSVGElement)document.getDocumentElement();
>> Element imgGroup = documentElement.getElementById("imgGroup");
>> ....
>> Element rect = document.createElementNS(svgNS, "rect");
>> ....
>> imgGroup.appendChild(rect);
>>
>> Then register the action listeners, and when i do a mousemove, it 
>> gets registered ok, but a CLICK, DOWN or UP, throws the following error:
>> java.lang.ClassCastException
>>        at 
>> com.onemileup.client.draw.BaseDrawing$OnDownAction.handleEvent(Unknown 
>> Source)
>>        at 
>> org.apache.batik.dom.events.EventSupport.fireEventListeners(Unknown 
>> Source)
>>        at 
>> org.apache.batik.dom.events.EventSupport.dispatchEvent(Unknown Source)
>>        at org.apache.batik.dom.AbstractNode.dispatchEvent(Unknown 
>> Source)
>>        at 
>> org.apache.batik.bridge.BridgeEventSupport$Listener.dispatchMouseEvent(Unknown 
>> Source)
>>        at 
>> org.apache.batik.bridge.BridgeEventSupport$Listener.dispatchMouseEvent(Unknown 
>> Source)
>>        at 
>> org.apache.batik.bridge.BridgeEventSupport$Listener.mousePressed(Unknown 
>> Source)
>>        at 
>> org.apache.batik.gvt.event.AWTEventDispatcher.processMouseEvent(Unknown 
>> Source)
>>        at 
>> org.apache.batik.gvt.event.AWTEventDispatcher.dispatchMouseEvent(Unknown 
>> Source)
>>        at 
>> org.apache.batik.gvt.event.AWTEventDispatcher.dispatchEvent(Unknown 
>> Source)
>>        at 
>> org.apache.batik.gvt.event.AWTEventDispatcher.mousePressed(Unknown 
>> Source)
>>        at org.apache.batik.swing.svg.JSVGComponent$23.run(Unknown 
>> Source)
>>        at org.apache.batik.util.RunnableQueue.run(Unknown Source)
>>        at java.lang.Thread.run(Thread.java:536)
>>
>> I complied Batik 1.5 with only the patch files mentioned in
>> http://koala.ilog.fr/batik/mlists/batik-dev/archives/msg03536.html
>>
>>    * Subject: cvs commit:
>>      xml-batik/sources/org/apache/batik/script/rhino
>>      EventTargetWrapper.java
>>    * From: vhardy@apache.org <ma...@apache.org>
>>    * Date: 13 Jul 2003 22:30:57 -0000
>>    * To: xml-batik-cvs@apache.org <ma...@apache.org>
>>
>> I have not added any patches or other modifications to the Batik code.
>>
>> Thanks in advance,
>>
>> Andres Toussaint
>>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
>
>
>





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


Re: rect element mouseclick triggers ClassCastExeption

Posted by Thomas DeWeese <Th...@Kodak.com>.
Hi Andres,

    I think the problem is your code:

 > java.lang.ClassCastException
 >        at
 > com.onemileup.client.draw.BaseDrawing$OnDownAction.handleEvent(Unknown
 > Source)

     The class cast exception is happening in com.onemileup code which
is yours judging by your mail address.

Andres Toussaint wrote:
> Hello all,
> 
> Previously I had a trouble with the mouseaction events on a JSVGCanvas, 
> that Thomas DeWeese was so kind to solve for us (covered in the thread 
> "mousedrag and mousedown not detected").
> 
> My actual problem is i add a RECT element to my JSVGCanvas, doing this:
> document = e.getSVGDocument();
> documentElement = (SVGOMSVGElement)document.getDocumentElement();
> Element imgGroup = documentElement.getElementById("imgGroup");
> ....
> Element rect = document.createElementNS(svgNS, "rect");
> ....
> imgGroup.appendChild(rect);
> 
> Then register the action listeners, and when i do a mousemove, it gets 
> registered ok, but a CLICK, DOWN or UP, throws the following error:
> java.lang.ClassCastException
>        at 
> com.onemileup.client.draw.BaseDrawing$OnDownAction.handleEvent(Unknown 
> Source)
>        at 
> org.apache.batik.dom.events.EventSupport.fireEventListeners(Unknown Source)
>        at org.apache.batik.dom.events.EventSupport.dispatchEvent(Unknown 
> Source)
>        at org.apache.batik.dom.AbstractNode.dispatchEvent(Unknown Source)
>        at 
> org.apache.batik.bridge.BridgeEventSupport$Listener.dispatchMouseEvent(Unknown 
> Source)
>        at 
> org.apache.batik.bridge.BridgeEventSupport$Listener.dispatchMouseEvent(Unknown 
> Source)
>        at 
> org.apache.batik.bridge.BridgeEventSupport$Listener.mousePressed(Unknown 
> Source)
>        at 
> org.apache.batik.gvt.event.AWTEventDispatcher.processMouseEvent(Unknown 
> Source)
>        at 
> org.apache.batik.gvt.event.AWTEventDispatcher.dispatchMouseEvent(Unknown 
> Source)
>        at 
> org.apache.batik.gvt.event.AWTEventDispatcher.dispatchEvent(Unknown Source)
>        at 
> org.apache.batik.gvt.event.AWTEventDispatcher.mousePressed(Unknown Source)
>        at org.apache.batik.swing.svg.JSVGComponent$23.run(Unknown Source)
>        at org.apache.batik.util.RunnableQueue.run(Unknown Source)
>        at java.lang.Thread.run(Thread.java:536)
> 
> I complied Batik 1.5 with only the patch files mentioned in
> http://koala.ilog.fr/batik/mlists/batik-dev/archives/msg03536.html
> 
>    * Subject: cvs commit:
>      xml-batik/sources/org/apache/batik/script/rhino
>      EventTargetWrapper.java
>    * From: vhardy@apache.org <ma...@apache.org>
>    * Date: 13 Jul 2003 22:30:57 -0000
>    * To: xml-batik-cvs@apache.org <ma...@apache.org>
> 
> I have not added any patches or other modifications to the Batik code.
> 
> Thanks in advance,
> 
> Andres Toussaint
> 




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


rect element mouseclick triggers ClassCastExeption

Posted by Andres Toussaint <an...@onemileup.com>.
Hello all,

Previously I had a trouble with the mouseaction events on a JSVGCanvas, 
that Thomas DeWeese was so kind to solve for us (covered in the thread 
"mousedrag and mousedown not detected").

My actual problem is i add a RECT element to my JSVGCanvas, doing this:
document = e.getSVGDocument();
documentElement = (SVGOMSVGElement)document.getDocumentElement();
Element imgGroup = documentElement.getElementById("imgGroup");
....
Element rect = document.createElementNS(svgNS, "rect");
....
imgGroup.appendChild(rect);

Then register the action listeners, and when i do a mousemove, it gets 
registered ok, but a CLICK, DOWN or UP, throws the following error:
java.lang.ClassCastException
        at 
com.onemileup.client.draw.BaseDrawing$OnDownAction.handleEvent(Unknown 
Source)
        at 
org.apache.batik.dom.events.EventSupport.fireEventListeners(Unknown Source)
        at 
org.apache.batik.dom.events.EventSupport.dispatchEvent(Unknown Source)
        at org.apache.batik.dom.AbstractNode.dispatchEvent(Unknown Source)
        at 
org.apache.batik.bridge.BridgeEventSupport$Listener.dispatchMouseEvent(Unknown 
Source)
        at 
org.apache.batik.bridge.BridgeEventSupport$Listener.dispatchMouseEvent(Unknown 
Source)
        at 
org.apache.batik.bridge.BridgeEventSupport$Listener.mousePressed(Unknown 
Source)
        at 
org.apache.batik.gvt.event.AWTEventDispatcher.processMouseEvent(Unknown 
Source)
        at 
org.apache.batik.gvt.event.AWTEventDispatcher.dispatchMouseEvent(Unknown 
Source)
        at 
org.apache.batik.gvt.event.AWTEventDispatcher.dispatchEvent(Unknown Source)
        at 
org.apache.batik.gvt.event.AWTEventDispatcher.mousePressed(Unknown Source)
        at org.apache.batik.swing.svg.JSVGComponent$23.run(Unknown Source)
        at org.apache.batik.util.RunnableQueue.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:536)

I complied Batik 1.5 with only the patch files mentioned in
http://koala.ilog.fr/batik/mlists/batik-dev/archives/msg03536.html

    * Subject: cvs commit:
      xml-batik/sources/org/apache/batik/script/rhino
      EventTargetWrapper.java
    * From: vhardy@apache.org <ma...@apache.org>
    * Date: 13 Jul 2003 22:30:57 -0000
    * To: xml-batik-cvs@apache.org <ma...@apache.org>

I have not added any patches or other modifications to the Batik code.

Thanks in advance,

Andres Toussaint

Re: mousedrag and mousedown not detected

Posted by Andres Toussaint <an...@onemileup.com>.
Works perfect now. Thanks.

I compiled the source from Batik 1.5, changing only the 6 files 
mentioned in the patch, and made the Jar files with the Ant script.

Now all objects (SVG and PNG) respond to the DOWN, UP, DRAG, MOVE, OVER 
and CLICK.

Thank you for the fast response and support.

Andres.




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


Re: mousedrag and mousedown not detected

Posted by Thomas DeWeese <Th...@Kodak.com>.
Andres Toussaint wrote:
> Sorry to put you to work. Please post to the mailing list when you have 
> a solution or workaround for this situation, also if i can assist in any 
> way, i will be glad to try.

   It is in CVS now.  You can check the archives of batik-dev for
the commit message to get the patch.

> Thomas DeWeese wrote:
> 
>> Andres Toussaint wrote:
>>
>>> Hi Thomas, i appreciate your response.
>>>
>>> I recreated a simplified setup of my problem, based on the basic 
>>> JSVGCanvas sample on the Batik web page, and added the Java Scripting 
>>> code. Basically i have a SVG definition that loads four other SVG´s. 
>>> and a PNG, and activates the proper mouse listeners. A label displays 
>>> the result of the actions.
>>>
>>> The Actions get triggered, for the 4 SVG files that belong to the 
>>> 'imgGroup' (see below) are only OVER and CLICK.
>>> The Actions triggered for the PNG, that also belong to the 'imgGroup' 
>>> are OVER, MOVE, DRAG and CLICK.
>>>
>>> I do not get any response out of  UP or DOWN actions.
>>>
>>> The 1.svg, 2.svg, 3.svg and 4.svg files are plain vector 
>>> illustrations created by exporting SVG from Adobe Illustrator,
>>>
>>> Following is the SVG and JAVA files that i am using.
>>
>>
>>
>>     This is a bug I'm looking into it, not all event types are forwarded
>> from the DOM referenced by the image element.
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>> For additional commands, e-mail: batik-users-help@xml.apache.org
>>
>>
>>
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
> 
> 




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


Re: mousedrag and mousedown not detected

Posted by Andres Toussaint <an...@onemileup.com>.
Sorry to put you to work. Please post to the mailing list when you have 
a solution or workaround for this situation, also if i can assist in any 
way, i will be glad to try.

Andres.

Thomas DeWeese wrote:

> Andres Toussaint wrote:
>
>> Hi Thomas, i appreciate your response.
>>
>> I recreated a simplified setup of my problem, based on the basic 
>> JSVGCanvas sample on the Batik web page, and added the Java Scripting 
>> code. Basically i have a SVG definition that loads four other SVG´s. 
>> and a PNG, and activates the proper mouse listeners. A label displays 
>> the result of the actions.
>>
>> The Actions get triggered, for the 4 SVG files that belong to the 
>> 'imgGroup' (see below) are only OVER and CLICK.
>> The Actions triggered for the PNG, that also belong to the 'imgGroup' 
>> are OVER, MOVE, DRAG and CLICK.
>>
>> I do not get any response out of  UP or DOWN actions.
>>
>> The 1.svg, 2.svg, 3.svg and 4.svg files are plain vector 
>> illustrations created by exporting SVG from Adobe Illustrator,
>>
>> Following is the SVG and JAVA files that i am using.
>
>
>     This is a bug I'm looking into it, not all event types are forwarded
> from the DOM referenced by the image element.
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
>
>
>





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


Re: mousedrag and mousedown not detected

Posted by Thomas DeWeese <Th...@Kodak.com>.
Andres Toussaint wrote:
> Hi Thomas, i appreciate your response.
> 
> I recreated a simplified setup of my problem, based on the basic 
> JSVGCanvas sample on the Batik web page, and added the Java Scripting 
> code. Basically i have a SVG definition that loads four other SVG´s. and 
> a PNG, and activates the proper mouse listeners. A label displays the 
> result of the actions.
> 
> The Actions get triggered, for the 4 SVG files that belong to the 
> 'imgGroup' (see below) are only OVER and CLICK.
> The Actions triggered for the PNG, that also belong to the 'imgGroup' 
> are OVER, MOVE, DRAG and CLICK.
> 
> I do not get any response out of  UP or DOWN actions.
> 
> The 1.svg, 2.svg, 3.svg and 4.svg files are plain vector illustrations 
> created by exporting SVG from Adobe Illustrator,
> 
> Following is the SVG and JAVA files that i am using.

     This is a bug I'm looking into it, not all event types are forwarded
from the DOM referenced by the image element.





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


Re: mousedrag and mousedown not detected

Posted by Andres Toussaint <an...@onemileup.com>.
Hi Thomas, i appreciate your response.

I recreated a simplified setup of my problem, based on the basic 
JSVGCanvas sample on the Batik web page, and added the Java Scripting 
code. Basically i have a SVG definition that loads four other SVG´s. and 
a PNG, and activates the proper mouse listeners. A label displays the 
result of the actions.

The Actions get triggered, for the 4 SVG files that belong to the 
'imgGroup' (see below) are only OVER and CLICK.
The Actions triggered for the PNG, that also belong to the 'imgGroup' 
are OVER, MOVE, DRAG and CLICK.

I do not get any response out of  UP or DOWN actions.

The 1.svg, 2.svg, 3.svg and 4.svg files are plain vector illustrations 
created by exporting SVG from Adobe Illustrator,

Following is the SVG and JAVA files that i am using.
Thanks in advance.
---------- Start of SVG file:
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" 
 "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg width="500" height="200" viewBox="0 0 500 200" 
xmlns="http://www.w3.org/2000/svg" 
xmlns:xlink="http://www.w3.org/1999/xlink" >

   <g id="imgGroup">
      <image x="20" y="20" width="100" height="100"
             xlink:href="1.svg"/>
      <image x="150" y="20" width="100" height="100"
             xlink:href="2.svg"/>
      <image x="260" y="20" width="100" height="100"
             xlink:href="3.svg"/>
      <image x="370" y="20" width="100" height="100"
             xlink:href="4.svg"/>
      <image x="200" y="120" width="100" height="80"
             xlink:href="1.png"/>
   </g>
</svg>
---------- End of SVG file


---------- Start of JAVA file:
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import javax.swing.*;

import org.apache.batik.swing.JSVGCanvas;
import org.apache.batik.swing.gvt.GVTTreeRendererAdapter;
import org.apache.batik.swing.gvt.GVTTreeRendererEvent;
import org.apache.batik.swing.svg.SVGDocumentLoaderAdapter;
import org.apache.batik.swing.svg.SVGDocumentLoaderEvent;
import org.apache.batik.swing.svg.GVTTreeBuilderAdapter;
import org.apache.batik.swing.svg.GVTTreeBuilderEvent;
import org.apache.batik.swing.svg.SVGLoadEventDispatcherAdapter;
import org.apache.batik.swing.svg.SVGLoadEventDispatcherEvent;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.events.EventTarget;
import org.w3c.dom.events.EventListener;
import org.w3c.dom.events.Event;
import org.apache.batik.script.Window;

public class batikDemo {

    public static void main(String[] args) {
        JFrame f = new JFrame("Batik");
        batikDemo app = new batikDemo(f);
       
        f.getContentPane().add(app.createComponents());

        f.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
                System.exit(0);
            }
        });
        f.setSize(400, 400);
        f.setVisible(true);
    }
   
    JFrame frame;
    JButton button = new JButton("Load...");
    JLabel label = new JLabel();
    JSVGCanvas svgCanvas = new JSVGCanvas();
    Document document;
    Window window;

   
    public batikDemo(JFrame f) {
        frame = f;
    }

    public JComponent createComponents() {
        final JPanel panel = new JPanel(new BorderLayout());

        JPanel p = new JPanel(new FlowLayout(FlowLayout.LEFT));
        p.add(button);
        p.add(label);

        panel.add("North", p);
        panel.add("Center", svgCanvas);

        svgCanvas.setDocumentState(JSVGCanvas.ALWAYS_DYNAMIC);
        svgCanvas.addSVGLoadEventDispatcherListener
            (new SVGLoadEventDispatcherAdapter() {
                    public void svgLoadEventDispatchStarted
                        (SVGLoadEventDispatcherEvent e) {
                        // At this time the document is available...
                        document = svgCanvas.getSVGDocument();
                        // ...and the window object too.
                        window = svgCanvas.getUpdateManager().
                            getScriptingEnvironment().createWindow();
                        // Registers the listeners on the document
                        // just before the SVGLoad event is
                        // dispatched.
                        registerListeners();
                        // It is time to pack the frame.
                        frame.pack();
                    }
                });
       
        // Set the button action.
        button.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent ae) {
                JFileChooser fc = new JFileChooser(".");
                int choice = fc.showOpenDialog(panel);
                if (choice == JFileChooser.APPROVE_OPTION) {
                    File f = fc.getSelectedFile();
                    try {
                        svgCanvas.setURI(f.toURL().toString());
                    } catch (IOException ex) {
                        ex.printStackTrace();
                    }
                }
            }
        });
               
        // Set the JSVGCanvas listeners.
        svgCanvas.addSVGDocumentLoaderListener(new 
SVGDocumentLoaderAdapter() {
            public void documentLoadingStarted(SVGDocumentLoaderEvent e) {
                label.setText("Document Loading...");
            }
            public void documentLoadingCompleted(SVGDocumentLoaderEvent e) {
                label.setText("Document Loaded.");
            }
        });

        svgCanvas.addGVTTreeBuilderListener(new GVTTreeBuilderAdapter() {
            public void gvtBuildStarted(GVTTreeBuilderEvent e) {
                label.setText("Build Started...");
            }
            public void gvtBuildCompleted(GVTTreeBuilderEvent e) {
                label.setText("Build Done.");
                frame.pack();
            }
        });

        svgCanvas.addGVTTreeRendererListener(new GVTTreeRendererAdapter() {
            public void gvtRenderingPrepare(GVTTreeRendererEvent e) {
                label.setText("Rendering Started...");
            }
            public void gvtRenderingCompleted(GVTTreeRendererEvent e) {
                label.setText("");
            }
        });

        return panel;
    }
   
    //Items added for action detection
   
    public void registerListeners() {
        // Gets an element from the loaded document.
        Element elt = document.getElementById("imgGroup");
        EventTarget t = (EventTarget)elt;
        // Adds a 'onclick' listener
        t.addEventListener("click", new OnClickAction(), false);
                // Adds a 'mousedown' listener
        t.addEventListener("mousedown", new OnDownAction(), false);
                // Adds a 'mouseup' listener
        t.addEventListener("mouseup", new OnUpAction(), false);
                // Adds a 'mouseover' listener
        t.addEventListener("mouseover", new OnOverAction(), false);
                // Adds a 'mousemove' listener
        t.addEventListener("mousemove", new OnMouseMoveAction(), false);
                // Adds a 'drag' listener
        t.addEventListener("drag", new OnDragAction(), false);
    }

    public class OnClickAction implements EventListener {
        public void handleEvent(Event evt) {
                label.setText("Click: "+evt.getTarget());
                System.out.println("Click: "+evt.getTarget());
        }
    }
    public class OnDownAction implements EventListener {
        public void handleEvent(Event evt) {
                label.setText("Down: "+evt.getTarget());
        }
    }
    public class OnUpAction implements EventListener {
        public void handleEvent(Event evt) {
                label.setText("Up: "+evt.getTarget());
        }
    }
    public class OnOverAction implements EventListener {
        public void handleEvent(Event evt) {
                label.setText("Over: "+evt.getTarget());
        }
    }
    public class OnDragAction implements EventListener {
        public void handleEvent(Event evt) {
                label.setText("Drag: "+evt.getTarget());
        }
    }
    public class OnMouseMoveAction implements EventListener {
        public void handleEvent(Event evt) {
                label.setText("MouseMove: "+evt.getTarget());
        }
    }
}
---------- End of JAVA file
Thomas DeWeese wrote:

> Hi Andres,
>
>    One other thing it's not mousedrag it's mousemove or
> <rect onmousemove="foo(evt)" .../>
>
>    SVG (DOM Events really) doesn't define 'drag' events.
> It's up to you to track onmousedown, onmousemove, onmouseup.
>
>
> Thomas DeWeese wrote:
>
>> Andres Toussaint wrote:
>>
>>> Hi all,
>>>
>>> I am trying to create a drag SVG component within my JSVGCanvas, i 
>>> have created and registered the listeners. My SVG has embedded SVG´s 
>>> it reads from external files and PNG´s. I register each external 
>>> item as a SVG component, when loading.
>>>
>>> The EventListener gives me a proper event in the SVG components for 
>>> the CLICK and OVER events, but no response for the DRAG, UP or DOWN 
>>> events.
>>>
>>> The PNG file responds to the CLICK, OVER, DOWN and DRAG events.
>>>
>>> Basically what i want to accomplish is to drag inside the JSVGCanvas 
>>> the individual SVG components. I have managed to accomplish dragging 
>>> PNG´s only using ecmascript scripting functions in the SVG, but I 
>>> need to be able to drag SVG´s also.
>>>
>>> I am using j2SDK1.4.1_01, with Batik 1.5 on a windows 2000 
>>> professional system.
>>>
>>> Any help or guidance will be trully appreciated.
>>
>>
>>
>> Can you provide a reproducable test case?  I drag all sorts of things
>> all the time.
>>
>>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
>
>
>





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


Re: mousedrag and mousedown not detected

Posted by Thomas DeWeese <Th...@Kodak.com>.
Hi Andres,

    One other thing it's not mousedrag it's mousemove or
<rect onmousemove="foo(evt)" .../>

    SVG (DOM Events really) doesn't define 'drag' events.
It's up to you to track onmousedown, onmousemove, onmouseup.


Thomas DeWeese wrote:
> Andres Toussaint wrote:
> 
>> Hi all,
>>
>> I am trying to create a drag SVG component within my JSVGCanvas, i 
>> have created and registered the listeners. My SVG has embedded SVG´s 
>> it reads from external files and PNG´s. I register each external item 
>> as a SVG component, when loading.
>>
>> The EventListener gives me a proper event in the SVG components for 
>> the CLICK and OVER events, but no response for the DRAG, UP or DOWN 
>> events.
>>
>> The PNG file responds to the CLICK, OVER, DOWN and DRAG events.
>>
>> Basically what i want to accomplish is to drag inside the JSVGCanvas 
>> the individual SVG components. I have managed to accomplish dragging 
>> PNG´s only using ecmascript scripting functions in the SVG, but I need 
>> to be able to drag SVG´s also.
>>
>> I am using j2SDK1.4.1_01, with Batik 1.5 on a windows 2000 
>> professional system.
>>
>> Any help or guidance will be trully appreciated.
> 
> 
> Can you provide a reproducable test case?  I drag all sorts of things
> all the time.
> 
> 




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


Re: mousedrag and mousedown not detected

Posted by Thomas DeWeese <Th...@Kodak.com>.
Andres Toussaint wrote:
> Hi all,
> 
> I am trying to create a drag SVG component within my JSVGCanvas, i have 
> created and registered the listeners. My SVG has embedded SVG´s it reads 
> from external files and PNG´s. I register each external item as a SVG 
> component, when loading.
> 
> The EventListener gives me a proper event in the SVG components for the 
> CLICK and OVER events, but no response for the DRAG, UP or DOWN events.
> 
> The PNG file responds to the CLICK, OVER, DOWN and DRAG events.
> 
> Basically what i want to accomplish is to drag inside the JSVGCanvas the 
> individual SVG components. I have managed to accomplish dragging PNG´s 
> only using ecmascript scripting functions in the SVG, but I need to be 
> able to drag SVG´s also.
> 
> I am using j2SDK1.4.1_01, with Batik 1.5 on a windows 2000 professional 
> system.
> 
> Any help or guidance will be trully appreciated.

Can you provide a reproducable test case?  I drag all sorts of things
all the time.



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