Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Composition of EditParts?
Composition of EditParts? [message #183637] Mon, 06 June 2005 04:53 Go to next message
Fabio is currently offline FabioFriend
Messages: 13
Registered: July 2009
Junior Member
Hello.

I want to make an entity for my model that looks like this:
http://img.photobucket.com/albums/v495/_sl0t_/image.gif

This entity is composed by two sections. The top section is very similar
to an UML Class and the bottom section is an edition area where other
elements can be placed inside this entity.
Those two sections should have their own edit policies, so I made one
editpart for each one:
The top area's editpart is based from ClassEditPart, from eDiagram
example. Structural and behavioral features can be placed on this section.
The bottom area's editpart is based from LogicEditPart, from Logic
example. Others entities can be placed anywhere inside this section, like
the Circuit from Logic example.

But I need to treat both sections as the one entity they are. That means
they both have to be moved around together when I drag and drop one of
them, and I also wanna be able to resize one of them without affecting the
size of both sections (that means I may resize any of the two sections at
any time, but this operation must be restricted to the section I am
resizing, not both at same time).
The top section -must- be always attached to the top of the bottom
section, but it would be nice if I was able to "slide" it through the top
of the bottom section (maybe by drag and drop with mouse right button). I
don't know if this is possible and right now I would be glad if it was
just attached at the top left, so this can wait. :)

Is there any way to make this work? Maybe make a new edipart composed of
those two I already have or a new edipart that has different policies for
each section.

Thanks in advance.
Fábio Sobral.
Re: Composition of EditParts? [message #183646 is a reply to message #183637] Mon, 06 June 2005 05:36 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7670
Registered: July 2009
Senior Member
Hi Fábio

> I want to make an entity for my model that looks like this:
> http://img.photobucket.com/albums/v495/_sl0t_/image.gif
>
> This entity is composed by two sections. The top section is very similar
> to an UML Class and the bottom section is an edition area where other
> elements can be placed inside this entity.

Look at the EDiagram example that is accessible from GEF's CVS.

It has a ClassEditPart for a UMLClassFigure that nests AttributeEditPart
and OperationEDitPart within it.

Regards

Ed Willink
Re: Composition of EditParts? [message #183677 is a reply to message #183646] Mon, 06 June 2005 14:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

I forgot we had an example of this. Basically, each section of children is
managed by a "bogus" non-selectable editpart to serve as the container for
that type of structural feature. Once you start implementing everything
you'll see that it really is a fine solution.

"Ed Willink" <ed@willink.me.uk> wrote in message
news:d80ncg$h9l$1@news.eclipse.org...
> Hi F
Re: Composition of EditParts? [message #183704 is a reply to message #183677] Tue, 07 June 2005 01:25 Go to previous message
Fabio is currently offline FabioFriend
Messages: 13
Registered: July 2009
Junior Member
I tought about that but I'm not sure how I'm supposed to do this, since
both sections would refer to the same element and I would always have one
of each. In the eDiagram example the ClassEditPart has lists of attributes
and operations and each one refers to a separate element.

Thanks for the help. :)
Previous Topic:Problems in understanding GEF!
Next Topic:graph layout algorithms
Goto Forum:
  


Current Time: Tue Sep 24 22:37:05 GMT 2024

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

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

Back to the top