Double click on white space [message #498749] |
Wed, 18 November 2009 14:25 |
Eclipse User |
|
|
|
Originally posted by: c.krause.cwi.nl
Hi,
the existing posts about capturing double-click events didn't work in my
application. I tried to capture REQ_OPEN at the diagram editpart but
that didn't work. Then I tried to add a mouse listener to the diagram
figure like this:
protected IFigure createFigure() {
// Create free form layer:
Figure layer = new FreeformLayer();
layer.setBorder(new MarginBorder(3));
layer.setLayoutManager(new FreeformLayout());
layer.addMouseListener(new MouseListener() {
public void mouseDoubleClicked(MouseEvent me) {
System.out.println("double click: " + me);
}
// ...
});
// Create the static router for the connection layer
ConnectionLayer connections = (ConnectionLayer)
getLayer(LayerConstants.CONNECTION_LAYER);
connections.setConnectionRouter(new ShortestPathConnectionRouter(layer));
return layer;
}
But I still get no events. I do get events if I listen to the
FigureConvas of the graphical viewer but then I get ALL double clicks,
and not just the ones in the white space.
ciao,
Christian
|
|
|
|
Powered by
FUDForum. Page generated in 0.02783 seconds