Skip to main content



      Home
Home » Eclipse Projects » GEF » Default GEF behavor; why figures are added where they are?
Default GEF behavor; why figures are added where they are? [message #132157] Thu, 13 May 2004 21:21 Go to next message
Eclipse UserFriend
Originally posted by: smallpocks.yahoo.com

Hey Guys,
I have a question about the default behavior of GEF. I may be wrong in my
assumptions so just let me know if I've got this all wrong but...
It seems to me that a normal EditPart's figure is added as a child to the
figure of its parent EditPart. On the other hand, a ConnectionEditPart's
figure gets added to the CONNECTION_LAYER of the root edit part. So I guess
my question is, why this difference in behavior? Wouldn't it still make a
lot of sense if every figure was added as a child to the parent figure? It's
frustrating me right now...

Thanks a lot.
Guy
Re: Default GEF behavor; why figures are added where they are? [message #132170 is a reply to message #132157] Fri, 14 May 2004 05:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: brian.fernandes.codito.com

Hi Guy,

One benefit of the connections being on a separate layer is that they are
always drawn ABOVE all the other EditParts that the connect. Consequently,
by moving the connection layer, you can move the connections below all the
EditParts.

Another point is; connections don't really have a single parent - if they
connect A and B, then I guess A and B are both parents - so you can't really
make it a child figure of either.

Hope this helps,
Brian.


"Guy Beckman" <smallpocks@yahoo.com> wrote in message
news:c816ie$837$1@eclipse.org...
> Hey Guys,
> I have a question about the default behavior of GEF. I may be wrong in my
> assumptions so just let me know if I've got this all wrong but...
> It seems to me that a normal EditPart's figure is added as a child to the
> figure of its parent EditPart. On the other hand, a ConnectionEditPart's
> figure gets added to the CONNECTION_LAYER of the root edit part. So I
guess
> my question is, why this difference in behavior? Wouldn't it still make a
> lot of sense if every figure was added as a child to the parent figure?
It's
> frustrating me right now...
>
> Thanks a lot.
> Guy
>
>
Re: Default GEF behavor; why figures are added where they are? [message #132312 is a reply to message #132157] Sun, 16 May 2004 16:06 Go to previous message
Eclipse UserFriend
Originally posted by: rlemaigr.ulb.ac.be

Hi,

I'm not a specialist in gef and draw2d so my answer could contain mistak=
es =

and approximations.

In addition to what brian have said, there's also the fact that draw2d =

provides a special layer (ConnectionLayer) for connections. Connections =
=

added to that special layer share automaticaly the same connection route=
r =

(by default, I think), wich is the one define for the connection layer.

By putting all the Connections as children of the ConnectionLayer, the =

programmer can easily insure that all the connections "live" in the same=
=

plane, for example on top of everything else, and that Connections added=
=

to this layer share the same connection router. If you place the =

connection layer as the last child of the root figure, the connections =

will all be on top of everything else, if you place the connection layer=
=

as the first child of the root figure, the connections will all be below=
=

everything else.

Another thing that makes the use of such a layer necessary is that =

Connections can't live as children of a Figure with a layout manager, =

because I don't think calling setBounds() on a Connection is safe...mayb=
e =

it has no effect I don't know...but connections are not made to be handl=
ed =

by layout managers of their parent. So I think you must put them in a =

special layer with no layout manager associated.

That's why Gef adds all connections to the CONNECTION_LAYER wich is a =

ConnectionLayer.

Also remember that if a Figure A is a child of a Figure B, then the =

drawing of the Figure A is clipped by the bounding box of the Figure B a=
nd =

connections don't make exception to this rule. So adding a connection to=
=

one of its parent would result in clipping it by the bounding box of its=
=

parent, wich is certainly not the expected behaviour...

hope this will help you,

r=E9gis

On Thu, 13 May 2004 18:21:54 -0700, Guy Beckman <smallpocks@yahoo.com> =

wrote:

> Hey Guys,
> I have a question about the default behavior of GEF. I may be wrong in=
my
> assumptions so just let me know if I've got this all wrong but...
> It seems to me that a normal EditPart's figure is added as a child to =
the
> figure of its parent EditPart. On the other hand, a ConnectionEditPart=
's
> figure gets added to the CONNECTION_LAYER of the root edit part. So I =
=

> guess
> my question is, why this difference in behavior? Wouldn't it still mak=
e a
> lot of sense if every figure was added as a child to the parent figure=
? =

> It's
> frustrating me right now...
>
> Thanks a lot.
> Guy
>
>
Previous Topic:Problem with UndoablePropertySheetEntry and EMF generated CellEditors
Next Topic:Using tool tip for target feedback
Goto Forum:
  


Current Time: Sat Jul 12 15:06:15 EDT 2025

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

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

Back to the top