UML comment, UML class, and rectangle elements now have 4 snap handles as children. These are added via FXML, positioned via code on initialization, and are only visible while moving a connector's point.
When moving a connector's point, snap handles will show on all elements that have them. If the cursor is then released over one of these, instead of moving the point normally the point will be snapped to the snap handle.
A point snapped to a snap handle will maintain a specific orientation (horizontal/vertical) depending on which snap handle it is snapped to. It will also move with the snap handle.
Moving a snapped connector point without it snapping it will un-snap it if it was snapped.
Moving a connector with snapped points will un-snap any snapped points.
There is a new command for snapping/un-snapping a connector point.
TODO: There's no good handling at the moment for snap handles that are deleted. The behavior looks fine enough but some cleanup needs to be implemented on element deletion. THAT SAID, there is now handling in the save file compressor to prevent this these situations from affecting anything, even if something that a connector was snapped to is deleted.
Connectors will always show over non-connector elements. Previously the most recent element would be shown first, which is still true, but this rule takes priority.
KNOWN ISSUE (?): Connectors snapped to the far side of an element will go through the element if they have to reach the other side. I find this acceptable since it's really hard not to do that, and users can just snap to the correct side.
Saving and loading looks like it works following some straightforward changes, but we should probably do a bunch more manual testing for it.
Tests:
New unit tests for snapping on the connector element controller.
Unit tests for commands and other minor classes introduced.
New UI tests for snapping and unsnapping connectors, these also work for arrow connectors.
Changes:
Tests: