Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Manipulating GmfMap from Ecore2GMF(Manipulating GmfMap from Ecore2GMF)
Manipulating GmfMap from Ecore2GMF [message #639194] Mon, 15 November 2010 15:19 Go to next message
Dan  is currently offline Dan
Messages: 6
Registered: November 2010
Junior Member
Hi,

Using Eugenia and Ecore2GMF.eol, I am trying to remove a "Feature Label Mapping" from GmfMap without any real success. I am new to GMF and Eugenia in general and I am unsure how to navigate the GmfMap model. Any assistance would be really appreciated.

Kind regards
Re: Manipulating GmfMap from Ecore2GMF [message #639252 is a reply to message #639194] Mon, 15 November 2010 18:18 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-Dominguez
Messages: 309
Registered: January 2010
Senior Member
I'm using something like this to remove Feature Label Mappings myself, starting from the name of the Diagram Label:

var diagLabels = findDiagramLabelsByName(diagramLabelName);
var labelMappings = findLabelMappingsByDiagramLabels(diagLabels);

for (labelMapping in labelMappings) {
  if (labelMapping.isDefined()) {
    delete labelMapping;
  }
}


Basically, first you find the diagram labels by their name, and then look for the label mappings which include those labels. Once you have those, you can just delete them. I can't quite remember now why I checked that they were defined first, though: maybe it's not necessary.

You'll need these two operations:

operation findDiagramLabelsByName(labelName : String) : Collection {
  return GmfGraph!DiagramLabel.all.select(r|r.name = labelName);
}

operation findLabelMappingsByDiagramLabels(diagramLabels : Collection) : Collection {
  return GmfMap!LabelMapping.all.select(r|diagramLabels.includes(r.diagramLabel));
}
Re: Manipulating GmfMap from Ecore2GMF [message #639657 is a reply to message #639252] Wed, 17 November 2010 11:04 Go to previous messageGo to next message
Dan  is currently offline Dan
Messages: 6
Registered: November 2010
Junior Member
Hi Antonio,

Firstly, many thanks for your response; your suggestion worked perfectly and I achieved exactly what I wanted to.

I am finding it quite challenging to find documentation or guidance - for example, how did you know that the right objects were GmfGraph!DiagramLabel and GmfMap!LabelMapping ???

If you could point me in the right direction I would really appreciate it.

Best wishes,

Dan
Re: Manipulating GmfMap from Ecore2GMF [message #639660 is a reply to message #639657] Wed, 17 November 2010 11:16 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios Kolovos
Messages: 1776
Registered: July 2009
Senior Member
Hi Dan,

Exeed should help a lot with this:
http://www.eclipse.org/gmt/epsilon/doc/articles/inspect-mode ls-exeed/

Cheers,
Dimitris

Dan wrote:
> Hi Antonio,
>
> Firstly, many thanks for your response; your suggestion worked perfectly
> and I achieved exactly what I wanted to.
>
> I am finding it quite challenging to find documentation or guidance -
> for example, how did you know that the right objects were
> GmfGraph!DiagramLabel and GmfMap!LabelMapping ???
> If you could point me in the right direction I would really appreciate it.
>
> Best wishes,
>
> Dan
Re: Manipulating GmfMap from Ecore2GMF [message #639664 is a reply to message #639660] Wed, 17 November 2010 11:54 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-Dominguez
Messages: 309
Registered: January 2010
Senior Member
I also find the EPackage Registry view (part of Epsilon, IIRC) quite useful: you can inspect the structure of a registered metamodel without having to create an instance at all. Do not forget to hit "Refresh" after you open it: it is initially empty.
Re: Manipulating GmfMap from Ecore2GMF [message #639694 is a reply to message #639660] Wed, 17 November 2010 14:08 Go to previous messageGo to next message
Dan  is currently offline Dan
Messages: 6
Registered: November 2010
Junior Member
Hi Dimitris,

Many thanks ... this look very useful !!

Cheers

Dan
Re: Manipulating GmfMap from Ecore2GMF [message #639695 is a reply to message #639664] Wed, 17 November 2010 14:09 Go to previous message
Dan  is currently offline Dan
Messages: 6
Registered: November 2010
Junior Member
Hi Antonio,

Thanks for you suggestion ...checking it out!!

Cheers

Dan
Previous Topic:[EWL] Customizing Wizard menu name and position in context menu
Next Topic:Link constraints using Emphatic etc
Goto Forum:
  


Current Time: Sun Oct 26 01:55:26 GMT 2014

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

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