Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Custom Diagram Layout ('arrange-all') does not work as expected
Custom Diagram Layout ('arrange-all') does not work as expected [message #1801555] Tue, 22 January 2019 13:54
Joerg Hermann is currently offline Joerg HermannFriend
Messages: 15
Registered: September 2012
Location: Munich
Junior Member
Hi *,
I have created a custom layout implementation of the layout, where I tried to follow the concept described in the class LineLayoutProvider.
In my case, I need to place containers and border nodes attached to these containers by some semantic logic; i.e. the containers are placed in a kind of grid (positions are determined by internal properties) and the border nodes are located in groups and sorted by their name within these groups.
I divided the layout operation into two phases, 1st applying the location and size of the container nodes, and 2nd applying the location of the border nodes.

Here I'm running into 2 issues:

  • Relocating and resizing of the containers to their new position:
    Applying the new location worked fine, but the new size was not accepted (it appeared to keep the original size).
    The implementation is similar to the LineLayoutProvider by creating ChangeBoundsRequest with type RequestConstants.REQ_MOVE and RequestConstants.REQ_RESIZE, respectively.
    After debugging, I found that the new size was written to the Node, but reverted
    afterwards by the SnapToGrid logic. After disabling the the 'SnapToGrid' Option.
    this step worked properly as well.
    This is a workaround for me, but I would appreciate to know a clean way to solve this.
  • Applying the locations for the border nodes appears to work incrementally only.
    I.e. I need to run the arrange-all rouhgly 5 to 10 times. Each iteration improves the
    appearance. At the end everything is located as intended.
    I found that the location of the bordernode figure is updated with the relocation
    of the parent figure, keeping the original relative location within the parent.
    There is another update to the figure with a slight vertical movement of the bordernode, bit not by the amount that was specified in the Request.
    I assumed that the REQ_MOVE needs to be relative to this parent position.
    I suspect as well that there is an interaction with the BorderNodeLocator, but I could not figure out how to avoid this.


I would very much appreciate any hints (or if any of my above assumptions are wrong; any help is welcome).

-
thanks & best regards, Joerg
Previous Topic:Representation diagram in Tree Description
Next Topic:Getting resource malformed URL exception exception while closing and opening the project
Goto Forum:
  


Current Time: Tue Apr 23 18:00:07 GMT 2024

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

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

Back to the top