Home » Modeling » GMF (Graphical Modeling Framework) » Strange behavior with links between contained elements in GMF generated editor.
Strange behavior with links between contained elements in GMF generated editor. [message #549473] |
Mon, 26 July 2010 17:00 |
Toñi Reina Messages: 209 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
--------------050100050504000407090301
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
Hi all,
I'm generating a GMF editor with Eugenia, but I'm posting this
question here, because I think it is a GMF problem, not an Eugenia one.
In my editor, the main constructors are called Cotainers. A Container
contains a set of Elements. Furthermore, a container also has a set of
Ports, that has been specified as affixed.
At the same time, Ports are containers and can also contain a set of
elements.
There are two kinds of connectors: link, whose purpose is to connect
Ports, and Slots, which connect Elements.
The problem arises when we try to connect two elements, one of them
belonging to a container, and the other one belonging to a port of that
container. I have attached a screenshot of my generated editor to
explain better the problem.
If you look at the screenshot, you'll see a two containers (Container1
and Container2). Container1 has two ports (P1 and P2) and Container2 has
one port (P3). Furthermore, Container1 contains two elements (E1 and
E2), Container2 contains one element (E5). Ports also include elemnts,
thus P1 contains E3, P2 contains E4 and P3 contains E6.
As you can see there is a link connecting P2 and P3, and slots
connecting E1 and E2, E2 and E5, E4 and E6.
There are two different problems
1) When your try to connect with a slot E3 and E1 or E2 and E4 the line
that connects them is not drawn on the screen. However, if you look at
the model, the slot has been created, and the connection between the
elements has been stored. It's seem the slot is drawn in the background.
2) Although the slot connecting E4 and E6 is depicted, if you close
Eclipse and then open againg the diagram, this line disappears. But, as
in the previous problem, the slot is still stored in the model.
Finally, below I have included the emfatic metamodel with eugenia
annotations that allow me to generate the editor.
Best regards,
To
|
|
|
Re: Strange behavior with links between contained elements in GMF generated editor. [message #550992 is a reply to message #549473] |
Wed, 04 August 2010 18:57 |
Toñi Reina Messages: 209 Registered: July 2009 |
Senior Member |
|
|
Hi,
after doing some research, I think the problem I reported in the
previous post is due to an appearance propertty of links. That is, by
default the status of the link is None (there are 4 options (None, All,
Below, Above)). However, in order to see the links their status should
be All.
My question now is: Where can I change this default option?
El 26/07/2010 19:00, Toñi Reina Quintero escribió:
> Hi all,
>
> I'm generating a GMF editor with Eugenia, but I'm posting this question
> here, because I think it is a GMF problem, not an Eugenia one.
>
> In my editor, the main constructors are called Cotainers. A Container
> contains a set of Elements. Furthermore, a container also has a set of
> Ports, that has been specified as affixed.
>
> At the same time, Ports are containers and can also contain a set of
> elements.
>
> There are two kinds of connectors: link, whose purpose is to connect
> Ports, and Slots, which connect Elements.
>
> The problem arises when we try to connect two elements, one of them
> belonging to a container, and the other one belonging to a port of that y
> container. I have attached a screenshot of my generated editor to
> explain better the problem.
>
> If you look at the screenshot, you'll see a two containers (Container1
> and Container2). Container1 has two ports (P1 and P2) and Container2 has
> one port (P3). Furthermore, Container1 contains two elements (E1 and
> E2), Container2 contains one element (E5). Ports also include elemnts,
> thus P1 contains E3, P2 contains E4 and P3 contains E6.
>
> As you can see there is a link connecting P2 and P3, and slots
> connecting E1 and E2, E2 and E5, E4 and E6.
>
> There are two different problems
> 1) When your try to connect with a slot E3 and E1 or E2 and E4 the line
> that connects them is not drawn on the screen. However, if you look at
> the model, the slot has been created, and the connection between the
> elements has been stored. It's seem the slot is drawn in the background.
>
> 2) Although the slot connecting E4 and E6 is depicted, if you close
> Eclipse and then open againg the diagram, this line disappears. But, as
> in the previous problem, the slot is still stored in the model.
>
> Finally, below I have included the emfatic metamodel with eugenia
> annotations that allow me to generate the editor.
>
> Best regards,
> Toñi
>
> ==CONNECTOR METAMODEL=====================================
>
> @namespace(uri="http://connector", prefix="connect")
> package connector;
>
> @gmf.diagram(foo="bar")
> class Diagram {
> val Container[+] container;
> val Link[+] links;
>
> }
>
> @gmf.node(label="name",border.color="0,0,0")
> class Container {
> attr String name;
> @gmf.affixed(foo="bar")
> val Port[2..*] ports;
>
> @gmf.compartment(layout="free",collapsible="true")
> val Element[+] elements;
>
> val Slot[2..*] slots;
> }
>
> @gmf.node(figure="rectangle", label="name",
> label.icon="false")
> class Port {
>
> attr String name;
> @gmf.compartment(layout="free",collapsible="true")
> val Element[+] element;
>
> }
>
> @gmf.node(label="name")
> class Element{
> attr String name;
> ref Slot[+]#source inputSlots;
> ref Slot[+]#target outputSlots;
> }
>
> @gmf.link(source="source", target="target", label="name",
> target.decoration="arrow", color="0,0,0", style="dash")
> class Slot{
> attr String name;
> ref Element#inputSlots source;
> ref Element#outputSlots target;
> }
>
> @gmf.link(source="source", target="target", label="name",
> target.decoration="arrow", color="0,0,0", width="2")
> class Link{
> ref Port source;
> ref Port target;
> }
|
|
|
Goto Forum:
Current Time: Sat Nov 09 02:02:14 GMT 2024
Powered by FUDForum. Page generated in 0.03448 seconds
|