diff options
author | Maxime Porhel | 2020-10-21 15:03:31 +0000 |
---|---|---|
committer | Maxime Porhel | 2020-10-23 13:59:35 +0000 |
commit | 6795a234e72d727a8e585e5d09d7229461f797d6 (patch) | |
tree | 172b9cda403ba05b82914ed89194e7355c0b21f0 /plugins/org.eclipse.sirius.diagram.sequence/src/org/eclipse/sirius/diagram/sequence/business/internal/layout | |
parent | b93e1893818cdee07e19a6571218b5870c8d3da3 (diff) | |
download | org.eclipse.sirius-6795a234e72d727a8e585e5d09d7229461f797d6.tar.gz org.eclipse.sirius-6795a234e72d727a8e585e5d09d7229461f797d6.tar.xz org.eclipse.sirius-6795a234e72d727a8e585e5d09d7229461f797d6.zip |
[567517] Optimize Sequence Horizontal Layout
- Compute Message.getParentOperand() only if a lost message end is
found.
- Fast return the default reflexive message width if there is no
surrounded event on the same lifeline.
Bug: 567517
Change-Id: I2fab94b454824ff7fc4832d777d21687e55851ac
Signed-off-by: Maxime Porhel <maxime.porhel@obeo.fr>
Diffstat (limited to 'plugins/org.eclipse.sirius.diagram.sequence/src/org/eclipse/sirius/diagram/sequence/business/internal/layout')
-rw-r--r-- | plugins/org.eclipse.sirius.diagram.sequence/src/org/eclipse/sirius/diagram/sequence/business/internal/layout/horizontal/LostMessageEndHorizontalLayoutHelper.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/org.eclipse.sirius.diagram.sequence/src/org/eclipse/sirius/diagram/sequence/business/internal/layout/horizontal/LostMessageEndHorizontalLayoutHelper.java b/plugins/org.eclipse.sirius.diagram.sequence/src/org/eclipse/sirius/diagram/sequence/business/internal/layout/horizontal/LostMessageEndHorizontalLayoutHelper.java index 8ab3d331c3..69b39335e6 100644 --- a/plugins/org.eclipse.sirius.diagram.sequence/src/org/eclipse/sirius/diagram/sequence/business/internal/layout/horizontal/LostMessageEndHorizontalLayoutHelper.java +++ b/plugins/org.eclipse.sirius.diagram.sequence/src/org/eclipse/sirius/diagram/sequence/business/internal/layout/horizontal/LostMessageEndHorizontalLayoutHelper.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 THALES GLOBAL SERVICES. + * Copyright (c) 2010, 2020 THALES GLOBAL SERVICES. * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at @@ -44,8 +44,8 @@ import com.google.common.collect.Iterables; import com.google.common.collect.Multimap; /** - * Computes the appropriate graphical locations of sequence events and lifelines - * on a sequence diagram to reflect the semantic order. + * Computes the appropriate graphical locations of sequence events and lifelines on a sequence diagram to reflect the + * semantic order. * * @author pcdavid, mporhel */ @@ -71,8 +71,7 @@ public class LostMessageEndHorizontalLayoutHelper { * Constructor. * * @param diagram - * the sequence diagram for which to compute the horizontal - * locations. + * the sequence diagram for which to compute the horizontal locations. */ public LostMessageEndHorizontalLayoutHelper(SequenceDiagram diagram) { this.sequenceDiagram = diagram; @@ -132,7 +131,6 @@ public class LostMessageEndHorizontalLayoutHelper { ISequenceNode sourceElement = msg.getSourceElement(); ISequenceNode targetElement = msg.getTargetElement(); - Option<Operand> parentOperand = msg.getParentOperand(); if (sourceElement != null && targetElement != null) { Option<Lifeline> sourceLifeline = sourceElement.getLifeline(); Option<Lifeline> targetLifeline = targetElement.getLifeline(); @@ -142,6 +140,7 @@ public class LostMessageEndHorizontalLayoutHelper { LostMessageEnd sourceLME = (LostMessageEnd) sourceElement; lostSources.put(targetLifeline.get(), sourceLME); lostMessages.put(sourceLME, msg); + Option<Operand> parentOperand = msg.getParentOperand(); if (parentOperand.some()) { operands.put(sourceLME, parentOperand.get()); operands2lostEnds.put(parentOperand.get(), sourceLME); @@ -152,6 +151,7 @@ public class LostMessageEndHorizontalLayoutHelper { LostMessageEnd targetLME = (LostMessageEnd) targetElement; lostTargets.put(sourceLifeline.get(), targetLME); lostMessages.put(targetLME, msg); + Option<Operand> parentOperand = msg.getParentOperand(); if (parentOperand.some()) { operands.put(targetLME, parentOperand.get()); operands2lostEnds.put(parentOperand.get(), targetLME); |