Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » How to find an object outside the visual area of a viewer
How to find an object outside the visual area of a viewer [message #209733] Mon, 20 February 2006 13:35
Eclipse UserFriend
Originally posted by: ralle.upb.de

Hi,

I want to get an EditPart Object by it's coordinates in a scrolling
graphical viewer. How can I get such an object if the viewer is scrolled and
the object is not in the visual part of the viewer.

I tried like this but the object cannot be found:

FigureCanvas figurecanvas = (FigureCanvas) this.viewer
.getControl();
if (figurecanvas.getHorizontalBar() != null)
{
barpositionX = figurecanvas.getHorizontalBar().getSelection();
}

if (figurecanvas.getVerticalBar() != null)
{
barpositionY = figurecanvas.getVerticalBar().getSelection();
}

Object found = this.viewer.findObjectAt(new Point
(x-barpositionX,y-barpositionY));

- x and y are the absolute coordinates of the object to find in my viewer -

Thanks,

Lutz
Previous Topic:Add a toggle action to figure and communicate it to model via CommandStack
Next Topic:DirectEditing Multiline / Invoking a helpwindow?
Goto Forum:
  


Current Time: Thu Mar 28 21:36:14 GMT 2024

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

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

Back to the top