-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix issue #343 Restrict message end movement #331
Conversation
Update alignment constraints and feed-back of message creation to enforce horizontality of non-asynchronous messages by recalculating the sending end instead of the receiving end because the receiving end is generally more significant. Implement a magnet mechanism to snap connections to the ends of an execution specification. Upon creation of a message connecting to either end of an execution specification, replace the occurrence at that end by the message end. Register a palette provider that injects magnet manager support into the selection tool and connection creation tools to support user override of the magnet snapping behaviour when drawing and moving connections, using the same keyboard modifier as for suppression of the snapping of shapes. Update a create message test to account for messages anchored on the beginning of an execution specification correctly remaining attached when the execution moves. Signed-off-by: Christian W. Damus <give.a.damus@gmail.com> # Conflicts: # plugins/org.eclipse.papyrus.uml.interaction.model/src/org/eclipse/papyrus/uml/interaction/internal/model/commands/InsertMessageCommand.java # plugins/org.eclipse.papyrus.uml.interaction.model/src/org/eclipse/papyrus/uml/interaction/internal/model/spi/impl/DefaultDiagramHelper.java # plugins/org.eclipse.papyrus.uml.interaction.model/src/org/eclipse/papyrus/uml/interaction/model/spi/DiagramHelper.java
ba83825
to
dc5ef5c
Compare
Fix the semantic ordering of fragments on creation of a message, inserting new message ends more correctly relative to the existing interaction fragments in the interaction’s ordered fragments list. This removes the need for work-arounds in the tests that post facto adjusted semantic ordering.
Measure the actual top and bottom of the execution specification as actually rendered differently on different platforms, instead of assuming that it ends up exactly where requested via the API.
Get the actual location at which to grab the message to move it in message moving tests, to account for platform variability.
Implement the requirement to not allow movement of a message end to result in the other end being moved also to maintain semantic integrity. Thus, only the end grabbed by the user can be moved and then only if the resulting message (the other end always staying put) would be valid. Signed-off-by: Christian W. Damus <give.a.damus@gmail.com> # Conflicts: # plugins/org.eclipse.papyrus.uml.diagram.sequence.runtime/src/org/eclipse/papyrus/uml/diagram/sequence/runtime/internal/edit/policies/AbstractSequenceGraphicalNodeEditPolicy.java
dc5ef5c
to
f39f2eb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot! This mostly works very well. I just encountered two bugs while testing:
-
Moving the send message end of a sync message connected to the start of an execution downwards leads to a down-sloped sync message pointing to the middle of the execution.
Initial scenario:
Now select the message, grab the handle on the send event message end and move it downwards and drop the message end. Then I get this situation:
-
Strictly speaking, this is not a message end move problem, but a message move problem in general (so feel free to address this in a separate issue). Given the same initial scenario as above, when grabbing the message in the middle and moving it upwards above the start of the lifeline, we end up with this scenario:
Thanks!
The connection to the lifeline probably is happening because of the rebase, which brings in message anchors on the lifeline head that were implemented in parallel for create messages. So, I'll need to do some work to disable the move to the lifeline head. No immediate thoughts on the other problems. I'll look into them. |
Do not permit connection to the lifeline head. Signed-off-by: Christian W. Damus <give.a.damus@gmail.com>
When drawing a message replaces an execution occurrence specification that starts or finishes an execution specification, the ordering of the message ends would end up reversed in the interaction fragments (the message being received before it is sent) and also (in the case of starting the execution specification) after the execution specification, itself. Signed-off-by: Christian W. Damus <give.a.damus@gmail.com>
Fix some mistakes in the anchoring of message ends to lifelines and execution specifications when moving messages such that a message end moves from an execution specification to a lifeline or vice-versa. Signed-off-by: Christian W. Damus <give.a.damus@gmail.com>
I've fixed a few more of the problems found in @planger's testing (thanks). There is still an issue in the visual feed-back during message move remaining stuck at the start or finish of an execution specification. A naïve fix that lets execution specifications have left- or right-side anchors with negative values or values greater than the length of the execution fixes that problem, but doesn't really make sense and breaks a JUnit test for create messages. So, I need to work on letting the |
@cdamus Awesome, thanks! Code looks good so far. So I think we can approve all changes up until now. There are just a few more remaining issues. Here is the summary of the results of re-testing with these changes merged into current master:
|
Adds tests for issues eclipsesource#343 and eclipsesource#347. To enable more efficient adding of testing, this change also refactors the tests a bit and extracts common methods into dedicated model fixture. Fix wrong name of receive of message 2 Improve ModelEditFixture.isSemanticallyBefore() Signed-off-by: Philip Langer <planger@eclipsesource.com>
Address comments from code review of tests contribution for issue eclipsesource#343. Signed-off-by: Christian W. Damus <give.a.damus@gmail.com>
Intend to follow up additional issues in this PR.
Fix the semantic insertion order of interaction fragments in the case of creating an execution specification. Includes fixing a test that didn’t account for tear-down of the logical model when the model is changed. Also adding the Papyrus di resources to git for ease of reference to the notation in a Papyrus run-time workbench. Signed-off-by: Christian W. Damus <give.a.damus@gmail.com>
@planger I have pushed a new commit that fixes the execution-specification insertion problems (I have checked them off in your comment). Thus only the "Easter egg" and feedback issues remain, which as discussed off-line are of lower priority and can be deferred. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks a lot! Works fine and the tests pass now. (y) I'll create new gh issues for the two remaining problems. I'll do some more in depth testing in the next days, but this shouldn't hold up merging this branch imho.
I've opened #349 and #350 for the remaining issues mentioned in #331 (comment). |
Note that this pull request is based on pull request #330 for issue #73, which is not yet merged.
Implement the requirement to not allow movement of a message end to result in the other end being moved also to maintain semantic integrity. Thus, only the end grabbed by the user can be moved and
then only if the resulting message (the other end always staying put) would be valid.