Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Arrange all(Is there a possibility to call "arrange all" from the Service?)
Arrange all [message #1794009] Wed, 22 August 2018 10:05 Go to next message
Andreas Buchner is currently offline Andreas BuchnerFriend
Messages: 47
Registered: August 2017
Member
Hi,
is there a possibility to call "arrange all" from the Service?
Re: Arrange all [message #1794024 is a reply to message #1794009] Wed, 22 August 2018 14:47 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 572
Registered: May 2011
Senior Member
Hello,

Why do you want to do that? You should be able to do it by calling the LayoutProvider like this LayoutService.getProvider(diagramEditPart).getLayoutNodeProvider(diagramEditPart).layoutEditParts(diagramEditPart, layoutHint) but I don't think it would be recommanded from a Service.

Regards,
Steve


Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Arrange all [message #1794087 is a reply to message #1794024] Thu, 23 August 2018 10:20 Go to previous messageGo to next message
Andreas Buchner is currently offline Andreas BuchnerFriend
Messages: 47
Registered: August 2017
Member
Thanks for your answer! But to be honest, I dont know how to integrate this piece of code and how I call it?

I doth can write a method in the Service and I doth know how to call it.
Thats why I thought, it'd be good, if I can call it from the Service.

But if my thought are no good, could you please tell me how to call the LayoutProvider?
Re: Arrange all [message #1794090 is a reply to message #1794087] Thu, 23 August 2018 11:59 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 572
Registered: May 2011
Senior Member
My bad, LayoutService is not API.

You need to direcly perform an ArrangeRequest on the DiagramEditPart as follows:
ArrangeRequest arrangeRequest = new ArrangeRequest(ActionIds.ACTION_ARRANGE_ALL);
arrangeRequest.setPartsToArrange(Collections.singletonList(editorPart));
editorPart.getDiagramEditPart().performRequest(arrangeRequest);

But once again, why do you want to execute an arrange All from a service? What is your scenario?

Regards,
Steve


Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Arrange all [message #1794127 is a reply to message #1794090] Fri, 24 August 2018 07:43 Go to previous messageGo to next message
Andreas Buchner is currently offline Andreas BuchnerFriend
Messages: 47
Registered: August 2017
Member
Thanks again.

To put it simple, I have a diagram wherein one class has 60+ instances. The big number makes it a bit hard to maintain a good overview.
Every instance resembles a process, that needs to be worked on at a certain point of the project.
So I thought I'd maight be helpful if I first create a set of instances, that need to be worked on first and
create the late instances step by step.... just an idea....
Of course the user could simply press the "arrange all" button, but I think for the user handleability a automatic arrange might be better
Re: Arrange all [message #1794135 is a reply to message #1794127] Fri, 24 August 2018 08:36 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 572
Registered: May 2011
Senior Member
Ok I see your point. What I fear is that you may end up in a situation where the user has to look for elements that keeps moving around . Imagine a scenario where he creates a new instance. The service launches the arrange all resulting in the user having to look around where the new instance has gone. It may even be out of the viewport (the area of the diagram that is currently visible if the diagram is big enough to not be entirely visible at once without zooming out), forcing the user to scroll in order to find it. Furthermore, depending on how the processes are connected between each other, the automatic arrange all may "shuffle" the elements each time you work on a new instance.
It may be easier to have different styles (imagine a border with a different color) if a process is evaluated as "new", "under work", "completed"...

Regards,
Steve



Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Arrange all [message #1794139 is a reply to message #1794135] Fri, 24 August 2018 09:26 Go to previous messageGo to next message
Andreas Buchner is currently offline Andreas BuchnerFriend
Messages: 47
Registered: August 2017
Member
Initially I had like to given every Node/(instance) and every edge (from Node to Node) a fixed Position, when created.
So I can set a clear structure and do not need to depend on a arrange allgorithm.
But that pretty much exceeds my skills :)

Thanks a lot Steve for your fast and helpful respond :)
Re: Arrange all [message #1794146 is a reply to message #1794139] Fri, 24 August 2018 10:30 Go to previous message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 572
Registered: May 2011
Senior Member
You're welcome.
For information, if you want a custom arrange all we provide the following documentation: https://www.eclipse.org/sirius/doc/developer/extensions-provide_custom-arrange-all.html
However, before trying to implement a custom arrange all, I would recommand to check the arrange all (layouting) algorithm that can be selected for a diagram: https://www.eclipse.org/sirius/doc/specifier/diagrams/Diagrams.html#layout
There are many variants of layouting algorithm, especially those provided by the ELK framework. You can experiment with these and find the one that suits you the best.

Regards,
Steve


Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Define Selection Wizard Programmatically
Next Topic:Update sites now have a _ prefix?
Goto Forum:
  


Current Time: Thu Apr 25 10:54:52 GMT 2024

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

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

Back to the top