Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Display association in diagram(As normal attributes I want to display association in a GMF diagram)
Display association in diagram [message #635672] Wed, 27 October 2010 17:12 Go to next message
TSchwalb  is currently offline TSchwalb Friend
Messages: 9
Registered: September 2009
Junior Member
Hi everyone,
I am building a GMF editor and I want to display the value of an association in the model diagram view.

For example: I have a class A, which has an association to class B (and class B has an attribute name). Now when I draw a diagram in the GMF-editor I can draw instances of class A and class B separately, which is what I want. I can also set in the properties view of an instance of class A the association to an instance of class B. Now the problem is: If I have set this I also want to display it (the value of the association) in the diagram (as I can do it with normal attributes). Is there a way to do this? (I only want to display it - there is no need to change in the diagram).

Many thanks for any hints.

[Updated on: Wed, 27 October 2010 17:14]

Report message to a moderator

Re: Display association in diagram [message #635892 is a reply to message #635672] Thu, 28 October 2010 14:08 Go to previous messageGo to next message
Aurélien Pupier is currently offline Aurélien PupierFriend
Messages: 637
Registered: July 2009
Location: Grenoble, FRANCE
Senior Member

Hi,

I think that you should modelize Link in your gmfmap

Regards,


Aurélien Pupier - Red Hat
Senior Software Engineer in Fuse Tooling team
Re: Display association in diagram [message #635937 is a reply to message #635892] Thu, 28 October 2010 16:00 Go to previous messageGo to next message
TSchwalb  is currently offline TSchwalb Friend
Messages: 9
Registered: September 2009
Junior Member
Hi,
Thank you for your answer.

I am not sure if I got it right. I want to display the association in the diagram as a label - not as a link. (The reason is that in my application I am using a partitioned diagram). If this is possible with a link, maybe you can explain it more detailed how do it, because I could not figure out how to use a link for a label. I can only get links on the top mapping level and not on node mappings.

Many thanks.
Re: Display association in diagram [message #635945 is a reply to message #635672] Thu, 28 October 2010 16:39 Go to previous messageGo to next message
Aurélien Pupier is currently offline Aurélien PupierFriend
Messages: 637
Registered: July 2009
Location: Grenoble, FRANCE
Senior Member

Hi,

I don't understand where you want to display the label representing your association

between A and B? alink with a line with width 0?

near A or B? perhaps a border item can help

inside A? use a custom figure with a feature label mapping

Regards,


Aurélien Pupier - Red Hat
Senior Software Engineer in Fuse Tooling team
Re: Display association in diagram [message #636133 is a reply to message #635672] Fri, 29 October 2010 12:56 Go to previous messageGo to next message
TSchwalb  is currently offline TSchwalb Friend
Messages: 9
Registered: September 2009
Junior Member
Hi,
Thanks again for your answer.

Sorry for the misleading description. I actually want to do the last method. I want to show the association inside class A as a label.

I have tried many things, however I still do not get it to work.

I mainly tried two methods:
1) To get a feature label mapping with "Features to display" to the attribute of class B. I put first a Child Reference and Node mapping on the node mapping of class A and used an according compartment. But by doing so I get the error: " 'Containment Feature' must be owned by 'Domain meta element' or its super type of this reference parent node mapping". This error is maybe because it is an association and not an aggregation.

2) I tried with a feature label mapping directly in the node mapping of class A, but then I can only choose attributes of class B as "Features to display". Therefore this does not work as well.

I am also not sure want you mean by custom figure, maybe I do forget something according to this.

Regards,

[Updated on: Fri, 29 October 2010 12:58]

Report message to a moderator

Re: Display association in diagram [message #643810 is a reply to message #636133] Wed, 08 December 2010 11:19 Go to previous message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
Hi,

did you try Expression Label mappings? http://wiki.eclipse.org/GMF_New_and_Noteworthy#2.3_M6 I use this to display attributes from other classes in a label.
self.referenceToOtherClass.AttributeToDisplay.

Hope that helps!

Ralph
Previous Topic:Link direction as semantic attribute
Next Topic:How to setup node after adding it in Mindmap Custom Action Example
Goto Forum:
  


Current Time: Fri Apr 26 12:42:35 GMT 2024

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

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

Back to the top