Skip to main content
Jump to: navigation, search

Difference between revisions of "Diagram Developer Documentation"

(Delete Behaviors (added the 19th of May))
Line 20: Line 20:
=Delete Behaviors (added the 19th of May) =
=Delete Behaviors (added the 19th of May 2016) =
*Define Behavior for DEL and Shift DEL
*Define Behavior for DEL and Shift DEL
{| class="wikitable"
{| class="wikitable"

Revision as of 08:57, 19 May 2016

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 classes to get examples.


To improve the connection of the endPoint of the link, Papyrus provides its own EditPolicy (in ConnectionEditPart) : org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.PapyrusConnectionEndEditPolicy.PapyrusConnectionEndEditPolicy, with the role EditPolicy.CONNECTION_ENDPOINTS_ROLE (see this class for details)

User tricks

ALT allows to ignore Snap To Grid when your are moving an element

Delete Behaviors (added the 19th of May 2016)

  • Define Behavior for DEL and Shift DEL
Delete From Model (DEL) Delete From Diagram (SHIFT+DEL) Example Delete From Model Action (DEL)
View with semantic Delete Hide Class
View with no semantic, but representing a feature Delete: remove the reference from the feature Hide Comment Link, Constraint Links (context and contrainedElement), DurationObservation and TimeObservation Link remove the link and remove the reference from the feature
View with no semantic Hide Hide  ? remove the link
View with semantic Read Only Forbidden Hide PimitivesTypes::Integer
Metaclass All Diagram (Read-Only) Hide Hide Import Metaclass (Profile Diagram) keep the element imported, destroy the view o the metaclass

Copyright © Eclipse Foundation, Inc. All Rights Reserved.