Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsGMF Asymmetric grid
https://www.eclipse.org/forums/index.php/mv/msg/440496/986912/#msg_986912
I am currently dealing with a model where object position and size are based on an asymmetric scale.
Thats means that an object with a size of (1,1) in model may be displayed as a figure with a size of (5,8). Currently I adapt my model object position and size in my EditParts#refreshBounds() function.
I was wondering if there is a more generic way to doing this.
I also starting to search a way to configure an asymmetric grid and ruler for my diagram. I particular I was questioning myself about the IMapMode which comment said :
Objects implementing this interface are responsible for mapping the units in the model to pixles
but I am not sure this is the good way to achieve this.
I the same time I found DiagramRootEditPart which deal with the diagram layer. But it seems it configure and use a symmetric grid.
Currently I just override createPartControl in my XXXDiagramEditor whith
((DiagramRootEditPart) getDiagramEditPart().getRoot()).getViewer().setProperty(SnapToGrid.PROPERTY_GRID_SPACING, new Dimension(5, 8));
And I am using a custom ruler for displaying correct metrics.
Should I overload DiagramRootEditPart Class and defined my own grid option/rulers or is there an other way to achieve my goal ?
Did someone have any feedback on such implementation ?]]>Thomas Jouve2012-11-22T10:56:04-00:00