Complex Figures problem [message #137544] |
Thu, 10 June 2004 14:14 |
Eclipse User |
|
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.02711 seconds