My GEF graphical viewer has a MyTemplateTransferDropTargetListener.
MyTemplateTransferDropTargetListener overrides drop() method:
@Override
public void drop(DropTargetEvent event) {
Point eventDropLocationPoint = this.getDropLocation();
}
getDropLocation() runs fine when the screen of the editor is smaller, or equal to the size of the eclipse editor page. But when the screen of GEF editor is larger and I scroll down, or right, getDropLocation() will not get the specific location relative to the my GEF viewer.
Do you know a way to solve this problem?
Your Canvas control should occupy all space provided to it by the editor composite. When the editor window is resized the canvas size should become equal to the size of the window (editor composite) and then the size of the root figure should become equal to the size of the canvas. From the screenshot it looks like either the Canvas control doesn't have the size of the window/editor composite or the root figure doesn't have the right size. The grey rectangular border is limiting the root figure probably or the canvas. I'd debug Draw2D LightweightSystem#controlResized() (line 118) see if it's getting called when you resize the editor window, check that the canvas size and root figure size are correct and equal to the window size. (Also note that drop target listeners are on the canvas control only.)