Bug 424942 - [Diagram] Papyrus shall ease resizing of model elements owning children
Summary: [Diagram] Papyrus shall ease resizing of model elements owning children
Status: NEW
Alias: None
Product: Papyrus
Classification: Modeling
Component: Diagram (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: 1.0.0   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard: toPlan
Keywords: plan, usability
Depends on: 424943
Blocks:
  Show dependency tree
 
Reported: 2014-01-06 10:52 EST by Vincent Lorenzo CLA
Modified: 2017-09-08 09:49 EDT (History)
4 users (show)

See Also:
vincent.lorenzo: luna-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vincent Lorenzo CLA 2014-01-06 10:52:20 EST
When you are resizing a NodeEditPart from the top left corner, its children move too. This behavior is logical because this corner is used as reference for there coordinates, but it is not userfriendly. Often the user has already arranged related elements in the diagrams and resizing their parents move them.

Papyrus should provide a way to the user to allow it to move/not move the children of the resized element.
(Shift key could be a good idea to switch between move and not move).
Comment 1 Vincent Lorenzo CLA 2014-01-09 10:00:47 EST
Done for IBD, BDD and Class Diagram, in : 
	- commit f2ba65f3a63d9843ca19043df0371e1fcd546ba0 branch maintenance-0.10
	- commit eee86fab3ee48287d409e467324a91de9135e492 on master
	
Impacted classes : 
plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/NodeEditPart.java
plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/PapyrusDiagramEditPart.java
plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/XYLayoutShapeCompartmentEditPart.java
plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/PapyrusResizableShapeEditPolicy.java
plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/XYLayoutWithConstrainedResizedEditPolicy.java
plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/DefaultXYLayoutEditPolicy.java
plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/policy/EncapsulatedClassifierResizableShapeEditPolicy.java
plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/AbstractPackageableElementCompartmentEditPart.java
plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/UpdatePortLocationCommand.java
plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/edit/policies/EncapsulatedClassifierResizableShapeEditPolicy.java


For compartments with XYLayout EditPolicy : 
	Compartments must inherits from the new class : XYLayoutShapeCompartmentEditPart (in infra.gmfdiag.common)
	
For DiagramEditPart (done in PapyrusDiagramEditPart)	
	we must install the edit policy : installEditPolicy(EditPolicy.LAYOUT_ROLE, new XYLayoutWithConstrainedResizedEditPolicy());
	

To manage the Affixed Port, its parent must have  : 
	installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new EncapsulatedClassifierResizableShapeEditPolicy());
		-> NOT DONE in the Composite

+ a temporary class has been created : PapyrusResizableShapeEditPolicy waiting the fix of the GMF bug 424943 
+  the class EncapsulatedClassifierResizableShapeEditPolicy from org.eclipse.papyrus.sysml.diagram.common has been refactored (inherits from ther same class in composite diagram)
+ modify UpdatePortLocationCommand to be compliant with the requirement of this bug (Port mustn't move)
+ some others minor changes


This behavior must be added on all others diagram with regeneration.
Comment 2 Vincent Lorenzo CLA 2014-01-09 10:01:51 EST
The previous commit work only for nested elements + port. The anchor of the links are not managed
Comment 3 Alain Le Guennec CLA 2014-01-31 09:55:34 EST
Anchor management is quite important (for part to part connectors in IBD, or associations on BDD).
Comment 4 Vincent Lorenzo CLA 2014-02-04 09:59:32 EST
Anchor management is done for ClassDiagram, IBD and BDD in commits : 
e6af2dc16006a735716020236f962518dfa265c6 on branch 0.10-maintenance
9094494c25b0f6d44396d747f3bf99084f073e65 on master
Comment 5 Toni Siljamäki CLA 2014-02-04 12:18:29 EST
Does it mean that this one is fixed and can be closed?
Comment 6 Vincent Lorenzo CLA 2014-02-28 11:02:32 EST
Add an hidden preference to invert default resize and constrained resized bindings
commits
   7226e489c3df60469c0794f7282b33265ac9182b (0.10-maintenance)
   9b11d4e998698a1f5d458fbd3edcc5eeb3af78fe (master)

To activate the preference : 
org.eclipse.papyrus.infra.gmfdiag.common.Activator.getInstance().getPreferenceStore().setValue(PreferencesConstantsHelper.getPapyrusEditorConstant(PreferencesConstantsHelper.INVERT_BINDING_FOR_DEFAULT_RESIZE_AND_CONSTRAINED_RESIZE),true);
Comment 7 Vincent Lorenzo CLA 2014-03-17 10:23:57 EDT
Commits
50afef61286ac7f97ca665187bcb31c43d3882a3 (0.10-maintenace)
7f8fcdb7c87a95a9328d1b6079687bd1cdf04232 (master)

Fix a bug when the resize is done by SOUTH_WEST or NORTH-EAST.. Previously, children moved even if SHIFT was pressed