Skip to main content



      Home
Home » Eclipse Projects » GEF » draw2d
draw2d [message #69797] Thu, 13 March 2003 03:23 Go to next message
Eclipse UserFriend
Originally posted by: lrau.telemobil.ro

Hi,

I want to draw some rectangles on a view and move them with the mouse (drag
and drop). I used the example found in the documentation but there is a
problem. The rectangle does not stick with the mouse cursor. If I move the
mouse too fast I loose the rectangle.
Do you know why is that happening ?
Thank you!

Liviu Rau
Re: draw2d [message #70053 is a reply to message #69797] Thu, 13 March 2003 10:56 Go to previous messageGo to next message
Eclipse UserFriend
Which example are you referring to? Are you using just Draw2d? Or are
you using GEF also? If you're just using Draw2d and adding a mouse
listener to the figure, in mousePressed(MouseEvent), call consume() on
the event and this will cause that figure to get all the mouse events
until the mouse button is released.

Eric


Liviu wrote:
> Hi,
>
> I want to draw some rectangles on a view and move them with the mouse (drag
> and drop). I used the example found in the documentation but there is a
> problem. The rectangle does not stick with the mouse cursor. If I move the
> mouse too fast I loose the rectangle.
> Do you know why is that happening ?
> Thank you!
>
> Liviu Rau
>
>
Re: draw2d [message #71038 is a reply to message #69797] Mon, 17 March 2003 11:13 Go to previous message
Eclipse UserFriend
Originally posted by: aroberts.bowstreet.com

Hi Liviu;

I found the same problem when moving the cursor too fast. The system would
think that the mouse had exited the Figure, and the Figure would lose mouse
events.

To address this, I set up the mousePressed method to ask to consume the
event. This way, the Figure would get subsequent events for dragging.
Worked for me and improved performance when I had lots of Figures.

Andy Roberts

public void mousePressed(MouseEvent me)

{

// code here...

me.consume();

}




"Liviu" <lrau@telemobil.ro> wrote in message
news:b4pesn$2dg$1@rogue.oti.com...
> Hi,
>
> I want to draw some rectangles on a view and move them with the mouse
(drag
> and drop). I used the example found in the documentation but there is a
> problem. The rectangle does not stick with the mouse cursor. If I move the
> mouse too fast I loose the rectangle.
> Do you know why is that happening ?
> Thank you!
>
> Liviu Rau
>
>
Previous Topic:FreeFormLayeredPane and FreeFormLayer
Next Topic:Drag and Drop with Control Key pressed
Goto Forum:
  


Current Time: Mon Jul 07 22:26:21 EDT 2025

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

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

Back to the top