Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Create a link between a Node and another Link
Create a link between a Node and another Link [message #190900] Wed, 04 June 2008 10:19 Go to next message
Marc Mising name is currently offline Marc Mising nameFriend
Messages: 193
Registered: July 2009
Location: Valencia, Spain
Senior Member
Hi, I want to create a link between a Node and another link, but when I
create this new link, it desappears from the diagram, although it was
created in the model.
I think it's a refresh problem, but I don't know where to change the code.
Can anybody helps me please?

Thanks!
Marc.
Re: Create a link between a Node and another Link [message #190910 is a reply to message #190900] Wed, 04 June 2008 11:05 Go to previous messageGo to next message
Marc Mising name is currently offline Marc Mising nameFriend
Messages: 193
Registered: July 2009
Location: Valencia, Spain
Senior Member
I must indicate that the second link I create (the one who desappears),
doesn't represents an EObject: it represents a property!

Marc Gil wrote:

> Hi, I want to create a link between a Node and another link, but when I
> create this new link, it desappears from the diagram, although it was
> created in the model.
> I think it's a refresh problem, but I don't know where to change the code.
> Can anybody helps me please?

> Thanks!
> Marc.
Re: Create a link between a Node and another Link [message #190956 is a reply to message #190910] Wed, 04 June 2008 12:41 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Marc,

> desappears), doesn't represents an EObject: it represents a property!
Do you mean reference?
This can be a problem. If you'd like to debug diagram updating process then
start with "???CanonicalEditPolicy" class generated for your diagram element.

-----------------
Alex Shatalin
Re: Create a link between a Node and another Link [message #191370 is a reply to message #190956] Fri, 06 June 2008 08:36 Go to previous messageGo to next message
Marc Mising name is currently offline Marc Mising nameFriend
Messages: 193
Registered: July 2009
Location: Valencia, Spain
Senior Member
Hi Alex,

Well, I solved this problem. In the ???DiagramUpdater file, there exists a
lot of functions to return the ???ContainedLinks for every elements that
can be drawn in the diagram. By default, this method for the links returns
an EMPTY_LIST. I must to change this code like all the other elements, and
add the LinkDescriptors of these elements that has not represents a
REFERENCE (thanks Alex).

By this way, all the links between links and nodes are painted correctly.
Is possible that this was a GMF bug?

Thanks Alex!
Marc.


Alex Shatalin wrote:

> Hello Marc,

>> desappears), doesn't represents an EObject: it represents a property!
> Do you mean reference?
> This can be a problem. If you'd like to debug diagram updating process then
> start with "???CanonicalEditPolicy" class generated for your diagram element.

> -----------------
> Alex Shatalin
Re: Create a link between a Node and another Link [message #191468 is a reply to message #191370] Fri, 06 June 2008 16:58 Go to previous message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Marc,

> By this way, all the links between links and nodes are painted
> correctly. Is possible that this was a GMF bug?
Looks like.. This code should be generated coddectly for you.. For example
(from Ecore diagram):

public static List getEClass_2001ContainedLinks(View view) {
EClass modelElement = (EClass) view.getElement();
List result = new LinkedList();
// type-based links
result.addAll(getContainedTypeModelFacetLinks_EReference_400 2(modelElement));
result.addAll(getContainedTypeModelFacetLinks_EReference_400 3(modelElement));
// reference-based links
result.addAll(getOutgoingFeatureModelFacetLinks_EClass_ESupe rTypes_4004(modelElement));
return result;
}

Looking into the current template I can said that if the Node does not have
corresponding result.addAll(getOutgoingFeatureModelFacetLinks_???(modelEle ment));
in get???ContainedLinks method then for Reference-based link it looks like
following expression was evaluated to "false" during code generation:

<linkGenFeature>.getGenClass().ecoreClass.isSuperTypeOf(<nodeGenClass >.ecoreClass)

You can try browsing .gmfgen model to check this expression (corresponding
GenLink, GenNode elements present in this model).


-----------------
Alex Shatalin
Previous Topic:outline view problem in gmf
Next Topic:Open sub-editors from the diagram Navigator
Goto Forum:
  


Current Time: Thu Apr 25 15:19:19 GMT 2024

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

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

Back to the top