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 vyang <vy...@apt-cafm.com> on 2008/06/12 22:41:17 UTC

MouseEvent getButton returns 0 for MouseDragged

MouseEvent getButton return 0 (NOBUTTON) when its inside a mouseDragged
method (using org.apache.batik.swing.gvt.InteractorAdapter) when the button
held down is BUTTON1.  Is this a bug or is it developed this way?
-- 
View this message in context: http://www.nabble.com/MouseEvent-getButton-returns-0-for-MouseDragged-tp17809275p17809275.html
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


Re: MouseEvent getButton returns 0 for MouseDragged

Posted by vyang <vy...@apt-cafm.com>.
Thanks Thomas, I'll look more into this from the swing side then.

vyang


thomas.deweese wrote:
> 
> Hi VYang,
> 
> vyang <vy...@apt-cafm.com> wrote on 06/12/2008 04:41:17 PM:
> 
>> MouseEvent getButton return 0 (NOBUTTON) when its inside a mouseDragged
>> method (using org.apache.batik.swing.gvt.InteractorAdapter) when the 
> button
>> held down is BUTTON1.  Is this a bug or is it developed this way?
> 
>    Well we just pass along the MouseEvent from Swing:
> 
>         public void mouseDragged(MouseEvent e) {
>                 [...]
>                 selectInteractor(e);
>             if (interactor != null) {
>                 interactor.mouseDragged(e);
>                 deselectInteractor();
>             } else if (eventDispatcher != null) {
>                 dispatchMouseDragged(e);
>             }
>         }
> 
> 

-- 
View this message in context: http://www.nabble.com/MouseEvent-getButton-returns-0-for-MouseDragged-tp17809275p17982396.html
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


Re: MouseEvent getButton returns 0 for MouseDragged

Posted by th...@kodak.com.
Hi VYang,

vyang <vy...@apt-cafm.com> wrote on 06/12/2008 04:41:17 PM:

> MouseEvent getButton return 0 (NOBUTTON) when its inside a mouseDragged
> method (using org.apache.batik.swing.gvt.InteractorAdapter) when the 
button
> held down is BUTTON1.  Is this a bug or is it developed this way?

   Well we just pass along the MouseEvent from Swing:

        public void mouseDragged(MouseEvent e) {
                [...]
                selectInteractor(e);
            if (interactor != null) {
                interactor.mouseDragged(e);
                deselectInteractor();
            } else if (eventDispatcher != null) {
                dispatchMouseDragged(e);
            }
        }