| Summary: | The bordered node created by a tool are not placed near the mouse cursor in the container in some context | ||
|---|---|---|---|
| Product: | [Modeling] Sirius | Reporter: | Pierre Guilet <pierre.guilet> |
| Component: | Diagram | Assignee: | Maxime Porhel <maxime.porhel> |
| Status: | CLOSED INVALID | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | laurent.redor, maxime.porhel |
| Version: | 4.1.0 | Keywords: | triaged |
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows NT | ||
| Whiteboard: | |||
|
Description
Pierre Guilet
Can you try to reproduce with the sample from /org.eclipse.sirius.tests.junit/data/unit/dragndrop/VP-3894 ? I dit not reproduce the problem. Have you the "snap to grid" enabled with a "big" grid spacing? In this case, new border nodes are snap to the grid and it is expected. I tried with and without and the result is the same. The sample of comment 1 works. So without reproduction case, we can not investigate. The problem is the following : When adding the bordered node, during the creation process : - First, a LayoutData is created for the part target of the creation tool by mouse click with information about the click position. - Then, this LayoutData is flushed from the SiriusLayoutDataManagerImpl whereas it should not to work correctly. - The reason why it flushes is that the created bordered node has a conditional style that points at a service for its activation computation. This service changes an attribute value of the new created semantic element with session.getTransactionalEditingDomain().getCommandStack().execute(updateCommand); This call created an OperationHistoryEvent that is detected by SiriusLayoutDataFlusher that runs the flushing. - Then the method using the LayoutData to compute the constraint used to position the new created element in the diagram is done but because of the flush, it is not used and default positioning is used. Conclusion I will modify my service so it will not change the value of the attribute during its creation time. But maybe the flushing condition is not precise enought? Hi Pierre, It seems that you service executes a command on the command stack. But the evaluation of your expression calling your service by Sirius is already done in a command. So you can directly modify your model without the use of the command. You will avoid to create an OperationHistoryEvent and this will not flush the layout data. I close this issue as invalid as it really seems to come from your service. Do not hesitate to reopen the bugzilla if the proposed solution does not solve your issue. Regards, Maxime |