Display association in diagram [message #635672] |
Wed, 27 October 2010 17:12 |
TSchwalb 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 #635945 is a reply to message #635672] |
Thu, 28 October 2010 16:39 |
|
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 |
TSchwalb 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
|
|
|
|
Powered by
FUDForum. Page generated in 0.02791 seconds