Skip to main content
Jump to: navigation, search

Diagram Developer Documentation

Revision as of 09:53, 13 December 2013 by (Talk | contribs) (add a small documentation on snap to grid)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Snap To Grid Enhancement

By Default Snap To Grid allows to snap on the grid using the top left corner of the figure (in case of Rctangle).

To improve this behavior, you should subclass the GMF Class or one of its superclass. Then you must ovveride the method org.eclipse.gef.EditPart.getDragTracker(Request) in the edit part concerned by your specific SnapToGrid.

In Papyrus we change this class to be able to snap on the 4 corners, the four middle and the center of a rectangle. Have a look to these class for further informations

    <il> /org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/ </il> <il>/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/snap/</il> <il>/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/snap/</il> <il>/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/</il>

Copyright © Eclipse Foundation, Inc. All Rights Reserved.