Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Graphical Editor: Modify automatic layout
Graphical Editor: Modify automatic layout [message #1102218] Thu, 05 September 2013 14:25 Go to next message
Studs Terkel is currently offline Studs Terkel
Messages: 10
Registered: July 2011
Junior Member
Hello guys,

I create a new _diagram by passing a model instance:

org.eclipse.gmf.runtime.notation.Diagram diagram = null;
			try {
				diagram = ViewService.createDiagram(modelInstance,
						MyEditPart.MODEL_ID,
						MyEditorPlugin.DIAGRAM_PREFERENCES_HINT);

				diagram.setElement(modelInstance);
				TransactionalEditingDomain editingDomain = GMFEditingDomainFactory.INSTANCE
						.createEditingDomain();
				Resource diagramResource = editingDomain
						.getResourceSet()
						.createResource(
								URI.createFileURI(location
										+ "/modelInstance.mymodel_diagram"));
				diagramResource.eSetDeliver(false);
				diagramResource.getContents().add(diagram);
				diagramResource.eSetDeliver(true);
				diagramResource.save(null);

			} catch (IOException e) {
				e.printStackTrace();
			}


Unfortunately, when I open this _diagram with the related Graphical Editor, the contained elements are layouted from the bottom to the top (it is an activity diagram, so the initial node is on the bottom of the diagram). What I want is that the elements are layouted from left to the right.

My question now: Is there a possibility to modify the auto/default layout behavior?
Re: Graphical Editor: Modify automatic layout [message #1110757 is a reply to message #1102218] Tue, 17 September 2013 09:42 Go to previous message
Ralph Gerbig is currently offline Ralph Gerbig
Messages: 697
Registered: November 2009
Senior Member
Hi,

maybe this can help you http://publib.boulder.ibm.com/infocenter/rsmhelp/v7r0m0/topic/org.eclipse.gmf.doc/tutorials/diagram/automaticLayout.html

Ralph

[Updated on: Tue, 17 September 2013 11:19]

Report message to a moderator

Previous Topic:create diagram from .ecore file by GMF
Next Topic:[ZEST] unhighlight the item when selected again
Goto Forum:
  


Current Time: Thu Oct 23 00:56:59 GMT 2014

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

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