From ed2a5b1926d74ca92c4530f5acbbfbe1e6583b22 Mon Sep 17 00:00:00 2001 From: Mickael ADAM Date: Tue, 7 Jun 2016 12:26:22 +0200 Subject: JUnit regression on 'org.eclipse.papyrus.uml.diagram.sequence.tests.bug' -"org.eclipse.papyrus.uml.diagram.sequence.tests.bug.m7.TestTooltip_402964.testSynchronousMessage" -"org.eclipse.papyrus.uml.diagram.sequence.tests.bug.pro20130916.MessageStereotypesTest.testSynchronousMessage" => Reuse the delegating layout with instance of verification before cast. The model which doesn't want to open from Bug 494019 have been tested and work with this patch. Change-Id: Ia0a982d0fbccda55bdf74b2d634b127e197a0e19 Signed-off-by: Fanch BONNABESSE Signed-off-by: Mickael ADAM --- .../AbstractExecutionSpecificationEditPart.java | 25 ++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'plugins/uml') diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/AbstractExecutionSpecificationEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/AbstractExecutionSpecificationEditPart.java index 412eb00cc40..43cec81d8f5 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/AbstractExecutionSpecificationEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/AbstractExecutionSpecificationEditPart.java @@ -5,11 +5,11 @@ import java.util.HashMap; import java.util.List; import org.eclipse.draw2d.ConnectionAnchor; +import org.eclipse.draw2d.DelegatingLayout; import org.eclipse.draw2d.IFigure; import org.eclipse.draw2d.Locator; import org.eclipse.draw2d.PositionConstants; import org.eclipse.draw2d.RelativeLocator; -import org.eclipse.draw2d.StackLayout; import org.eclipse.draw2d.TreeSearch; import org.eclipse.draw2d.geometry.Dimension; import org.eclipse.draw2d.geometry.Point; @@ -634,9 +634,26 @@ public abstract class AbstractExecutionSpecificationEditPart extends RoundedComp @Override protected NodeFigure createMainFigureWithSVG() { NodeFigure figure = createSVGNodePlate(); - // bug 494019: [Sequence Diagram] Opening Luna Sequence Diagram into Neon doesn't work : change the layout from DelegatingLayout to StackLayout - //figure.setLayoutManager(new DelegatingLayout()); - figure.setLayoutManager(new StackLayout()); + // bug 494019: [Sequence Diagram] Opening Luna Sequence Diagram into Neon doesn't work : change the layout from DelegatingLayout to StackLayout + figure.setLayoutManager(new DelegatingLayout() { + /** + * Override it to verify type of constraint. + * + * @see org.eclipse.draw2d.DelegatingLayout#layout(org.eclipse.draw2d.IFigure) + */ + @Override + public void layout(IFigure parent) { + List children = parent.getChildren(); + for (int i = 0; i < children.size(); i++) { + IFigure child = (IFigure) children.get(i); + + Object locator = getConstraint(child); + if (locator instanceof Locator) { + ((Locator) locator).relocate(child); + } + } + } + }); shape = createNodeShape(); figure.add(shape, new FillParentLocator()); setupContentPane(shape); -- cgit v1.2.1