Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » "Arrange All" for top elements and their compartment elements
"Arrange All" for top elements and their compartment elements [message #216391] Mon, 26 January 2009 16:53 Go to next message
Eclipse UserFriend
Originally posted by: xxx.xxx.xxx

Hi all,

I notice that the "Arrange All" action arranges the top diagram elements
only... say you have top elements A and B in the diagram, each of which
has a compartment containing A1 and A2, and B1 and B2 respectively.

If the diagram is selected, the "Arrange All" action arranges A and B
inside the diagram, but does not arrange A1 and A2 inside A, or B1 and B2
inside B.

If the compartment of A is selected, the "Arrange All" action arranges A1
and A2 inside A, but does not arrange B1 abd B2 inside B, or A and B
inside the diagram.

e.g. in the Mindmap example, the diagram is in focus, the "Arrange All"
action arranges the topics in the diagram, but the threads inside the
topic compartments are not arranged.

I tried using ArrangeRequest:

ArrangeRequest arrangeRequest = new
ArrangeRequest(ActionIds.ACTION_ARRANGE_ALL);
MyTopEditPart myTopEditPart = (MyTopEditPart)
ilEditor.getDiagramEditPart();
List<EditPart> ep = new ArrayList<EditPart>();
//create the ep list....
arrangeRequest.setPartsToArrange(ep);
//etc...

and no matter which edit parts I put in the ep list (only the top, or only
one of the compartments), always the top elements are arranged, but their
compartment objects are not.

I can't figure out how to arrange everything together (the top elements
and their compartment contents). Any suggestions are highly appreciated..

Kind regards,
Iliyana
Re: "Arrange All" for top elements and their compartment elements [message #216412 is a reply to message #216391] Tue, 27 January 2009 01:58 Go to previous message
Alex Boyko is currently offline Alex BoykoFriend
Messages: 200
Registered: July 2009
Senior Member
Hi,

There are two options i can suggest you:
1) Requires less work. Use a subclass of CompositeLayoutProvider.
2) Requires more work, but in general case better results. Use Draw2D
CompoundDirectedGraphLayout. You'll have to write a GMF layout provider
for this one... it's not adopted by GMF yet.
Hope this helps.

Cheers,
Alex
Previous Topic:[Announce] GMF 2.1.3 M200901221632 is available
Next Topic:Control Position of dragged element
Goto Forum:
  


Current Time: Thu Apr 25 14:28:43 GMT 2024

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

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

Back to the top