Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Arrange all without an editor
Arrange all without an editor [message #234608] Wed, 24 June 2009 17:14 Go to next message
Sebastian is currently offline SebastianFriend
Messages: 14
Registered: July 2009
Junior Member
Hi,

I'm doing diagram transformations, which happen offscreen and
automatically. But how can I arrange all elements of a diagram without
opening an editor. What I already have is the Diagram-Object.

regards
Sebastian
Re: Arrange all without an editor [message #234629 is a reply to message #234608] Thu, 25 June 2009 09:23 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Sebastian,

You can call Diagram.getChildren(), collect all child Nodes from there and
modify layoutConstraints using getLayoutConstraint()/setLayoutConstraint()
methods.

-----------------
Alex Shatalin
Re: Arrange all without an editor [message #234720 is a reply to message #234629] Fri, 26 June 2009 08:35 Go to previous messageGo to next message
Sebastian is currently offline SebastianFriend
Messages: 14
Registered: July 2009
Junior Member
Hi Alex,

with the LayoutConstraint I can set the position of each diagram element.
Isn't there a possibility to use the layout algorithm, which is also
called by running "Arrange all" in the editors pop up menu?

Sebastian
Re: Arrange all without an editor [message #234739 is a reply to message #234720] Fri, 26 June 2009 11:19 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Sebastian,

Probably yes, but I do not know how to call it. ;-)

-----------------
Alex Shatalin
Re: Arrange all without an editor [message #234768 is a reply to message #234739] Fri, 26 June 2009 12:01 Go to previous messageGo to next message
Sebastian is currently offline SebastianFriend
Messages: 14
Registered: July 2009
Junior Member
And do you know somebody, who could know this? :-)

Sebastian
Re: Arrange all without an editor [message #234775 is a reply to message #234739] Fri, 26 June 2009 12:27 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Alex,

See org.eclipse.gmf.runtime.diagram.ui.services.layout.LayoutSer vice as a
starting point.

-----------------
Alex Shatalin
Re: Arrange all without an editor [message #234791 is a reply to message #234775] Fri, 26 June 2009 15:19 Go to previous messageGo to next message
Sebastian is currently offline SebastianFriend
Messages: 14
Registered: July 2009
Junior Member
Thank you Alex!

With LayoutService.getInstance().layout(diagram, LayoutType.DEFAULT); it
works.

But if there are unvisible nodes in a diagram, there will be a nullpointer
exception in LayoutService.getLayoutNodes(DiagramEditPart,List). This is
why, such nodes don't have a GraphicalEditPart (I think :-)).

And an other little thing: In the Javadoc comment of layout() stands
"ILayoutType". But there is no such class or interface. It should be
"LayoutType", which exists.

regards
Sebastian
Re: Arrange all without an editor [message #234813 is a reply to message #234791] Fri, 26 June 2009 15:52 Go to previous message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Sebastian,

Please file a bugzilla request(s) for it then we will be able to correct
these problems.

-----------------
Alex Shatalin
Previous Topic:Content assist for Text in GMF
Next Topic:Use of ConnectionHandle to add new node with connection
Goto Forum:
  


Current Time: Thu Mar 28 21:12:52 GMT 2024

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

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

Back to the top