Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » single click vs double click in draw2d
single click vs double click in draw2d [message #201194] Mon, 31 October 2005 06:32 Go to next message
Andrew Eisenberg is currently offline Andrew EisenbergFriend
Messages: 77
Registered: July 2009
Member
Hi,

I am working in draw2d (not GEF) and I need a MouseListener object to react
differently to a mouse double click event and a mouse click (simulated by a
mouse press event followed by a mouse release event). However, I don't know
how to do this.

The problem is that the listener will receive mouse press and release events
before receiving the double-click event, and as far as I know, there's no
way to ignore the mouse press/release iff there is a double click coming
next.

Has anyone solved this problem?

thanks,
andrew eisenberg
Re: single click vs double click in draw2d [message #201250 is a reply to message #201194] Mon, 31 October 2005 14:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Seems pretty simple to me:

click:
MouseDown
MouseUp

not a click:
MouseDown
MouseDoubleClick
MouseUp

"Andrew Eisenberg" <ade@cs.ubc.ca> wrote in message
news:dk4dpd$bst$1@news.eclipse.org...
> Hi,
>
> I am working in draw2d (not GEF) and I need a MouseListener object to
> react
> differently to a mouse double click event and a mouse click (simulated by
> a
> mouse press event followed by a mouse release event). However, I don't
> know
> how to do this.
>
> The problem is that the listener will receive mouse press and release
> events
> before receiving the double-click event, and as far as I know, there's no
> way to ignore the mouse press/release iff there is a double click coming
> next.
>
> Has anyone solved this problem?
>
> thanks,
> andrew eisenberg
>
>
Re: single click vs double click in draw2d [message #201310 is a reply to message #201250] Mon, 31 October 2005 15:48 Go to previous messageGo to next message
Andrew Eisenberg is currently offline Andrew EisenbergFriend
Messages: 77
Registered: July 2009
Member
It's actually not like that:

Click looks like this::
MouseDown
MouseUp

Double Click looks like this:
MouseDown
MouseUp <=== I need to know here if I should do the single click or the
double click
MouseDown
DoubleClick
MouseUp



"Randy Hudson" <none@us.ibm.com> wrote in message
news:dk58e0$cdv$1@news.eclipse.org...
> Seems pretty simple to me:
>
> click:
> MouseDown
> MouseUp
>
> not a click:
> MouseDown
> MouseDoubleClick
> MouseUp
>
> "Andrew Eisenberg" <ade@cs.ubc.ca> wrote in message
> news:dk4dpd$bst$1@news.eclipse.org...
> > Hi,
> >
> > I am working in draw2d (not GEF) and I need a MouseListener object to
> > react
> > differently to a mouse double click event and a mouse click (simulated
by
> > a
> > mouse press event followed by a mouse release event). However, I don't
> > know
> > how to do this.
> >
> > The problem is that the listener will receive mouse press and release
> > events
> > before receiving the double-click event, and as far as I know, there's
no
> > way to ignore the mouse press/release iff there is a double click coming
> > next.
> >
> > Has anyone solved this problem?
> >
> > thanks,
> > andrew eisenberg
> >
> >
>
>
Re: single click vs double click in draw2d [message #203102 is a reply to message #201310] Thu, 17 November 2005 15:57 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

We handle this case for you in the SelectEditPartTracker. The only way to
handle it is to do what the windows desktop does. You have to create a timer
and look for the double-click event before the timer goes off. Unfortunately
you'll have to guess how long the timer should be since the double-click
threshold is not exposed through SWT.

"Andrew Eisenberg" <ade@cs.ubc.ca> wrote in message
news:dk5edm$llq$1@news.eclipse.org...
> It's actually not like that:
>
> Click looks like this::
> MouseDown
> MouseUp
>
> Double Click looks like this:
> MouseDown
> MouseUp <=== I need to know here if I should do the single click or the
> double click
> MouseDown
> DoubleClick
> MouseUp
>
>
Previous Topic:How is EditPart get disposed when EditPartViewer is disposed
Next Topic:AssertionFailedException with DND of binary type
Goto Forum:
  


Current Time: Thu Dec 05 15:26:03 GMT 2024

Powered by FUDForum. Page generated in 0.05464 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top