Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 361300

Summary: Grid visibility, snap, etc settings lack organization
Product: [Modeling] Graphiti Reporter: Hernan Gonzalez <hjg.com.ar>
Component: CoreAssignee: Project Inbox <graphiti-inbox>
Status: ASSIGNED --- QA Contact:
Severity: enhancement    
Priority: P4 CC: michael.wenz
Version: 0.8.0   
Target Milestone: ---   
Hardware: All   
OS: All   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=352220
Whiteboard:

Description Hernan Gonzalez CLA 2011-10-18 15:39:58 EDT
Build Identifier: 

Currently (Graphiti 0.9.0) DiagramEditorInternal.updateViewerGridProperties() sets:

PROPERTY_GRID_ENABLED => from diagram  (snapToGrid)
PROPERTY_GRID_SPACING => from diagram (verticalGridUnit/horizontalGridUnit)
PROPERTY_GRID_VISIBLE => implicit (horizontalGridUnit > 0, verticalGridUnit > 0)
PROPERTY_SNAP_ENABLED => from the toolbehaviourprovider.isShowGuides()
(however, my diagram.ecore has a showGuides attribute ... which seems not in synch with Diagram class)

AFAIJK there is little to do if the user wants to change these settings in runtime, as most editors allow. In particular, Graphiti should:

- allow a more flexible way of set PROPERTY_GRID_VISIBLE (perhaps from the toolbehaviourprovider)

- add some hook or support in the editor so that these changes are passed to GEF viewer on change.

- discuss/clarify which settings should be saved in the diagram (what about that diagram.showGuides in graphiti.ecore?) , which are set by the editor, which can be changed in runtime, as preferences.

It seems reasonable to me that the grid spacing is saved in the diagram. More arguable is  snapToGrid (sounds more like an editor setting to me; it would be strange that when the user toggles "show grid/hide grid" the diagram is marked as dirty - actually, it's also strange for the grid unit...  but less so).


 

Reproducible: Always
Comment 1 Michael Wenz CLA 2011-10-19 07:48:45 EDT
The part about the showGuides attribute has already been adressed in Graphiti 0.9.0 for Juno M2. The relevant setting is the one in the tool behaviour provider, the attribute in the diagram is kept only for compatibility, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=352220