Home » Modeling » Epsilon » Emtpy Error when generating GMF tool, graph and map models
Emtpy Error when generating GMF tool, graph and map models [message #1042395] |
Tue, 16 April 2013 11:26 |
|
Hello folks
I seem to have stumbled upon an error[1] that I find strange and I was wondering if anyone could help me with it. I get it when I try to run "Eugenia->Generate GMF tool, graph and map models" on my ecore file after I have annoted it in an emf file.
The error seems to be related to PossibleValues section in my XText grammar below:
AttributeDefinition:
'*' name = ValidName '(' type = AttributeType ')'
(translations += Translation)*
(internalProperties += InternalProperty
| ( '-' externalProperties += ExternalProperty)
| ( '+' possibleValues += PossibleValues ))*
;
PossibleValues:
values += Type (',' values += Type)*
;
I know I can get rid of the error if I type
AttributeDefinition:
'*' name = ValidName '(' type = AttributeType ')'
(translations += Translation)*
(internalProperties += InternalProperty)*
( '-' externalProperties += ExternalProperty))*
( '+' possibleValues += Type (',' possibleValues += Type)*)?
;
but then I end up with a "!unique attr String[*] possibleValues;" that I seem unable to turn into a @gmf.compartment and I am unable to make it a node in the GMF diagram. (So I can only edit the values from the property window and not able to add them directly in the diagram)
So I was wondering what limits me from having the PossibleValues property that only contains a list of Type (read as string in the .emf file) and is there a way to make it so that in the emf file I can "map" a "!unique attr String[*] possibleValues;" as a node?
Thanks for any help
Write you later / Mårten
|
|
|
Re: Emtpy Error when generating GMF tool, graph and map models [message #1042531 is a reply to message #1042395] |
Tue, 16 April 2013 14:40 |
|
Hi Mårten,
If memory serves, attribute-based compartments are not supported by Eugenia. I'll have a closer look at this when I get a chance and let you know if this is a limitation of Eugenia or something that's imposed by GMF. In any event, if it is possible to do this in GMF you could consider using a polishing transformation to automate the process.
Cheers,
Dimitris
|
|
|
Re: Emtpy Error when generating GMF tool, graph and map models [message #1043279 is a reply to message #1042531] |
Wed, 17 April 2013 13:57 |
|
Hi Dimitris
Thanks for the help, have a feeling I will have to add you and Claudio as references for my graduation paper with all the help you two give
Have a bit paperwork that have fallen behind (its programming that is fun, not writing about it ) but I will hopefully be able to try some more at the end of the week. Had to google "polishing transformation", but always fun to learn new terms .
I tried show them with labels instead, since I mostly just want them to be shown to the user in some way, but it didn't really work the way I wanted so was wondering what I was doing wrong.
I have two attribute-based compartments so I tried to do the following:
@gmf.node(label="name, type", label.pattern="{0} ({1}))
class myNode{
... node things ...
@gmf.label(label="possibleValues, defaultValues", label.(edit.)pattern="PossibleValues: {2}, DefaultValues: {3}")
!unique attr String[*] possibleValues;
!unique attr String[*] defaultValues;
}
but it wouldn't show the string for my label inside the node. If I had text in the default node label it worked fine I only seem to get values on the second label.
Am I misusing the labels?
I guess I can use the label for the entire node but just trying to separate the name and type from the other values.
Have a nice day
Mårten
|
|
|
Re: Emtpy Error when generating GMF tool, graph and map models [message #1043358 is a reply to message #1043279] |
Wed, 17 April 2013 15:50 |
|
Hi Mårten,
The closest to valid Eugenia annotations would be the following:
---
@gmf.node(label="name, type", label.pattern="{0} ({1})")
class Node{
attr String name;
attr String type;
@gmf.label(label.pattern="PossibleValues: {0}")
!unique attr String[*] possibleValues;
@gmf.label(label.pattern="DefaultValues: {0}")
!unique attr String[*] defaultValues;
}
---
Would this be close to what you're after?
Cheers,
Dimitris
-
Attachment: node.png
(Size: 6.16KB, Downloaded 209 times)
|
|
|
Re: Emtpy Error when generating GMF tool, graph and map models [message #1043839 is a reply to message #1043358] |
Thu, 18 April 2013 07:19 |
|
Hi Dimitris
Yes, that could look quite nice. Sadly when I type it like you do I still don't get the texts "PossibleValues" and "DefaultValues" for some reason[1].
Am I missing some update or something? I have downloaded the Eclipse Distribution from the epsilon homepage and I have Eugenia version 1.0.0.201211082326.
Or a longshot but I doubt it, it doesn't have anything to do with EGit? Get a warning because I don't have Git installed and the variable HOME declared when I start eclipse... but I doubt thats the problem just tossing things out there to try and cover more ground in one post
Thanks for your time and patience
Write you later / Mårten
-
Attachment: node.png
(Size: 17.70KB, Downloaded 225 times)
|
|
| |
Re: Emtpy Error when generating GMF tool, graph and map models [message #1043880 is a reply to message #1043845] |
Thu, 18 April 2013 08:14 |
|
Hi Dimitris,
It doesn't seem to work from that update either. I seem to have a skill to make things not work for me that should work .
But I tried to fiddle with the labels and I seem to have... strange behavior so I think I might have something wrong at my end. Some might be GMF related but I seem unable to use other label flags as well.
Things I noticed is:
- The label.text="DefaultText" doesnt seem to do anything
- The flag label.readOnly="true" only works for the node's label
Also found strange behavior when I try to modify the label in the diagram with delete and add (Might be GMF related):
- Adding a new item requires that I first empty the label and write only the new value, if I write the new value in the middle of the others it will generate a new value combined of all the others among the first values, i.e try to add 15 to [3, 14] I get [3, 14, [3, 14, 15]]
- Seem unable to delete values from the label in the diagram
Well, since the last parts probably is GMF related I still seem to have some issues with the gmf.label for EAttributes that shouldn't be there. Any idea what else I might take a look at?
Write you later / Mårten
|
|
| | |
Re: Emtpy Error when generating GMF tool, graph and map models [message #1043903 is a reply to message #1043358] |
Thu, 18 April 2013 08:43 |
Claudio Heeg Messages: 75 Registered: April 2013 |
Member |
|
|
Dimitris Kolovos wrote on Wed, 17 April 2013 17:50Hi Mårten,
The closest to valid Eugenia annotations would be the following:
---
@gmf.node(label="name, type", label.pattern="{0} ({1})")
class Node{
attr String name;
attr String type;
@gmf.label(label.pattern="PossibleValues: {0}")
!unique attr String[*] possibleValues;
@gmf.label(label.pattern="DefaultValues: {0}")
!unique attr String[*] defaultValues;
}
---
You know, looking at this, I was thinking.
Why not make it possible to reference directly within that label?
Let's say "type" was a reference to something defined in that model, that "type" has attributes "name" and "content". If "type.name" would be accessible directly from this label, that would in my opinion be a substantial help in designing.
What do you think, Dimitris, also about the difficulty of implementing this?
|
|
| | |
Re: Emtpy Error when generating GMF tool, graph and map models [message #1047406 is a reply to message #1046696] |
Tue, 23 April 2013 06:57 |
|
Think I found an error in your new code related to the labels.
Because of a structural change in my XText grammar I had to change what I used in my label to a reference so I couldn't use it in my label anymore. (No such object objection)
So I tried to remove the label with @gmf.label(label.placement="none") but then I get a split error I didn't get with the older code.
Haven't used so much bug-report systems but should I try to add it in the link you posted before Dimitris?
Write you later / Mårten
[EDIT: Added the picture of the error message]
[Updated on: Tue, 23 April 2013 06:58] Report message to a moderator
|
|
| | |
Goto Forum:
Current Time: Thu Sep 19 12:22:18 GMT 2024
Powered by FUDForum. Page generated in 0.30171 seconds
|