Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » how to Identify the model present on the editor ?
how to Identify the model present on the editor ? [message #210354] Mon, 27 February 2006 04:20 Go to next message
Eclipse UserFriend
Originally posted by: spike.m.yahoo.com

Hi i have a issue when i drag n drop a figure on to the editor.
The question is how to identify the figure/model which is below the figure
which iam droping on it. (no parent child relationship)

Lets say 4 example there is a Square already drawn on the editor, and if i
drop a circle on it , how do we trace which square object is present
beneath the circle which i have droped (If there are 2 or 3 Squares
already present on the editor).

Thanks
Spike
Re: how to Identify the model present on the editor ? [message #210559 is a reply to message #210354] Wed, 01 March 2006 17:42 Go to previous message
Steven R. Shaw is currently offline Steven R. ShawFriend
Messages: 128
Registered: July 2009
Senior Member
In the context of GEF the targetting mechanism is handled behind the scenes.
You can handle these targetting scenarios by installing appropriate
EditPolicies on your EditPart. The editpolicies installed would handle
requests for add (REQ_ADD), orphan (REQ_ORPHAN). Orphan requests means the
receiver is being moved from it's current parent. @see ComponentEditPolicy.

If your working in the context of Draw2d, then there are api's on the
containing Figure you could use Figure#findFigureAt(...)

-Steve

"Spike" <spike.m@yahoo.com> wrote in message
news:3ea607fcf457c0aeb23919204c85e14f$1@www.eclipse.org...
> Hi i have a issue when i drag n drop a figure on to the editor.
> The question is how to identify the figure/model which is below the figure
> which iam droping on it. (no parent child relationship)
>
> Lets say 4 example there is a Square already drawn on the editor, and if i
> drop a circle on it , how do we trace which square object is present
> beneath the circle which i have droped (If there are 2 or 3 Squares
> already present on the editor).
>
> Thanks
> Spike
>
>
>
>
Previous Topic:TextFlow doesn't return correct height from getPreferredSize()
Next Topic:Issue of Parent child Realtionship
Goto Forum:
  


Current Time: Sun Nov 27 16:16:27 GMT 2022

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

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

Back to the top