Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Need Help in creating container Figure
Need Help in creating container Figure [message #131351] Fri, 07 May 2004 15:31 Go to next message
Eclipse UserFriend
Originally posted by: sagivijay.yahoo.com

Hi All,
I am relatively new to GEF. I would like to do the following:

When the user drags an object from the Palette I would like to create a
label. However, I want that label to be present within a container figure
like say a RectangleFigure so that all the objects that the user has
created are present inside the rectangle figure. I would like the
rectangle figure to resize itself based on the size of the label created.
Also it should be possible to select the individual labels rather than the
entire container figure so that I can make changes to the model using the
properties view.

+----------+
| [label1] |
| [label2] |
| [label3] |
+----------+

I am presently able to create the labels without the surrounding container
figure so they kinda look like this

[label1]
[label2]
[label3]

How am I supposed to create the container figure. Should I create an
EditPart specifically for the container figure. I want the container
figure to be present by default (whether or not labels are added to it) If
so how do I access that figure from the editpart for creating the labels??
Any help like pointers to tutorials, sample source code would also be
helpful in this regard.

Thanks a lot,
Vijay
Re: Need Help in creating container Figure [message #131592 is a reply to message #131351] Mon, 10 May 2004 21:13 Go to previous message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
"Vijay" <sagivijay@yahoo.com> wrote in message
news:c7ga4v$h1k$1@eclipse.org...
> Hi All,
> I am relatively new to GEF. I would like to do the following:
>
> When the user drags an object from the Palette I would like to create a
> label. However, I want that label to be present within a container figure
> like say a RectangleFigure so that all the objects that the user has
> created are present inside the rectangle figure. I would like the
> rectangle figure to resize itself based on the size of the label created.
> Also it should be possible to select the individual labels rather than the
> entire container figure so that I can make changes to the model using the
> properties view.
>
> +----------+
> | [label1] |
> | [label2] |
> | [label3] |
> +----------+
>
> I am presently able to create the labels without the surrounding container
> figure so they kinda look like this
>
> [label1]
> [label2]
> [label3]
>
> How am I supposed to create the container figure. Should I create an
> EditPart specifically for the container figure.

Yes.

> I want the container
> figure to be present by default (whether or not labels are added to it) If
> so how do I access that figure from the editpart for creating the labels??

You don't need to. Your container editpart's getModelChildren() should
return all model labels (of which there could be none). GEF will create
EditParts for those labels using the EditPartFactory that you set on the
viewer, then create figures for those EditParts, and then place those
figures in the container figure.

> Any help like pointers to tutorials, sample source code would also be
> helpful in this regard.
>
> Thanks a lot,
> Vijay
>
Previous Topic:how can i remove selected EditPart from selected editparts list? thx a lot
Next Topic:[solved ....]
Goto Forum:
  


Current Time: Tue Apr 23 17:52:49 GMT 2024

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

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

Back to the top