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 10:25 Go to next message
Missing name Mising name is currently offline Missing name Mising name
Messages: 8
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 05: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 07: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 Jul 31 19:46:37 EDT 2014

Powered by FUDForum. Page generated in 0.01381 seconds