Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » ECore2GMF.eol: How to access/change node in GmfMap
ECore2GMF.eol: How to access/change node in GmfMap [message #582724] Thu, 12 November 2009 11:45 Go to next message
Christoph Wienands is currently offline Christoph WienandsFriend
Messages: 55
Registered: July 2009
Member
I am currently trying to change an attribute value of a node in GmfMap. I have some trouble mapping the information given in "Polishing your GMF editor" (about gmfgraph) to the gmfmap.

I attached an image that shows the node that I am trying to address. I am confused about how to create the node matching expression. Is that based on the structure that I see in the EMF-based editor, or is it based on the physical structure in the underlying model file (in the case of gmfmap, there is a great difference in the hierarchies between what you see and what is saved). Furthermore, the node I need to select does not have an easily identifiable property, such as 'Name'. The second attached image shows the property that I need to change.

Any help is greatly appreciated.

Thanks, Christoph

PS: Once I have solved this, I will submit a feature request to enable diagram partitioning with super and subdiagrams of same type.
Re: ECore2GMF.eol: How to access/change node in GmfMap [message #582747 is a reply to message #582724] Thu, 12 November 2009 11:52 Go to previous messageGo to next message
Christoph Wienands is currently offline Christoph WienandsFriend
Messages: 55
Registered: July 2009
Member
Hmm, I just realized that my file attachments got lost. Feature seems to be broken.

So the hierarchy in gmfmap looks like this (the last node is the one I'm trying to address):
-Mapping
-Top Node Reference <states:CompartmentState/CompartmentState>
-Node Mapping <CompartmentState/CompartmentState>
-Child Reference <submachine:PartitioningState/PartitioningState>
-Node Mapping <PartitioningState/PartitioningState>

The attribute I would like to change is the 'Related Diagrams' property in the 'Misc' group. I need to set it to 'Canvas Mapping' (in the raw XML this is shown as '//@diagram').

Hope this is enough information.

Thanks, Christoph
Re: ECore2GMF.eol: How to access/change node in GmfMap [message #582763 is a reply to message #582724] Thu, 12 November 2009 11:52 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Christoph,

Unfortunately the images haven't made it. Are you using the web
interface or an NNTP client?

Cheers,
Dimitris

Christoph Wienands wrote:
> I am currently trying to change an attribute value of a node in GmfMap.
> I have some trouble mapping the information given in "Polishing your GMF
> editor" (about gmfgraph) to the gmfmap.
>
> I attached an image that shows the node that I am trying to address. I
> am confused about how to create the node matching expression. Is that
> based on the structure that I see in the EMF-based editor, or is it
> based on the physical structure in the underlying model file (in the
> case of gmfmap, there is a great difference in the hierarchies between
> what you see and what is saved). Furthermore, the node I need to select
> does not have an easily identifiable property, such as 'Name'. The
> second attached image shows the property that I need to change.
>
> Any help is greatly appreciated.
>
> Thanks, Christoph
>
> PS: Once I have solved this, I will submit a feature request to enable
> diagram partitioning with super and subdiagrams of same type.


--
Spread the word: http://www.eclipse.org/gmt/epsilon/spreadtheword
Follow Epsilon on Twitter: http://twitter.com/epsilonews
Re: ECore2GMF.eol: How to access/change node in GmfMap [message #583071 is a reply to message #582724] Fri, 20 November 2009 00:50 Go to previous message
Christoph Wienands is currently offline Christoph WienandsFriend
Messages: 55
Registered: July 2009
Member
Never mind. I finally discovered the println feature in EOL and figured out that the nodeMapping.relatedDiagrams attribute is in fact an EolCollectionType object. Now don't ask me how a collection is stuffed into an XML attribute at the file level (seems counter-intuitive to me), but I finally got this code here working:


var nodeMapping := GmfMap!NodeMapping.all.selectOne(nm|nm.domainMetaElement.nam e = "PartitioningState");
var canvasMapping := GmfMap!CanvasMapping.all.first();
nodeMapping.relatedDiagrams.add(canvasMapping);

Christoph
Previous Topic:ECore2GMF.eol: How to access/change node in GmfMap
Next Topic:[Eugenia] Subdiagrams
Goto Forum:
  


Current Time: Sun Nov 23 20:13:23 GMT 2014

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

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