Skip to main content



      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 06:05 Go to next message
Eclipse UserFriend
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 10:47 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Arrange all [message #1794087 is a reply to message #1794024] Thu, 23 August 2018 06:20 Go to previous messageGo to next message
Eclipse UserFriend
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 07:59 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Arrange all [message #1794127 is a reply to message #1794090] Fri, 24 August 2018 03:43 Go to previous messageGo to next message
Eclipse UserFriend
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 04:36 Go to previous messageGo to next message
Eclipse UserFriend
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

Re: Arrange all [message #1794139 is a reply to message #1794135] Fri, 24 August 2018 05:26 Go to previous messageGo to next message
Eclipse UserFriend
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 06:30 Go to previous message
Eclipse UserFriend
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
Previous Topic:Define Selection Wizard Programmatically
Next Topic:Update sites now have a _ prefix?
Goto Forum:
  


Current Time: Wed Jul 23 17:24:14 EDT 2025

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

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

Back to the top