Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » how to get moveable figures within compartments
how to get moveable figures within compartments [message #216227] Fri, 23 January 2009 10:32 Go to next message
Robert Wloch is currently offline Robert WlochFriend
Messages: 109
Registered: July 2009
Senior Member
Hello everyone,

in my gmfgraph map I'm trying to design a compartment so that its figures
can be moved freely later by using and combining the default layouts.

It roughly looks like this in my gmfgraph:
Figure Descriptor "BoxFigure"
Rectangle "BoxRectangle"
Flow Layout false (default)
Label + child access
Rectangle "CompartmentElementRectangle" + child access
Figure Descriptor "ElementFigure"
Rectangle "ElementRectangle"
Label + child access
Node "Box"
Node "Element"
Default Size Facet [0,0]
Compartment "ElementCompartment"
Diagram Label "BoxName"
Diagram Label "ElementName"

The compartment mapping is trivial in gmfmap.

Attempt 1)
Using no layout in "CompartmentElementRectangle" results in:
- Element Node is filling the horizontal space, although its default size
is [0,0]
- The Element figure within the compartment is not resizeable nor moveable
- The compartment fills horizontally, but not vertivally

Attempt 2)
Using Border Layout in "BoxRectangle", BL Data BEGINNING (vertical) in the
Label and BLD FILL (vertical) in "CompartmentElementRectangle" results in:
- The compartment properly fills horizontally and vertically
- Element Node has default size [0,0], but it's filling the horizontal
space
- The Element figure is not resizeable nor moveable

Attempt 3)
Using Attempt 2) plus setting Stack or Flow Layout in
"CompartmentElementRectangle" results in:
- same as in Attempt 2)

Attempt 4)
Using Attempt 2) plus setting Border or XY Layout in
"CompartmentElementRectangle" results in:
- no compartment visible anymore

Attempt 5)
Using Attempt 2) plus setting Grid Layout in "CompartmentElementRectangle"
results in:
- Compartment visible but not filling horizontal and vertical space
- Element Node is resized to size where all of its content is still visible
- The Element figure is not resizeable nor moveable

Is there a way to get the Element figure displayed in their preferred size
as in Attempt 5), but have the compartment fill the horizontal and
vertical space AND be able to move the Element figures? I thought at least
XY Layout should make this possible, but unfortunatly using it makes the
compartment disappear.

IMO this is just too simple to touch generated code, or am I wrong? If so
(that I'm wrong) what would I have to do, to get my problem solved?

Thanks for any help!

Rob
Re: how to get moveable figures within compartments [message #216246 is a reply to message #216227] Fri, 23 January 2009 11:19 Go to previous messageGo to next message
Seweryn Niemiec is currently offline Seweryn NiemiecFriend
Messages: 80
Registered: July 2009
Member
Robert Wloch wrote:
> Hello everyone,
>
> in my gmfgraph map I'm trying to design a compartment so that its
> figures can be moved freely later by using and combining the default
> layouts.

This is probably the most frequently asked question on this group just,
after C&P :)
Setting "list layout" property to "false" for the corresponding
GenCompartment in the .gemfgen file usually helps.

AFAIK Layouts in gmfgraph are used to layout node's figures, not
subnodes (children) contained in compartment.

--
Greetings,
Seweryn
Re: how to get moveable figures within compartments [message #216254 is a reply to message #216246] Fri, 23 January 2009 11:27 Go to previous messageGo to next message
Robert Wloch is currently offline Robert WlochFriend
Messages: 109
Registered: July 2009
Senior Member
> Setting "list layout" property to "false" for the corresponding
> GenCompartment in the .gemfgen file usually helps.

When I did the mindmap tutorial, the sticky notes where freely moveable.
Unfortunately, I just can't reproduce it. And as far as I remember, the
tutorial didn't set up anything in the gmfgen file.

> AFAIK Layouts in gmfgraph are used to layout node's figures, not
> subnodes (children) contained in compartment.

Well, but aren't subnodes figures inside of a parent node's figure?
Re: how to get moveable figures within compartments [message #216270 is a reply to message #216254] Fri, 23 January 2009 11:38 Go to previous messageGo to next message
Seweryn Niemiec is currently offline Seweryn NiemiecFriend
Messages: 80
Registered: July 2009
Member
Robert Wloch wrote:
>> Setting "list layout" property to "false" for the corresponding
>> GenCompartment in the .gemfgen file usually helps.
>
> When I did the mindmap tutorial, the sticky notes where freely moveable.
> Unfortunately, I just can't reproduce it. And as far as I remember, the
> tutorial didn't set up anything in the gmfgen file.

Try experimenting with nodes-subnodes and nodes-subnodes-subnodes and
I'm sure you will figure out those defaults works.

>> AFAIK Layouts in gmfgraph are used to layout node's figures, not
>> subnodes (children) contained in compartment.
>
> Well, but aren't subnodes figures inside of a parent node's figure?

on Draw2D level, yes. in gmfgraph, not

--
Greetings,
Seweryn
Re: how to get moveable figures within compartments [message #216277 is a reply to message #216270] Fri, 23 January 2009 11:57 Go to previous messageGo to next message
Robert Wloch is currently offline Robert WlochFriend
Messages: 109
Registered: July 2009
Senior Member
Thank you, Seweryn!

I compared my old mindmap code and *oh wonder* in that gengmf's gen
compartment the said flag (list layout) is false. Probably, when working
and changing back and forth a lot in the gmfgraph file, this flag gets
deactivated sometimes. There's no other explanation I have, why it's so
hard to reproduce the one case, that did work without touching the gengmf.

So again, thanks for the hint!
Re: how to get moveable figures within compartments [message #216292 is a reply to message #216277] Fri, 23 January 2009 12:56 Go to previous message
Seweryn Niemiec is currently offline Seweryn NiemiecFriend
Messages: 80
Registered: July 2009
Member
Robert Wloch wrote:
> Thank you, Seweryn!
>
> I compared my old mindmap code and *oh wonder* in that gengmf's gen
> compartment the said flag (list layout) is false. Probably, when working
> and changing back and forth a lot in the gmfgraph file, this flag gets
> deactivated sometimes. There's no other explanation I have, why it's so

"list layout" prop. is usually reset when you regenerate .gmfgen.

--
Greetings,
Seweryn
Previous Topic:Problem with link creation
Next Topic:[Announce] GMF 2.1.3 M200901221632 is available
Goto Forum:
  


Current Time: Fri Mar 29 15:14:59 GMT 2024

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

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

Back to the top