xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thomas.dewe...@kodak.com
Subject Re: Double click not working
Date Tue, 11 Sep 2007 10:53:53 GMT
Hi JavaNoob,

javaNoob <noypi_baller@yahoo.com> wrote on 09/07/2007 12:08:07 PM:

> i saw i code here that can handle double click:
> 
>                 if(evt instanceof org.w3c.dom.events.MouseEvent) {
>                     MouseEvent me = (MouseEvent)evt;
>                     int clickCount = me.getClickCount();
>                 }

   You have mixed DOM MouseEvent and AWT MouseEvent.  So your cast
(and receiving reference) need to be org.w3c.dom.events.MouseEvent
not just MouseEvent.

> but after trying the code i get this errors
> 
> java.lang.ClassCastException: org.apache.batik.dom.events.DOMMouseEvent
> cannot be cast to java.awt.event.MouseEvent
>         at
> edu.citynavigator.map.editor.MapCanvas$OnDownAction.
> handleEvent(MapCanvas.java:399)
>         at
> org.apache.batik.dom.events.EventSupport.fireEventListeners(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.AbstractAWTEventDispatcher.
> processMouseEvent(Unknown
> Source)
>         at
> org.apache.batik.gvt.event.AbstractAWTEventDispatcher.
> dispatchMouseEvent(Unknown
> Source)
>         at
> 
org.apache.batik.gvt.event.AbstractAWTEventDispatcher.dispatchEvent(Unknown
> Source)
>         at
> org.apache.batik.gvt.event.AWTEventDispatcher.dispatchEvent(Unknown 
Source)
>         at
> 
org.apache.batik.gvt.event.AbstractAWTEventDispatcher.mousePressed(Unknown
> Source)
>         at 
org.apache.batik.swing.svg.AbstractJSVGComponent$18.run(Unknown
> Source)
>         at org.apache.batik.util.RunnableQueue.run(Unknown Source)
>         at java.lang.Thread.run(Thread.java:619)
> 
> it seems that the event that i get from the handleEvent is a 
DOMMouseEvent..
> what am i doing wrong here?
> -- 
> View this message in context: http://www.nabble.com/Double-click-
> not-working-tf4402141.html#a12558309
> 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
> 


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


Mime
View raw message