Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Complex Figures problem
Complex Figures problem [message #137544] Thu, 10 June 2004 14:14
Eclipse UserFriend
Originally posted by: raritzu.yahoo.co.uk

I finally solved it, it was a nightmare. Initially I maneged to get the
mouse press with a listener in the Button descendant like this:

getModel().addChangeListener( new ChangeListener()
{
public void handleStateChanged(ChangeEvent event)

{

...

}

}

But this turned out to be useless too because you could not create a
MouseEvent, the constructor is not visible outside the draw2d package
(again).

The solution is: I am catching the mouse down, mouse move events from the
FigureCanvas. In the editor I say:

viewer.getControl().addMouseListener( this );

viewer.getControl().addMouseMoveListener( this );



Where the viewer is the GraphicalViewer you create in the
createGraphicalViewer(Composite parent) of the editor. I put in place some
logic that will be working with any figures that behave similar to the
Button (contains children that consumes mouse events). If anyone has the
same problem let me know and I give more details.
Previous Topic:How to determine coordinates of the popup menu action.
Next Topic:EditPart layering reg.
Goto Forum:
  


Current Time: Wed Apr 24 17:14:41 GMT 2024

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

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

Back to the top