diff options
| author | Laurent Redor | 2015-04-08 09:33:16 +0000 |
|---|---|---|
| committer | Laurent Redor | 2015-04-09 09:35:53 +0000 |
| commit | 675d9ba0452582adef2e559079379d962b63664c (patch) | |
| tree | c382eba1fb7d870bc1e78e6eb8f17747c339242b | |
| parent | cd10e9655c760fa1cde1c62c6001a26affe24b33 (diff) | |
| download | org.eclipse.sirius-675d9ba0452582adef2e559079379d962b63664c.tar.gz org.eclipse.sirius-675d9ba0452582adef2e559079379d962b63664c.tar.xz org.eclipse.sirius-675d9ba0452582adef2e559079379d962b63664c.zip | |
[463485] Specification
Bug: 463485
Change-Id: I1928f706f540a0c3d9d6807add4da4357284345f
Signed-off-by: Laurent Redor <laurent.redor@obeo.fr>
5 files changed, 95 insertions, 0 deletions
diff --git a/plugins/org.eclipse.sirius.doc/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.sirius.doc/.settings/org.eclipse.core.resources.prefs index 00fae427fa..ee70190fe6 100644 --- a/plugins/org.eclipse.sirius.doc/.settings/org.eclipse.core.resources.prefs +++ b/plugins/org.eclipse.sirius.doc/.settings/org.eclipse.core.resources.prefs @@ -11,3 +11,4 @@ encoding//specs/archived/435507_SnapToGridForCreation/435507.html=utf-8 encoding//specs/archived/437097-moveEdgeClosestSegmentWhenMovingNode/437097-moveEdgeClosestSegmentWhenMovingNode.html=utf-8 encoding//specs/archived/441090_ResizeNodeWithoutModifyingContainedElementsLocation/441090.html=utf-8 encoding//specs/archived/442289_DistributeShapesActions/442289_DistributeShapesActions.html=utf-8 +encoding//specs/proposal/463485_snapToAllShapes/463485.html=utf-8 diff --git a/plugins/org.eclipse.sirius.doc/specs/proposal/463485_snapToAllShapes/463485.html b/plugins/org.eclipse.sirius.doc/specs/proposal/463485_snapToAllShapes/463485.html new file mode 100644 index 0000000000..96596324b0 --- /dev/null +++ b/plugins/org.eclipse.sirius.doc/specs/proposal/463485_snapToAllShapes/463485.html @@ -0,0 +1 @@ +<?xml version='1.0' encoding='utf-8' ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body><h1 id="Snaptoallshapes">Snap to all shapes</h1><h2 id="Preamble">Preamble</h2><p><em>Summary</em>: Add capability to snap to all shapes when moving or resizing a node or a container.</p><table><tr><th>Version </th><th>Status </th><th>Date </th><th>Authors </th><th>Changes </th></tr><tr><td>v0.1 </td><td>DRAFT </td><td>2015-04-08 </td><td>lredor </td><td>Initial version. </td></tr></table><p><em>Relevant tickets</em>:</p><ul><li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=463485">Bug 463485 – Snap to all shapes</a></li></ul><h2 id="Introduction">Introduction</h2><p>There is currently the capability to snap to shape during moving or resizing a node. This capability is inherited from GMF framework. To enable it, select the diagram and in the <em>Properties</em> view, in <em>Rulers & Grid</em> tab, check the checkbox <em>Snap To Shapes</em>. As explained in <a href="https://wiki.eclipse.org/Graphical_Modeling_Framework/Versions/GMF_2.1#GEF_Alignment_Feature:_Snap_To_Geometry_added_in_the_GMF_Runtime">GMF doc</a>, <cite>However, edit parts can only snap to other edit parts that share the same parent.</cite> <br/>The goal of this feature is to enable on demand the snap to all shapes and not only with the same container. </p><h2 id="DetailedSpecification">Detailed Specification</h2><p>This new behavior will be available only if <em>Snap To Shapes</em> is already enabled. To add this new behavior, the user should press a specific shortcut.<br/>Shift, Ctrl and Alt is already used by other GMF behaviors during resize/move. So we must use function key as shortcut. The chosen function key is <strong>F4</strong> (not used by other functions on diagram as F5 for refresh for example).</p><p>For information the other shortcuts used during resize by GMF or other Sirius features are:</p><ul><li>Control key: Centered resize</li><li>Shift key: Resize that keeps ratio</li><li>Alt key: Resize that disables the snap</li><li>F3: Resize container and keep children relative</li></ul><p>For information the other shortcuts used during move by GMF are:</p><ul><li>Shift key: Constrained move</li><li>Alt key (Control key on Mac): Ignore snap while dragging</li></ul><p>The <em>Snap To Shapes</em>, uses all the shapes that share the same parent, even if they are not visible.<br/>In contrast, when the user press <strong>F4</strong> function key, all <strong>visible</strong> shapes are used.</p><p>As for <em>Snap To Shapes</em>, this feature is available on:</p><ul><li>Node,</li><li>Container,</li><li>List,</li><li>Note,</li><li>Text,</li><li>Bendpoints of edges (but without feedback)</li></ul><p>If a container is resized, or moved, it will not be snapped to their children. </p><p>Some screenshots of this new feature are shown below.<br/><img border="0" src="images/snapToAllShapes.png"/><br/><img border="0" src="images/snapToAllShapes_2.png"/></p><h3 id="Knownlimitations">Known limitations</h3><p>The <em>Snap To Shapes</em> feature is not operational when moving or resizing a border node. It will be the same for this new feature. However, all nodes can be snapped to existing border nodes.</p><h2 id="BackwardCompatibilityandMigrationPaths">Backward Compatibility and Migration Paths</h2><p>This evolution does not change any API.</p><h3 id="UserInterfaceChanges">User Interface Changes</h3><p>No user interface change.</p><h3 id="DocumentationChanges">Documentation Changes</h3><p>This new behavior should be added in the New and Noteworthy documentation. <br/>A note should also be added in the user doc to explain this new feature (and possibly for the existing move shortcuts):</p><ul><li>Complete chapter Diagram Editors/Features Overview/Resizing elements</li><li>Add new chapter Diagram Editors/Features Overview/Moving elements</li></ul><h2 id="TestsandNonregressionstrategy">Tests and Non-regression strategy</h2><p>Add new tests that resize elements and move elements. The data from test <code>org.eclipse.sirius.tests.swtbot.PortsOnNodePositionStabilityTest</code> can be used as it uses both nodes, border nodes and container nodes.<br/>Points to consider during tests:</p><ul><li>Shapes not visible in the diagram (they should be ignored by the snap)</li><li>Shapes not visible in a container (they should be ignored by the snap)</li><li>Different zoom levels</li><li>With or without scroll in diagram/in container</li><li>With Control and F4 keys pressed (Control key should disable the snap)</li></ul><p>Warning: These tests need to update the SWTBot framework or at least add new methods in our part to drag a node with a shortcut key pressed. </p><h2 id="Implementationchoicesandtradeoffs">Implementation choices and tradeoffs</h2><p>Excluded shortcuts:</p><ul><li>The shortcut is not only a character key because this can be in conflict with the direct edit mode (if enabled).</li><li>The combination with ALT key is already used to activate menu.</li><li>The combination with SHIFT key is already used for uppercase key of direct edit mode.</li><li>The combination with CTRL key can conflict with action shortcuts. For example, «CTRL+r» conflicts with the reveal all action.</li></ul><p>Excluded behaviors:</p><ul><li>Change the behavior of the <em>Snap To Shapes</em> (instead of add a shortcut)</li><li>Change the UI of <em>Rulers & Grid</em> to show a new <em>Snap To All Shapes</em> checkbox<ul><li>It will not really a checkbox, because it must be exclusive with existing <em>Snap To Shapes</em> checkbox.</li><li>This also needs to modify global Sirius diagram preferences.</li></ul></li></ul></body></html>
\ No newline at end of file diff --git a/plugins/org.eclipse.sirius.doc/specs/proposal/463485_snapToAllShapes/463485.textile b/plugins/org.eclipse.sirius.doc/specs/proposal/463485_snapToAllShapes/463485.textile new file mode 100644 index 0000000000..76179bdd24 --- /dev/null +++ b/plugins/org.eclipse.sirius.doc/specs/proposal/463485_snapToAllShapes/463485.textile @@ -0,0 +1,93 @@ +h1. Snap to all shapes + +h2. Preamble + +_Summary_: Add capability to snap to all shapes when moving or resizing a node or a container. + +|_. Version |_. Status |_. Date |_. Authors |_. Changes | +| v0.1 | DRAFT | 2015-04-08 | lredor | Initial version. | + +_Relevant tickets_: +* "Bug 463485 - Snap to all shapes":https://bugs.eclipse.org/bugs/show_bug.cgi?id=463485 + +h2. Introduction + +There is currently the capability to snap to shape during moving or resizing a node. This capability is inherited from GMF framework. To enable it, select the diagram and in the _Properties_ view, in _Rulers & Grid_ tab, check the checkbox _Snap To Shapes_. As explained in "GMF doc":https://wiki.eclipse.org/Graphical_Modeling_Framework/Versions/GMF_2.1#GEF_Alignment_Feature:_Snap_To_Geometry_added_in_the_GMF_Runtime, ??However, edit parts can only snap to other edit parts that share the same parent.?? +The goal of this feature is to enable on demand the snap to all shapes and not only with the same container. + +h2. Detailed Specification + +This new behavior will be available only if _Snap To Shapes_ is already enabled. To add this new behavior, the user should press a specific shortcut. +Shift, Ctrl and Alt is already used by other GMF behaviors during resize/move. So we must use function key as shortcut. The chosen function key is *F4* (not used by other functions on diagram as F5 for refresh for example). + +For information the other shortcuts used during resize by GMF or other Sirius features are: +* Control key: Centered resize +* Shift key: Resize that keeps ratio +* Alt key: Resize that disables the snap +* F3: Resize container and keep children relative + +For information the other shortcuts used during move by GMF are: +* Shift key: Constrained move +* Alt key (Control key on Mac): Ignore snap while dragging + +The _Snap To Shapes_, uses all the shapes that share the same parent, even if they are not visible. +In contrast, when the user press *F4* function key, all *visible* shapes are used. + +As for _Snap To Shapes_, this feature is available on: +* Node, +* Container, +* List, +* Note, +* Text, +* Bendpoints of edges (but without feedback) + +If a container is resized, or moved, it will not be snapped to their children. + +Some screenshots of this new feature are shown below. +!images/snapToAllShapes.png! +!images/snapToAllShapes_2.png! + +h3. Known limitations + +The _Snap To Shapes_ feature is not operational when moving or resizing a border node. It will be the same for this new feature. However, all nodes can be snapped to existing border nodes. + +h2. Backward Compatibility and Migration Paths + +This evolution does not change any API. + +h3. User Interface Changes + +No user interface change. + +h3. Documentation Changes + +This new behavior should be added in the New and Noteworthy documentation. +A note should also be added in the user doc to explain this new feature (and possibly for the existing move shortcuts): +* Complete chapter Diagram Editors/Features Overview/Resizing elements +* Add new chapter Diagram Editors/Features Overview/Moving elements + +h2. Tests and Non-regression strategy + +Add new tests that resize elements and move elements. The data from test @org.eclipse.sirius.tests.swtbot.PortsOnNodePositionStabilityTest@ can be used as it uses both nodes, border nodes and container nodes. +Points to consider during tests: +* Shapes not visible in the diagram (they should be ignored by the snap) +* Shapes not visible in a container (they should be ignored by the snap) +* Different zoom levels +* With or without scroll in diagram/in container +* With Control and F4 keys pressed (Control key should disable the snap) + +Warning: These tests need to update the SWTBot framework or at least add new methods in our part to drag a node with a shortcut key pressed. + +h2. Implementation choices and tradeoffs + +Excluded shortcuts: +* The shortcut is not only a character key because this can be in conflict with the direct edit mode (if enabled). +* The combination with ALT key is already used to activate menu. +* The combination with SHIFT key is already used for uppercase key of direct edit mode. +* The combination with CTRL key can conflict with action shortcuts. For example, "CTRL+r" conflicts with the reveal all action. + +Excluded behaviors: +* Change the behavior of the _Snap To Shapes_ (instead of add a shortcut) +* Change the UI of _Rulers & Grid_ to show a new _Snap To All Shapes_ checkbox +** It will not really a checkbox, because it must be exclusive with existing _Snap To Shapes_ checkbox. +** This also needs to modify global Sirius diagram preferences.
\ No newline at end of file diff --git a/plugins/org.eclipse.sirius.doc/specs/proposal/463485_snapToAllShapes/images/snapToAllShapes.png b/plugins/org.eclipse.sirius.doc/specs/proposal/463485_snapToAllShapes/images/snapToAllShapes.png Binary files differnew file mode 100644 index 0000000000..9e4c69dc79 --- /dev/null +++ b/plugins/org.eclipse.sirius.doc/specs/proposal/463485_snapToAllShapes/images/snapToAllShapes.png diff --git a/plugins/org.eclipse.sirius.doc/specs/proposal/463485_snapToAllShapes/images/snapToAllShapes_2.png b/plugins/org.eclipse.sirius.doc/specs/proposal/463485_snapToAllShapes/images/snapToAllShapes_2.png Binary files differnew file mode 100644 index 0000000000..2bb1bbbac7 --- /dev/null +++ b/plugins/org.eclipse.sirius.doc/specs/proposal/463485_snapToAllShapes/images/snapToAllShapes_2.png |
