|reference based links: using both the link diagram and the property sheet [message #676209]
||Fri, 03 June 2011 08:10
Registered: July 2009
I have an EMF model with 2 classes, Alpha and Beta, and there is an association 'alphasworking' with a multiplicity of 0..* between these two classes (Beta has zero or more Alphas working for it).
| B | -----> |A|
In my GMF diagram, the instances of Beta and Alpha are represented with rectangular shapes.
The association property 'alphasworking' is a multiple choice control in the property sheet and allows you to create the association between Alpha and Beta.
I want the association to be visible as a link in the diagram.
In my gmfmap, I have defined a reference-based link with :
- targetFeature = Beta.alphasworking:Alpha
- DiagramLink = Connection AlphaToBeta
After regenerating the diagram code , I can draw the link from Beta to Alpha, and the property is updated. I can delete the link and the property is removed.
The trouble is:
If I add or remove an Alpha object in the property 'alphasworking' by means of the property sheet, no link is drawn or removed. The figure of the link is somehow independent of the property.
I don't know where to start to fix this issue:
- If I add an Alpha object to the property 'alphasworking' by means of the property sheets, I can know about the change in the notifyChanged function of the BetaEditPart, and from there, I could refresh the link. But the AlphasWorkingEditPart (EditPart of the link) is not related to the BetaEditPart because it has no element of its own in the model. A figure for the link (and an Editpart object) might already exist if the user drew it first, but if the user used the property sheets only, there is no link figure.
Where and what do I need to change (in gmfmap or in the generated code) in order to have the property 'alphasworking' controlling the alphasworking link figure and editpart? I get the impression that the notifyChanged function is not the right place (not right enough in any case) to handle the issue.
Thx for any help
Powered by FUDForum
. Page generated in 0.01590 seconds