Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Getting related diagrams in different files
Getting related diagrams in different files [message #192306] Thu, 12 June 2008 12:11 Go to next message
Eclipse UserFriend
Originally posted by: georges.bachelier.atmel.com

Hello everybody!

in my .gmfmap file I have set the "Related Diagrams" property of a
particular entity of the model to "Canvas Mapping" so that a graphical
editor opens when I double-click this particular kind of node in a diagram.

The current mechanism imposes the name of the related diagram (if the
first diagram is named default.flow_diagram, the related one will be named
default.flow_diagram#1).

I would like the related diagram to be opened in a new file which name I
can define through a dialog, for example. Could you please tell me how to
do this?

Thanks a lot in advance for your time!

Georges
Re: Getting related diagrams in different files [message #192410 is a reply to message #192306] Fri, 13 June 2008 09:44 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Georges,

Try modifying generated OpenDiagramEditPolicy in accordance.

-----------------
Alex Shatalin
Re: Getting related diagrams in different files [message #192508 is a reply to message #192410] Fri, 13 June 2008 15:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: georges.bachelier.atmel.com

Hi Alex,

that's the direction I was going to. Thanks a lot!

Best regards,

Georges
Re: Getting related diagrams in different files [message #192885 is a reply to message #192410] Mon, 16 June 2008 14:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: georges.bachelier.atmel.com

Hi Alex,


I know I have to modify the OpenDiagramEditPolicy code, but I don't know
how to write the necessary modifications.

I want related diagrams to be written in different files. When the user
double clicks a sub-program symbol of our program flow diagram, we want
the corresponding sub-program flow to be opened if it exists, otherwise we
want a dialog to be displayed in which the user may enter the name of the
diagram to be produced.

Could you please tell me how you would implement this feature?

Thanks a lot in advance for your time!

Georges
Re: Getting related diagrams in different files [message #193490 is a reply to message #192885] Thu, 19 June 2008 09:04 Go to previous message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Georges,

OpenDiagramEditPolicy.OpenDiagramCommand.intializeNewDiagram ():

Diagram d = ViewService.createDiagram(getDiagramDomainElement(), getDiagramKind(),
getPreferencesHint());
if (d == null) {
throw new ExecutionException("Can't create diagram of '" + getDiagramKind()
+ "' kind");
}
diagramFacet.setDiagramLink(d);
assert diagramFacet.eResource() != null;
/*
This is a place where newly created diagram instance attached to it's containing
resource.
I'm suggesting you to lod/create new resource associated with working resource
set here
+ attach created diagram to this resource using standard EMF API.
*/
diagramFacet.eResource().getContents().add(d);

-----------------
Alex Shatalin
Previous Topic:How do I go about implementing paste at position
Next Topic:Connection between GMF and backend plugin
Goto Forum:
  


Current Time: Tue Apr 30 05:33:39 GMT 2024

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

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

Back to the top