Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 484402

Summary: BorderItemLocator never used for bordered nodes contained by other bordered nodes
Product: [Modeling] Sirius Reporter: Vincent Sennedot <vincent.sennedot>
Component: DiagramAssignee: Project Inbox <sirius.diagram-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: major    
Priority: P3 CC: laurent.redor, maxime.porhel
Version: 3.0.0Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Windows 8   
Whiteboard:

Description Vincent Sennedot CLA 2015-12-15 09:29:14 EST
I have a container with bordered nodes which have themselves bordered nodes.
I use a custom StyleConfiguration to give a default location to the bordered nodes.

The getBorderItemLocator() method is rightly called for the bordered nodes contained by the container. But the method is never called for the bordered nodes contained by other bordered nodes.
Comment 1 Maxime Porhel CLA 2015-12-22 09:48:33 EST
It seems that the saveConstraint fields of DNodeEditPart/DNode2EditPart/DNode3EditPart/DNode4EditPart are used in different ways.

FYI: 
 . DNodeEditPart: node on the diagram
 . DNode2EditPart: border node of another node (recursive)
 . DNode3EditPart: node in containers
 . DNode4EditPart: border node of a container/list (recursive)

DNodeEditPart, DNode2EditPart, DNode3EditPart seem consistent but might be impacted by your issue.
DNode4EditPart is different (no override of reorderChild) and might present additional issues.

Could you give us more information about your VSM (label positions in your node style description, mapping depth, ...)  and your style configuration extension ? Or provide a reproduction case to mimic your issue on a simpler/sample metamodel ?
Comment 2 Vincent Sennedot CLA 2016-01-05 04:18:01 EST
I've updated Sirius to the 3.1.1 version and the getBorderItemLocator() method is now rightly called for the bordered nodes contained by other bordered nodes.

But now these bordered nodes have an offset (they are "inside" their parents), even if I set the border item offset to IBorderItemOffsets.NO_OFFSET.
Is there a way to remove this offset ?
Comment 3 Laurent Redor CLA 2016-01-26 08:56:09 EST
The IBorderItemOffsets.NO_OFFSET is currently used for "NameEditPart" (specific kind of BorderNode) and works.

Could you give us a reproduction case?

In the same way, org.eclipse.sirius.diagram.ui.tools.internal.figure.ICollapseMode.COLLAPSE_DEFAULT_OFFSET is also used when a border node is collapsed (with method BorderItemLocator.setBorderItemOffset(Dimension)).

Maybe you remove this offset too late.
Comment 4 Laurent Redor CLA 2016-06-03 07:53:47 EDT
This issue is closed as invalid as we have not enough information. Feel free to reopen it with use case or more details.