Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » finding a figure off-screen
finding a figure off-screen [message #242706] Mon, 05 May 2008 20:49 Go to next message
Del Myers is currently offline Del MyersFriend
Messages: 82
Registered: July 2009
Member
I'm running into a little bit of a problem trying to find figures in my draw2d
application. The problem is this: I have several figures that are being drawn
offscreen. I need to get some data associated with those figures. Here's the
problem: even if I know the location of those figures, if they are drawn
off-screen, I can't get access to them using findFigureAt() on the root figure.
The reason is that the root figure has a bounds equal to the size of the
viewport, and findFigureAt() checks to make sure that the point I'm looking for
is within the bounds of the root figure. But, off-screen figures will never be
in these bounds. Is there any way that I can get around this problem?

Del
Re: finding a figure off-screen [message #242765 is a reply to message #242706] Wed, 07 May 2008 17:49 Go to previous messageGo to next message
Felix L J Mayer is currently offline Felix L J MayerFriend
Messages: 202
Registered: July 2009
Senior Member
You could do it manually by recursively iterating through all child figures
of the root figure.

"Del Myers" <delmyers.cs@gmail.com> wrote in message
news:fvnrrm$ofi$1@build.eclipse.org...
> I'm running into a little bit of a problem trying to find figures in my
> draw2d application. The problem is this: I have several figures that are
> being drawn offscreen. I need to get some data associated with those
> figures. Here's the problem: even if I know the location of those figures,
> if they are drawn off-screen, I can't get access to them using
> findFigureAt() on the root figure. The reason is that the root figure has
> a bounds equal to the size of the viewport, and findFigureAt() checks to
> make sure that the point I'm looking for is within the bounds of the root
> figure. But, off-screen figures will never be in these bounds. Is there
> any way that I can get around this problem?
>
> Del
Re: finding a figure off-screen [message #242841 is a reply to message #242765] Fri, 09 May 2008 17:17 Go to previous message
Del Myers is currently offline Del MyersFriend
Messages: 82
Registered: July 2009
Member
Yes, I was able to solve my particular problem by overriding the RootFigure used
in my Lightweight system. In this RootFigure, I assumed that the child was a
Viewport (not a problem, since I was using a FigureCanvas), and I manually
searched the contents of the Viewport, after translating the coordinates. This
works because the contents of the Viewport extend beyond the bounds of the Viewport.

However, I don't particularly like this solution. It is a bit of a hack. It
would be nice if the RootFigure just did this on its own. The API the way it is
gives the impression that off-screen figures just don't exist in the root.

Del

Felix L J Mayer wrote:
> You could do it manually by recursively iterating through all child figures
> of the root figure.
>
> "Del Myers" <delmyers.cs@gmail.com> wrote in message
> news:fvnrrm$ofi$1@build.eclipse.org...
>> I'm running into a little bit of a problem trying to find figures in my
>> draw2d application. The problem is this: I have several figures that are
>> being drawn offscreen. I need to get some data associated with those
>> figures. Here's the problem: even if I know the location of those figures,
>> if they are drawn off-screen, I can't get access to them using
>> findFigureAt() on the root figure. The reason is that the root figure has
>> a bounds equal to the size of the viewport, and findFigureAt() checks to
>> make sure that the point I'm looking for is within the bounds of the root
>> figure. But, off-screen figures will never be in these bounds. Is there
>> any way that I can get around this problem?
>>
>> Del
>
>
Previous Topic:Image map
Next Topic:Container layout problem
Goto Forum:
  


Current Time: Thu Dec 26 12:54:30 GMT 2024

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

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

Back to the top