Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 211151 Details for
Bug 364795
[Sequence Diagram] - Nested combined fragments creation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Fix of this issue
Bug 364795 - Nested combined fragments creation.patch (text/plain), 3.23 KB, created by
Yves YANG
on 2012-02-16 20:59:45 EST
(
hide
)
Description:
Fix of this issue
Filename:
MIME Type:
Creator:
Yves YANG
Created:
2012-02-16 20:59:45 EST
Size:
3.23 KB
patch
obsolete
>Index: custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionFragmentEditPart.java >=================================================================== >--- custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionFragmentEditPart.java (revision 7174) >+++ custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionFragmentEditPart.java (working copy) >@@ -29,6 +29,7 @@ > import org.eclipse.gmf.runtime.notation.Bounds; > import org.eclipse.gmf.runtime.notation.Shape; > import org.eclipse.gmf.runtime.notation.View; >+import org.eclipse.papyrus.uml.diagram.sequence.figures.LifelineDotLineCustomFigure; > import org.eclipse.papyrus.uml.diagram.sequence.util.CommandHelper; > import org.eclipse.uml2.uml.InteractionFragment; > import org.eclipse.uml2.uml.Lifeline; >@@ -142,20 +143,32 @@ > > List<Lifeline> coveredLifelinesToAdd = new ArrayList<Lifeline>(); > List<Lifeline> coveredLifelinesToRemove = new ArrayList<Lifeline>(); >- for(Object child : getParent().getChildren()) { >- if(child instanceof LifelineEditPart) { >- LifelineEditPart lifelineEditPart = (LifelineEditPart)child; >- Lifeline lifeline = (Lifeline)lifelineEditPart.resolveSemanticElement(); >- if(newBound.intersects(lifelineEditPart.getFigure().getBounds())) { >- if(!coveredLifelines.contains(lifeline)) { >- coveredLifelinesToAdd.add(lifeline); >+ EditPart interactionCompartment = getInteractionCompartment(); >+ if (interactionCompartment != null) { >+ this.getFigure().translateToAbsolute(newBound); >+ for (Object child : interactionCompartment.getChildren()) { >+ if (child instanceof LifelineEditPart) { >+ LifelineEditPart lifelineEditPart = (LifelineEditPart) child; >+ Lifeline lifeline = (Lifeline) lifelineEditPart >+ .resolveSemanticElement(); >+ LifelineDotLineCustomFigure dotLineFigure = lifelineEditPart >+ .getPrimaryShape().getFigureLifelineDotLineFigure(); >+ Rectangle dotLineBounds = dotLineFigure.getBounds() >+ .getCopy(); >+ Rectangle centralLineBounds = new Rectangle( >+ dotLineBounds.x() + dotLineBounds.width() / 2, >+ dotLineBounds.y(), 1, dotLineBounds.height()); >+ dotLineFigure.translateToAbsolute(centralLineBounds); >+ if (newBound.intersects(centralLineBounds)) { >+ if (!coveredLifelines.contains(lifeline)) { >+ coveredLifelinesToAdd.add(lifeline); >+ } >+ } else if (coveredLifelines.contains(lifeline)) { >+ coveredLifelinesToRemove.add(lifeline); > } >- } else if(coveredLifelines.contains(lifeline)) { >- coveredLifelinesToRemove.add(lifeline); > } > } > } >- > if(!coveredLifelinesToAdd.isEmpty()) { > CommandHelper.executeCommandWithoutHistory(getEditingDomain(), AddCommand.create(getEditingDomain(), combinedFragment, UMLPackage.eINSTANCE.getInteractionFragment_Covered(), coveredLifelinesToAdd)); > } >@@ -164,5 +177,18 @@ > } > > } >+ >+ /** >+ * Find parent editpart of lifeline >+ * @return EditPart >+ */ >+ public EditPart getInteractionCompartment() { >+ EditPart editPart = getParent(); >+ while (editPart != null >+ && !(editPart instanceof InteractionInteractionCompartmentEditPart)) { >+ editPart = editPart.getParent(); >+ } >+ return editPart; >+ } > > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 364795
: 211151