Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Strange differences to mindmap example: How to control layout?
Strange differences to mindmap example: How to control layout? [message #67422] Sun, 22 October 2006 18:00 Go to next message
Eclipse UserFriend
To get started with in my own project I essentially copied a couple of
definitions from the mindmap example .gmfgraph and .gmfmap files (while
adapting names to fit my .ecore, etc.)

What I don't understand is certain graphical behavior of the generated
diagram code, e.g.:

I have two top level types, both are represented by labeled rectangles.
However, in one, the label appears in the top left corner
+------------...
|Label
....

in the other the label appears a few characters to the right, i.e. like:
+------------...
| Label
....

I have no idea, why there is this difference between these two types.
The graphical definitions of both nodes are exactly the same (modulo
names and names of child objects of course).

Both type of boxes can have child items within a compartment. However,
even though the compartment definitions look exactly like in the mindmap
Topic => Thread example, the triangle to collapse or open the
compartment is not shown.

If I create child items within their respective compartments their
figures (again rectangles) appear, but the labels appear outside the
boxes (and even outside the compartment). The child node definitions and
Node Mapping looks exactly identical to the mindmap example where
Threads appear within a compartment inside a Topic Node and their labels
properly placed within the compartment and its surrounding node.
One can move around the labels around at which point - while moving - a
connection is drawn to the middle of the rectangle to which they belong,
so they appear at least properly anchored, but why are they - in
contrast to the mindmap example - initially drawn outside???

Any idea, what could cause such differences? It appears, as if such
differences are almost random and the layout is extremely fragile to
control. I must be missing something...

Michael
Re: Strange differences to mindmap example: How to control layout? [message #67443 is a reply to message #67422] Mon, 23 October 2006 03:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tobk.gmx.de

Michael Moser wrote:

> To get started with in my own project I essentially copied a couple of
> definitions from the mindmap example .gmfgraph and .gmfmap files (while
> adapting names to fit my .ecore, etc.)
>
> What I don't understand is certain graphical behavior of the generated
> diagram code, e.g.:
>
> I have two top level types, both are represented by labeled rectangles.
> However, in one, the label appears in the top left corner
> +------------...
> |Label
> ...
>
> in the other the label appears a few characters to the right, i.e. like:
> +------------...
> | Label
> ...
>
> I have no idea, why there is this difference between these two types.
> The graphical definitions of both nodes are exactly the same (modulo
> names and names of child objects of course).

If the offset to the left is constant, maybe there's a (white) label icon
next to the name?

> Both type of boxes can have child items within a compartment. However,
> even though the compartment definitions look exactly like in the mindmap
> Topic => Thread example, the triangle to collapse or open the
> compartment is not shown.

Although you said that everything looks the same, this sounds like the is
collaplable (?) flag is not set.

> If I create child items within their respective compartments their
> figures (again rectangles) appear, but the labels appear outside the
> boxes (and even outside the compartment). The child node definitions and
> Node Mapping looks exactly identical to the mindmap example where
> Threads appear within a compartment inside a Topic Node and their labels
> properly placed within the compartment and its surrounding node.
> One can move around the labels around at which point - while moving - a
> connection is drawn to the middle of the rectangle to which they belong,
> so they appear at least properly anchored, but why are they - in
> contrast to the mindmap example - initially drawn outside???

Normally this is the case if the figure'S label figure is not child of the
node figure, e.g.
nodefigure
+-labelfigure
makes the label be inside the node, while
nodefigure
labelfigure
makes the label be outside of the node (e.g. for connections)

> Any idea, what could cause such differences? It appears, as if such
> differences are almost random and the layout is extremely fragile to
> control. I must be missing something...
>
> Michael

If you copied the files, maybe there are hidden references to the original
mindmap-files in the xml code. You should at least delete and recreate the
gmfgen file, but I'd recommand deleting them all and starting anew. It most
likely will be fewer efford than trying to fix this 'random behavior'.

tobias
Re: Strange differences to mindmap example: How to control layout? [message #67503 is a reply to message #67443] Mon, 23 October 2006 05:03 Go to previous messageGo to next message
Eclipse UserFriend
Hi Tobias, thanks for responding! Alas, all of the points you listed I
already followed or was aware of.

"tobias" <tobk@gmx.de> wrote in message
news:ehhrcb$3q2$1@utils.eclipse.org...
> Michael Moser wrote:
>> ...
> If the offset to the left is constant, maybe there's a (white) label
> icon
> next to the name?

No - neither of the two topmost nodes/rectangles has an icon.

>> ...
> Although you said that everything looks the same, this sounds like the
> is
> collaplable (?) flag is not set.

Collapsible is set true on all compartments.

>> ...
> Normally this is the case if the figure'S label figure is not child of
> the
> node figure, e.g.
> nodefigure
> +-labelfigure
> makes the label be inside the node, while
> nodefigure
> labelfigure
> makes the label be outside of the node (e.g. for connections)

It took me a while until I understood that these nested labels are also
globally visible and need to be referenced directly, but labels *are*
defined as child of the corresponding nodes, i.e. like in the first
example shown above.

>> ..
> If you copied the files, maybe there are hidden references to the
> original
> mindmap-files in the xml code. You should at least delete and recreate
> the
> gmfgen file, but I'd recommand deleting them all and starting anew. It
> most
> likely will be fewer efford than trying to fix this 'random behavior'.

Nope - I meant copy in the "ancient" sense, i.e. I actually retyped
things, since I was aware of the danger that you mention (and I wanted
to learn and understand what I am doing along the way). So, that
definitely can not be the cause.

Michael
Re: Strange differences to mindmap example: How to control layout? [message #67678 is a reply to message #67422] Mon, 23 October 2006 07:03 Go to previous messageGo to next message
Eclipse UserFriend
> I have two top level types, both are represented by labeled rectangles.
> However, in one, the label appears in the top left corner
> ...
> in the other the label appears a few characters to the right, i.e. like:

If you compare code generated for both figures (usually, inner classes in
respective editParts)- is it the same?


> One can move around the labels around at which point - while moving - a
> connection is drawn to the middle of the rectangle to which they belong,
> so they appear at least properly anchored, but why are they - in contrast
> to the mindmap example - initially drawn outside???

If you can drag labels around they are 'external', i.e. do not belong to any
other figure. Check that DiagramLabel you are referencing from .gmfmap
points to Label from Node's figure hierarchy.


Artem

"Michael Moser" <mmo@zurich.ibm.com> wrote in message
news:ehgplv$417$1@utils.eclipse.org...
> To get started with in my own project I essentially copied a couple of
> definitions from the mindmap example .gmfgraph and .gmfmap files (while
> adapting names to fit my .ecore, etc.)
>
> What I don't understand is certain graphical behavior of the generated
> diagram code, e.g.:
>
> I have two top level types, both are represented by labeled rectangles.
> However, in one, the label appears in the top left corner
> +------------...
> |Label
> ...
>
> in the other the label appears a few characters to the right, i.e. like:
> +------------...
> | Label
> ...
>
> I have no idea, why there is this difference between these two types. The
> graphical definitions of both nodes are exactly the same (modulo names and
> names of child objects of course).
>
> Both type of boxes can have child items within a compartment. However,
> even though the compartment definitions look exactly like in the mindmap
> Topic => Thread example, the triangle to collapse or open the compartment
> is not shown.
>
> If I create child items within their respective compartments their figures
> (again rectangles) appear, but the labels appear outside the boxes (and
> even outside the compartment). The child node definitions and Node Mapping
> looks exactly identical to the mindmap example where Threads appear within
> a compartment inside a Topic Node and their labels properly placed within
> the compartment and its surrounding node.
> One can move around the labels around at which point - while moving - a
> connection is drawn to the middle of the rectangle to which they belong,
> so they appear at least properly anchored, but why are they - in contrast
> to the mindmap example - initially drawn outside???
>
> Any idea, what could cause such differences? It appears, as if such
> differences are almost random and the layout is extremely fragile to
> control. I must be missing something...
>
> Michael
>
>
Re: Strange differences to mindmap example: How to control layout? [message #67699 is a reply to message #67678] Mon, 23 October 2006 07:33 Go to previous messageGo to next message
Eclipse UserFriend
Exactly WHEN does GMF update the files it generates? I am starting to
believe, that some of my troubles are caused by GMF not properly
updating files.

E.g. for test reasons, I just changed some background color to cyan, but
when I recreate a new diagram I am still getting the former blue, so
obviously I am still working with some old code here... No wonder I am
banging my head trying to get things working but see no (or only
unexplicable because delayed) reactions...

Does one have to delete the .gmfgen and the .diagram project each time
before regenerating things???

Michael
Re: Strange differences to mindmap example: How to control layout? [message #67739 is a reply to message #67699] Mon, 23 October 2006 08:16 Go to previous messageGo to next message
Eclipse UserFriend
Aaah - indeed - there they are: my missing collapse-triangles and what
not!

I deleted the .gmfgen file and recreated it and now I suddenly see all
those things that I tried to change since hours. *That* definitely
should be better documented, that one has to delete this .gmfgen each
time (or at least when things get stuck) before recreating it!

Michael


"Michael Moser" <mmo@zurich.ibm.com> wrote in message
news:ehi99j$n0b$1@utils.eclipse.org...
> Exactly WHEN does GMF update the files it generates? I am starting to
> believe, that some of my troubles are caused by GMF not properly
> updating files.
>
> E.g. for test reasons, I just changed some background color to cyan,
> but when I recreate a new diagram I am still getting the former blue,
> so obviously I am still working with some old code here... No wonder I
> am banging my head trying to get things working but see no (or only
> unexplicable because delayed) reactions...
>
> Does one have to delete the .gmfgen and the .diagram project each time
> before regenerating things???
>
> Michael
Re: Strange differences to mindmap example: How to control layout? [message #67822 is a reply to message #67739] Mon, 23 October 2006 08:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tobk.gmx.de

Michael Moser wrote:

> Aaah - indeed - there they are: my missing collapse-triangles and what
> not!
>
> I deleted the .gmfgen file and recreated it and now I suddenly see all
> those things that I tried to change since hours. *That* definitely
> should be better documented, that one has to delete this .gmfgen each
> time (or at least when things get stuck) before recreating it!
>
> Michael

There's no need for deleting it each time. This would not be very handy,
too, since you can make custom configurations in he gmfgen, too.

But yes, when things get stuck and there are no important customizations in
the gmfgen it's worth a try deleting and recreating it. Just like I already
wrote. ;-) However, good to hear you solved the problems.

tobias
Re: Strange differences to mindmap example: How to control layout? [message #68620 is a reply to message #67822] Tue, 24 October 2006 14:43 Go to previous message
Eclipse UserFriend
Definitely, no need to delete .gmfgen. If you changed .gmfgraph, just do
transformation once again and .gmfgen will be updated. Alternative, and much
better way to deal with .gmfgraph customizations is generating standalone
plug-in with figures - in which case most of .gmfgraph changes won't require
neither transformation step, nor even the diagram generation step.


Artem.

"tobias" <tobk@gmx.de> wrote in message
news:ehidlr$aie$1@utils.eclipse.org...
> Michael Moser wrote:
>
>> Aaah - indeed - there they are: my missing collapse-triangles and what
>> not!
>>
>> I deleted the .gmfgen file and recreated it and now I suddenly see all
>> those things that I tried to change since hours. *That* definitely
>> should be better documented, that one has to delete this .gmfgen each
>> time (or at least when things get stuck) before recreating it!
>>
>> Michael
>
> There's no need for deleting it each time. This would not be very handy,
> too, since you can make custom configurations in he gmfgen, too.
>
> But yes, when things get stuck and there are no important customizations
> in
> the gmfgen it's worth a try deleting and recreating it. Just like I
> already
> wrote. ;-) However, good to hear you solved the problems.
>
> tobias
>
Previous Topic:Correct import
Next Topic:Change Figure dynamically
Goto Forum:
  


Current Time: Thu Mar 13 13:52:49 EDT 2025

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

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

Back to the top