Community
Participate
Working Groups
- Try to move MapMode dependency out from the figure world. - Allow greater reuse of existing GEF based figures and editparts. - Support different coordinate systems? (Potentially could be pushed to GEF).
The best to provide this is to support different scale factors. To allow clients to fully reuse their figures, the scale factor would be set to 1.0. Issues: - Need to make sure all GMF figures are using MapMode to initialize defaults instead of hard-coding himetric values. - Need to store scale factor in notation meta-model to ensure interoperability. Different clients should be able to read diagrams with different scale factors. - MapMode class could be hidden inside NodeFigure and other base class implementations. i.e. have them implement the IMapMode interface.
- MapMode class would need to be stored somewhere. It could not remain static as this will break with 2 domain editors open supporting different coordinate scale factors.
Created attachment 28702 [details] Design document describing the potential changes Design document describing the potential changes
Created attachment 28885 [details] Design document describing the refactoring Design document describing how to accommodate multiple coordinate systems.
Made some changes to design document based on initial development work. - Moved MapModeTypes to public api. - Removed dependency from DiagramRootEditPart to MapModeUtil - Removed extra methods from MapModeUtil - Created internal class DiagramMapModeUtil to encapsulate scale factor
Deliver initial refactoring of MapMode infrastructure to (No external API impact): - Remove circular dependency between MapMode and HiMetricMapMode class - Make IMapMode class public and make api consistent - Introduce new public class MapModeUtil which is designed to replace old MapMode class which will be deprecated soon. Has similar functionality except it introduces a method context. - Introduce new public class MapModeTypes which will encapsule different IMapMode types available to clients. Next phase: - Sweep for all occurrences of MapMode in diagram layer and redirect to MapModeUtil.getMapMode(IFigure) instead. - Notation meta-model support
Comments on removing MapMode class: If you are not concerned with reusing your figures with-in different Editors that have different coordinate systems then you can simply do a direct replacement of MapMode to MapModeUtil.getMapMode(). Otherwise, to get maximum reuse out of your figures and editparts you would need to do the retrieve the IMapMode from an appropropriate context.Replace occurrences to MapMode with API as follows: 1. Referencing MapMode from within a Figure MapMode.DPtoLP --> MapModeUtil.getMapMode(this).DPtoLP 2. Referencing MapMode from within an EditPart MapMode.DPtoLP --> getMapMode() (api defined on GraphicalEditPart) 3. Other contexts If you have access to the DiagramRootEditPart, then it has the main access point to retrieve the IMapMode --> getMapMode()
Delivered: - Enabled IdentityMapMode in an example (GeoShapes example) - Fixed some issues with Note, Text and Bendpoint which had hard coded himetric values. - Moved CreateRootEditPartOperation into the public API to allow clients to install their own IMapMode for their Editor (see GeoShapes example) Activities: bugzilla 112788 gmf-head sshaw 051108 API: Encapsulate MapMode / HiMetric coordinate system from clients Note: I may close this enhancement with this delivery. The remaining (potential) work is around interoperability (copy / paste) between different domains that utilize different map modes. Clients should be able to utilize the IdentityMapMode with the current delivery to ease their GEF migration. I may consider the interoperability in a different enhancement request.
Resolving enhancement for M3. Follow-up enhancement for notation meta-model changes captured in https://bugs.eclipse.org/bugs/show_bug.cgi?id=116224.
[target cleanup] 1.0 M3 was the original target milestone for this bug
[GMF Restructure] Bug 319140 : product GMF and component Runtime Diagram was the original product and component for this bug