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 224162 Details for
Bug 377501
[Sequence Diagram] Connections upon Messages 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]
bug fixes
Bugfix_papyrus_245_20121130.patch (text/plain), 46.52 KB, created by
Yves YANG
on 2012-11-30 11:03:13 EST
(
hide
)
Description:
bug fixes
Filename:
MIME Type:
Creator:
Yves YANG
Created:
2012-11-30 11:03:13 EST
Size:
46.52 KB
patch
obsolete
>Index: custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/HighlightConnectionPartEditPolicy.java >=================================================================== >--- custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/HighlightConnectionPartEditPolicy.java (revision 9538) >+++ custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/HighlightConnectionPartEditPolicy.java (working copy) >@@ -3,35 +3,44 @@ > import org.eclipse.gef.Request; > import org.eclipse.gef.editpolicies.AbstractEditPolicy; > import org.eclipse.gef.requests.CreateConnectionRequest; >+import org.eclipse.gef.requests.ReconnectRequest; > import org.eclipse.papyrus.uml.diagram.sequence.util.HighlightUtil; > > public class HighlightConnectionPartEditPolicy extends AbstractEditPolicy { > >+ private HighlightUtil sourceHighlighter = new HighlightUtil(); >+ >+ private HighlightUtil targetHighlighter = new HighlightUtil(); >+ > @Override > public void showSourceFeedback(Request request) { >- if(request instanceof CreateConnectionRequest){ >- HighlightUtil.showConnectionFeedback(getHost(), HighlightUtil.SOURCE_COLOR); >+ if(request instanceof CreateConnectionRequest) { >+ sourceHighlighter.highlight(getHost()); > } > } >- >+ > @Override > public void showTargetFeedback(Request request) { >- if(request instanceof CreateConnectionRequest && ((CreateConnectionRequest)request).getSourceEditPart() != null){ >- HighlightUtil.showConnectionFeedback(getHost(), HighlightUtil.TARGET_COLOR); >+ if(request instanceof CreateConnectionRequest && ((CreateConnectionRequest)request).getSourceEditPart() != null) { >+ targetHighlighter.highlight(getHost()); >+ } else if(request instanceof ReconnectRequest && ((ReconnectRequest)request).getTarget() != null) { >+ targetHighlighter.highlight(((ReconnectRequest)request).getTarget()); > } > } >- >+ > @Override > public void eraseSourceFeedback(Request request) { >- if(request instanceof CreateConnectionRequest){ >- HighlightUtil.eraseConnectionFeedback(getHost()); >+ if(request instanceof CreateConnectionRequest) { >+ sourceHighlighter.unhighlight(getHost()); > } > } >- >+ > @Override > public void eraseTargetFeedback(Request request) { >- if(request instanceof CreateConnectionRequest && ((CreateConnectionRequest)request).getSourceEditPart() != null){ >- HighlightUtil.eraseConnectionFeedback(getHost()); >+ if(request instanceof CreateConnectionRequest && ((CreateConnectionRequest)request).getSourceEditPart() != null) { >+ targetHighlighter.unhighlight(getHost()); >+ } else if(request instanceof ReconnectRequest && ((ReconnectRequest)request).getTarget() != null) { >+ targetHighlighter.unhighlight(((ReconnectRequest)request).getTarget()); > } > } > } >Index: custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineXYLayoutEditPolicy.java >=================================================================== >--- custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineXYLayoutEditPolicy.java (revision 9538) >+++ custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineXYLayoutEditPolicy.java (working copy) >@@ -39,6 +39,7 @@ > import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart; > import org.eclipse.gmf.runtime.diagram.ui.editpolicies.XYLayoutEditPolicy; > import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages; >+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifiedTypeRequest; > import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest; > import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest; > import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor; >@@ -59,6 +60,7 @@ > import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeObservationEditPart; > import org.eclipse.papyrus.uml.diagram.sequence.part.UMLVisualIDRegistry; > import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes; >+import org.eclipse.papyrus.uml.diagram.sequence.util.HighlightUtil; > import org.eclipse.papyrus.uml.diagram.sequence.util.OccurrenceSpecificationMoveHelper; > import org.eclipse.papyrus.uml.diagram.sequence.util.SequenceRequestConstant; > import org.eclipse.papyrus.uml.diagram.sequence.util.SequenceUtil; >@@ -83,6 +85,22 @@ > /** The default spacing used between Execution Specification */ > private final static int SPACING_HEIGHT = 5; > >+ // force location of time/duration elements and ES >+ private static final String TIME_CONSTRAINT_HINT = ((IHintedType)UMLElementTypes.TimeConstraint_3019).getSemanticHint(); >+ >+ private static final String TIME_OBSERVATION_HINT = ((IHintedType)UMLElementTypes.TimeObservation_3020).getSemanticHint(); >+ >+ private static final String DURATION_CONSTRAINT_ON_LIFELINE_HINT = ((IHintedType)UMLElementTypes.DurationConstraint_3021).getSemanticHint(); >+ >+ private static final String ACTION_EXECUTION_SPECIFICATION_HINT = ((IHintedType)UMLElementTypes.ActionExecutionSpecification_3006).getSemanticHint(); >+ >+ private static final String BEHAVIOR_EXECUTION_SPECIFICATION_HINT = ((IHintedType)UMLElementTypes.BehaviorExecutionSpecification_3003).getSemanticHint(); >+ >+ private static final String CO_REGION_HINT = ((IHintedType)UMLElementTypes.CombinedFragment_3018).getSemanticHint(); >+ >+ private HighlightUtil highlightUtil = new HighlightUtil(); >+ >+ > /** > * {@inheritDoc} > */ >@@ -94,33 +112,25 @@ > ViewDescriptor viewDescriptor = cvr.getViewDescriptors().iterator().next(); > String semanticHint = viewDescriptor.getSemanticHint(); > >- // force location of time/duration elements and ES >- String timeConstraintHint = ((IHintedType)UMLElementTypes.TimeConstraint_3019).getSemanticHint(); >- String timeObservationHint = ((IHintedType)UMLElementTypes.TimeObservation_3020).getSemanticHint(); >- String durationConstraintOnLifelineHint = ((IHintedType)UMLElementTypes.DurationConstraint_3021).getSemanticHint(); >- String actionExecutionSpecificationHint = ((IHintedType)UMLElementTypes.ActionExecutionSpecification_3006).getSemanticHint(); >- String behaviorExecutionSpecificationHint = ((IHintedType)UMLElementTypes.BehaviorExecutionSpecification_3003).getSemanticHint(); >- String coRegionHint = ((IHintedType)UMLElementTypes.CombinedFragment_3018).getSemanticHint(); >- >- if(timeConstraintHint.equals(semanticHint) || timeObservationHint.equals(semanticHint)) { >+ if(TIME_CONSTRAINT_HINT.equals(semanticHint) || TIME_OBSERVATION_HINT.equals(semanticHint)) { > Command cmd = getCommandForTimeObservationOrConstraint(cvr, viewDescriptor); > if(cmd != null) { > return cmd; > } > } >- if(durationConstraintOnLifelineHint.equals(semanticHint)) { >+ if(DURATION_CONSTRAINT_ON_LIFELINE_HINT.equals(semanticHint)) { > Command cmd = getCommandForDurationConstraint(cvr, viewDescriptor); > if(cmd != null) { > return cmd; > } > } >- if(actionExecutionSpecificationHint.equals(semanticHint) || behaviorExecutionSpecificationHint.equals(semanticHint)) { >- Command cmd = getCommandForExecutionSpecificationCreation(cvr, viewDescriptor); >+ if(ACTION_EXECUTION_SPECIFICATION_HINT.equals(semanticHint) || BEHAVIOR_EXECUTION_SPECIFICATION_HINT.equals(semanticHint)) { >+ Command cmd = getCommandForExecutionSpecificationCreation(cvr, viewDescriptor); > if(cmd != null) { > return cmd; > } > } >- if(coRegionHint.equals(semanticHint)) { >+ if(CO_REGION_HINT.equals(semanticHint)) { > Command cmd = getCommandForCoRegionCreation(cvr, viewDescriptor); > if(cmd != null) { > return cmd; >@@ -133,6 +143,35 @@ > } > > @Override >+ protected void showLayoutTargetFeedback(Request request) { >+ if(request instanceof CreateUnspecifiedTypeRequest) { >+ CreateUnspecifiedTypeRequest cvr = (CreateUnspecifiedTypeRequest)request; >+ if(!cvr.getElementTypes().isEmpty()) { >+ IHintedType elementType = (IHintedType)cvr.getElementTypes().iterator().next(); >+ String semanticHint = elementType.getSemanticHint(); >+ EditPart editPartForHighlight = getHost(); >+ if(ACTION_EXECUTION_SPECIFICATION_HINT.equals(semanticHint) || BEHAVIOR_EXECUTION_SPECIFICATION_HINT.equals(semanticHint)) { >+ ShapeNodeEditPart parentExecuteSpecification = getParentWhenCreationExecuteSpecification(cvr.getLocation(), cvr.getSize(), semanticHint); >+ if(parentExecuteSpecification != null) { >+ editPartForHighlight = parentExecuteSpecification; >+ } >+ } >+ if(editPartForHighlight != null) { >+ highlightUtil.unhighlight(); >+ highlightUtil.highlight(editPartForHighlight); >+ } >+ } >+ } >+ super.showLayoutTargetFeedback(request); >+ } >+ >+ @Override >+ protected void eraseLayoutTargetFeedback(Request request) { >+ super.eraseLayoutTargetFeedback(request); >+ highlightUtil.unhighlight(); >+ } >+ >+ @Override > protected EditPolicy createChildEditPolicy(EditPart child) { > View childView = (View)child.getModel(); > switch(UMLVisualIDRegistry.getVisualID(childView)) { >@@ -161,8 +200,8 @@ > } > > String destructionHint = ((IHintedType)UMLElementTypes.DestructionOccurrenceSpecification_3022).getSemanticHint(); >- if (destructionHint.equals(req.getViewAndElementDescriptor().getSemanticHint()) && constraint.width < 0 && constraint.height < 0) { >- constraint.width = constraint.height = 20 ;// set initial size, same as DestructionOccurrenceSpecificationPreferencePage >+ if(destructionHint.equals(req.getViewAndElementDescriptor().getSemanticHint()) && constraint.width < 0 && constraint.height < 0) { >+ constraint.width = constraint.height = 20;// set initial size, same as DestructionOccurrenceSpecificationPreferencePage > } > } > return constraint; >@@ -208,8 +247,8 @@ > return new ICommandProxy(new SetBoundsCommand(editingDomain, DiagramUIMessages.SetLocationCommand_Label_Resize, viewDescriptor, newBounds)); > } > >- private Command getCommandForExecutionSpecificationCreation(CreateViewRequest cvr, ViewDescriptor viewDescriptor) { >- Point newLocation = cvr.getLocation().getCopy(); >+ private Rectangle getCreateExecuteSpecificationBounds(Point location, Dimension size, String semanticHint) { >+ Point newLocation = location == null ? new Point() : location.getCopy(); > > if(newLocation.x < 0 || newLocation.y < 0) { > newLocation.x = newLocation.y = 0; >@@ -242,11 +281,35 @@ > } > > // Get the height of the Execution specification >- int newHeight = getFigureHeight(cvr); >+ int newHeight = getFigureHeight(semanticHint, size); >+ >+ // Define the bounds of the new Execution specification >+ return new Rectangle(newLocation.x, newLocation.y, -1, newHeight); >+ } >+ >+ private ShapeNodeEditPart getParentWhenCreationExecuteSpecification(Point location, Dimension size, String semanticHint) { >+ >+ // Define the bounds of the new Execution specification >+ Rectangle newBounds = getCreateExecuteSpecificationBounds(location, size, semanticHint); >+ // Get the dotline figure >+ List<ShapeNodeEditPart> executionSpecificationList = ((LifelineEditPart)getHost()).getChildShapeNodeEditPart(); > >+ return getParent((LifelineEditPart)getHost(), newBounds, executionSpecificationList); >+ } >+ >+ private Command getCommandForExecutionSpecificationCreation(CreateViewRequest cvr, ViewDescriptor viewDescriptor) { >+ >+ LifelineEditPart editPart = (LifelineEditPart)getHost(); >+ >+ List<ShapeNodeEditPart> executionSpecificationList = editPart.getChildShapeNodeEditPart(); >+ >+ Point location = cvr.getLocation(); >+ Dimension size = cvr.getSize(); >+ String semanticHint = viewDescriptor.getSemanticHint(); >+ > // Define the bounds of the new Execution specification >- Rectangle newBounds = new Rectangle(newLocation.x, newLocation.y, -1, newHeight); >- ShapeNodeEditPart parent = getParent((LifelineEditPart)getHost(), newBounds, executionSpecificationList); >+ Rectangle newBounds = getCreateExecuteSpecificationBounds(location, size, semanticHint); >+ ShapeNodeEditPart parent = getParentWhenCreationExecuteSpecification(location, size, semanticHint); > newBounds = getExecutionSpecificationNewBounds(true, editPart, new Rectangle(), newBounds, new ArrayList<ShapeNodeEditPart>(0), false); > if(newBounds == null) { > return UnexecutableCommand.INSTANCE; >@@ -293,7 +356,7 @@ > parentFigure.translateToRelative(referencePoint); > referencePoint.translate(parentFigure.getBounds().getLocation().getCopy().negate()); > // Get the height of the element >- int newHeight = getFigureHeight(cvr); >+ int newHeight = getFigureHeight(viewDescriptor.getSemanticHint(), cvr.getSize()); > // Define the bounds of the new time element > Rectangle newBounds = new Rectangle(referencePoint.x, referencePoint.y - newHeight / 2, -1, newHeight); > TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain(); >@@ -346,20 +409,14 @@ > * the create request > * @return the height defined in the create request or a default value depending on the created figure > */ >- private int getFigureHeight(CreateRequest cr) { >- final String timeObsHint = ((IHintedType)UMLElementTypes.TimeObservation_3020).getSemanticHint(); >- final String timeCstHint = ((IHintedType)UMLElementTypes.TimeConstraint_3019).getSemanticHint(); >- String semHint = null; >- if(cr instanceof CreateViewAndElementRequest) { >- semHint = ((CreateViewAndElementRequest)cr).getViewAndElementDescriptor().getSemanticHint(); >- } >+ private int getFigureHeight(String semanticHint, Dimension size) { > int newHeight; >- if(timeObsHint.equals(semHint) || timeCstHint.equals(semHint)) { >+ if(TIME_OBSERVATION_HINT.equals(semanticHint) || TIME_CONSTRAINT_HINT.equals(semanticHint)) { > // height for a time bar (takes precedence on request's size) > newHeight = TIME_BAR_HEIGHT; >- } else if(cr.getSize() != null) { >+ } else if(size != null) { > // heigh from request >- newHeight = cr.getSize().height; >+ newHeight = size.height; > } else { > newHeight = EXECUTION_INIT_HEIGHT; > } >Index: custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/AbstractExecutionSpecificationEditPart.java >=================================================================== >--- custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/AbstractExecutionSpecificationEditPart.java (revision 9538) >+++ custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/AbstractExecutionSpecificationEditPart.java (working copy) >@@ -16,10 +16,16 @@ > import org.eclipse.draw2d.geometry.Rectangle; > import org.eclipse.emf.common.notify.Notification; > import org.eclipse.emf.ecore.EObject; >+import org.eclipse.gef.EditPart; > import org.eclipse.gef.EditPolicy; >+import org.eclipse.gef.Request; >+import org.eclipse.gef.commands.Command; >+import org.eclipse.gef.commands.UnexecutableCommand; >+import org.eclipse.gef.handles.HandleBounds; > import org.eclipse.gef.requests.ChangeBoundsRequest; > import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart; > import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableShapeEditPolicy; >+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifiedTypeRequest; > import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode; > import org.eclipse.gmf.runtime.draw2d.ui.mapmode.MapModeUtil; > import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure; >@@ -108,6 +114,29 @@ > super.createDefaultEditPolicies(); > installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ResizableShapeEditPolicy(){ > @Override >+ protected Command getResizeCommand(ChangeBoundsRequest request) { >+ // Bugfix: Avoid resize ES with the child size is little than parent one. >+ EditPart host = getHost(); >+ List<ShapeNodeEditPart> movedChildrenParts = LifelineXYLayoutEditPolicy.getAffixedExecutionSpecificationEditParts((ShapeNodeEditPart)host); >+ Rectangle r = getInitialFeedbackBounds().getCopy(); >+ getHostFigure().translateToAbsolute(r); >+ r.translate(0, request.getMoveDelta().y); >+ r.resize(0, request.getSizeDelta().height); >+ for(ShapeNodeEditPart child : movedChildrenParts) { >+ IFigure figure = child.getFigure(); >+ Rectangle rect = figure.getBounds().getCopy(); >+ if (figure instanceof HandleBounds) { >+ rect = ((HandleBounds)figure).getBounds().getCopy(); >+ } >+ figure.translateToAbsolute(rect); >+ if(rect.y < r.y || rect.bottom() > r.bottom()) { >+ return UnexecutableCommand.INSTANCE; >+ } >+ } >+ return super.getResizeCommand(request); >+ } >+ >+ @Override > protected void showChangeBoundsFeedback(ChangeBoundsRequest request) { > request.getMoveDelta().x = 0; // reset offset > >@@ -297,4 +326,53 @@ > } > } > } >+ >+ /** >+ * Override for add elements on ExecutionSpecification >+ */ >+ @Override >+ public Command getCommand(Request request) { >+ if(request instanceof CreateUnspecifiedTypeRequest) { >+ return getParent().getCommand(request); >+ } >+ return super.getCommand(request); >+ } >+ >+ /** >+ * @generated NOT Override for redirecting creation request to the lifeline >+ */ >+ @Override >+ public void showSourceFeedback(Request request) { >+ if(request instanceof CreateUnspecifiedTypeRequest) { >+ getParent().showSourceFeedback(request); >+ } >+ super.showSourceFeedback(request); >+ } >+ >+ /** >+ * @generated NOT Override for redirecting creation request to the lifeline >+ */ >+ @Override >+ public void eraseSourceFeedback(Request request) { >+ if(request instanceof CreateUnspecifiedTypeRequest) { >+ getParent().eraseSourceFeedback(request); >+ } >+ super.eraseSourceFeedback(request); >+ } >+ >+ @Override >+ public void showTargetFeedback(Request request) { >+ if(request instanceof CreateUnspecifiedTypeRequest) { >+ getParent().showTargetFeedback(request); >+ } >+ super.showTargetFeedback(request); >+ } >+ >+ @Override >+ public void eraseTargetFeedback(Request request) { >+ if(request instanceof CreateUnspecifiedTypeRequest) { >+ getParent().eraseSourceFeedback(request); >+ } >+ super.eraseTargetFeedback(request); >+ } > } >Index: custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SequenceDeleteHelper.java >=================================================================== >--- custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SequenceDeleteHelper.java (revision 9538) >+++ custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SequenceDeleteHelper.java (working copy) >@@ -305,7 +305,8 @@ > public static void addDeleteMessageRelatedTimeObservationLinkCommand( > TransactionalEditingDomain editingDomain, EditPart editPart, > CompositeCommand command, MessageEnd messageEnd,boolean deleteRelatedEvent) { >- if(messageEnd != null){ >+ //Bug fix: messageEnd maybe a Gate instance. >+ if(messageEnd != null && messageEnd instanceof OccurrenceSpecification){ > OccurrenceSpecification occurrenceSpecification = (OccurrenceSpecification) messageEnd; > EList<Lifeline> receiveCovereds = occurrenceSpecification.getCovereds(); > CompoundCommand CompoundCommand = new CompoundCommand(); >Index: custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/ReconnectMessageHelper.java >=================================================================== >--- custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/ReconnectMessageHelper.java (revision 9538) >+++ custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/ReconnectMessageHelper.java (working copy) >@@ -24,6 +24,7 @@ > import org.eclipse.uml2.uml.Message; > import org.eclipse.uml2.uml.MessageEnd; > import org.eclipse.uml2.uml.MessageOccurrenceSpecification; >+import org.eclipse.uml2.uml.MessageSort; > import org.eclipse.uml2.uml.OccurrenceSpecification; > > /** >@@ -150,4 +151,32 @@ > } > } > } >+ >+ /** >+ * It seems that OCL constraints can not hold everything about reconnecting messages. >+ * >+ * @param message >+ * @param newTarget >+ */ >+ public static boolean canReorientTarget(Message message, Element newTarget) { >+ if(message == null || newTarget == null) { >+ return false; >+ } >+ MessageSort messageSort = message.getMessageSort(); >+ if(MessageSort.SYNCH_CALL_LITERAL == messageSort) { >+ return newTarget instanceof ExecutionSpecification; >+ } >+ return true; >+ } >+ >+ public static boolean canReorientSource(Message message, Element newSource) { >+ if(message == null || newSource == null) { >+ return false; >+ } >+ MessageSort messageSort = message.getMessageSort(); >+ if(MessageSort.SYNCH_CALL_LITERAL == messageSort) { >+ return newSource instanceof ExecutionSpecification; >+ } >+ return true; >+ } > } >Index: custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/HighlightUtil.java >=================================================================== >--- custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/HighlightUtil.java (revision 9538) >+++ custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/HighlightUtil.java (working copy) >@@ -8,189 +8,265 @@ > import java.util.Map.Entry; > import java.util.Set; > >+import org.eclipse.draw2d.Border; > import org.eclipse.draw2d.ColorConstants; > import org.eclipse.draw2d.IFigure; >+import org.eclipse.draw2d.LineBorder; >+import org.eclipse.draw2d.Polyline; > import org.eclipse.draw2d.RectangleFigure; >+import org.eclipse.draw2d.Shape; > import org.eclipse.draw2d.geometry.Rectangle; > import org.eclipse.gef.EditPart; > import org.eclipse.gef.Request; > import org.eclipse.gef.requests.CreateRequest; >-import org.eclipse.papyrus.uml.diagram.common.figure.node.ConstraintFigure; >-import org.eclipse.papyrus.uml.diagram.common.figure.node.HTMLCornerBentFigure; >+import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IPapyrusEditPart; > import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.AbstractExecutionSpecificationEditPart; >-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.AbstractExecutionSpecificationEditPart.ExecutionSpecificationRectangleFigure; > import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragmentEditPart; > import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentEditPart; > import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintEditPart; > import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionOperandEditPart; > import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.LifelineEditPart; >-import org.eclipse.papyrus.uml.diagram.sequence.figures.CombinedFragmentFigure; > import org.eclipse.swt.graphics.Color; > > > public class HighlightUtil { >+ >+ private static class FigureState { >+ >+ private Color bgColor; >+ >+ private Color fgColor; >+ >+ private int lineWidth; >+ >+ public FigureState(Color bgColor, Color fgColor, int lineWidth) { >+ this.bgColor = bgColor; >+ this.fgColor = fgColor; >+ this.lineWidth = lineWidth; >+ } >+ } >+ > public static final Color COVER_COLOR = ColorConstants.cyan; >+ > public static final Color TARGET_COLOR = ColorConstants.cyan; >+ > public static final Color SOURCE_COLOR = ColorConstants.cyan; >- >- static Map<LifelineEditPart, Rectangle> lifelines ; >+ >+ static Map<LifelineEditPart, Rectangle> lifelines; >+ > static List<LifelineEditPart> highlightLifelines = new ArrayList<LifelineEditPart>(); >- static Map<EditPart,FigureState> figureState = new HashMap<EditPart,FigureState>(); > >+ static Map<EditPart, FigureState> feedbackStates = new HashMap<EditPart, HighlightUtil.FigureState>(); >+ > public static Map<LifelineEditPart, Rectangle> collectAllLifelines(EditPart part) { >- Map<LifelineEditPart,Rectangle> lifelines = new HashMap<LifelineEditPart,Rectangle>(); >+ Map<LifelineEditPart, Rectangle> lifelines = new HashMap<LifelineEditPart, Rectangle>(); > Set<Entry<Object, EditPart>> allEditPartEntries = part.getViewer().getEditPartRegistry().entrySet(); > for(Entry<Object, EditPart> epEntry : allEditPartEntries) { > EditPart ep = epEntry.getValue(); > if(!(ep instanceof LifelineEditPart)) > continue; >- >+ > LifelineEditPart lp = (LifelineEditPart)ep; > IFigure figure = lp.getFigure(); > Rectangle childBounds = figure.getBounds().getCopy(); > figure.translateToAbsolute(childBounds); >- Rectangle centralLineBounds = new Rectangle( >- childBounds.x() + childBounds.width() / 2, >- childBounds.y(), 1, childBounds.height()); >- >- lifelines.put(lp, centralLineBounds); >+ Rectangle centralLineBounds = new Rectangle(childBounds.x() + childBounds.width() / 2, childBounds.y(), 1, childBounds.height()); >+ >+ lifelines.put(lp, centralLineBounds); > } > return lifelines; > } >- >- public static void showSizeOnDropFeedback(CreateRequest request,EditPart host, IFigure feedback, Rectangle bounds){ >- if(lifelines == null){ >+ >+ public static void eraseSizeOnDropFeedback(Request request, EditPart host) { >+ for(LifelineEditPart lp : highlightLifelines) { >+ FigureState s = feedbackStates.get(lp); >+ if(s == null) >+ continue; >+ >+ RectangleFigure rect = lp.getPrimaryShape().getFigureLifelineNameContainerFigure(); >+ rect.setBackgroundColor(s.bgColor); >+ rect.setFill(true); >+ } >+ >+ lifelines = null; >+ highlightLifelines = new ArrayList<LifelineEditPart>(); >+ } >+ >+ public static void showSizeOnDropFeedback(CreateRequest request, EditPart host, IFigure feedback, Rectangle bounds) { >+ if(lifelines == null) { > lifelines = collectAllLifelines(host); > highlightLifelines = new ArrayList<LifelineEditPart>(); > } >- >+ > List<LifelineEditPart> addLifelines = new ArrayList<LifelineEditPart>(); > List<LifelineEditPart> removeLifelines = new ArrayList<LifelineEditPart>(); >- >+ > Iterator<Entry<LifelineEditPart, Rectangle>> it = lifelines.entrySet().iterator(); >- while(it.hasNext()){ >+ while(it.hasNext()) { > Entry<LifelineEditPart, Rectangle> en = it.next(); >- >- if(bounds.intersects(en.getValue())){ >+ >+ if(bounds.intersects(en.getValue())) { > if(!highlightLifelines.contains(en.getKey())) > addLifelines.add(en.getKey()); >- }else{ >+ } else { > if(highlightLifelines.contains(en.getKey())) > removeLifelines.add(en.getKey()); > } > } >- >+ > highlightLifelines.removeAll(removeLifelines); > highlightLifelines.addAll(addLifelines); >- >+ > // highlight lifeline inside >- for(LifelineEditPart lp : addLifelines){ >+ for(LifelineEditPart lp : addLifelines) { > RectangleFigure rect = lp.getPrimaryShape().getFigureLifelineNameContainerFigure(); >- figureState.put(lp, new FigureState(rect.getBackgroundColor())); >+ feedbackStates.put(lp, new FigureState(rect.getBackgroundColor(), rect.getForegroundColor(), rect.getLineWidth())); > rect.setBackgroundColor(COVER_COLOR); > rect.setFill(true); > } >- >+ > // restore lifeline outside >- for(LifelineEditPart lp : removeLifelines){ >- FigureState s = figureState.get(lp); >+ for(LifelineEditPart lp : removeLifelines) { >+ FigureState s = feedbackStates.get(lp); > if(s == null) > continue; >- >- RectangleFigure rect = lp.getPrimaryShape().getFigureLifelineNameContainerFigure(); >- rect.setBackgroundColor(s.bgColor); >- rect.setFill(true); >- } >- } > >- public static void eraseSizeOnDropFeedback(Request request, EditPart host) { >- for(LifelineEditPart lp : highlightLifelines){ >- FigureState s = figureState.get(lp); >- if(s == null) >- continue; >- > RectangleFigure rect = lp.getPrimaryShape().getFigureLifelineNameContainerFigure(); > rect.setBackgroundColor(s.bgColor); > rect.setFill(true); > } >- >- lifelines = null; >- highlightLifelines = new ArrayList<LifelineEditPart>(); > } >- >- public static void showConnectionFeedback(EditPart host, Color color) { >- if(host instanceof LifelineEditPart){ >+ >+ private Map<Object, FigureState> figureState = new HashMap<Object, FigureState>(); >+ >+ /** >+ * Maybe this value can be managed by preferences. >+ */ >+ private Color getHighlightBackground() { >+ return null; >+ } >+ >+ /** >+ * Maybe this value can be managed by preferences. >+ */ >+ private int getHighlightBorderWidth() { >+ return 2; >+ } >+ >+ private List<IFigure> getHighlightFigures(EditPart host) { >+ List<IFigure> figures = new ArrayList<IFigure>(); >+ if(host instanceof LifelineEditPart) { > LifelineEditPart part = (LifelineEditPart)host; >- RectangleFigure fig = part.getPrimaryShape().getFigureLifelineNameContainerFigure(); >- saveIfNotExist(host, fig); >- fig.setBackgroundColor(color); >- fig.setFill(true); >- }else if(host instanceof AbstractExecutionSpecificationEditPart){ >- ExecutionSpecificationRectangleFigure fig = ((AbstractExecutionSpecificationEditPart)host).getPrimaryShape(); >- saveIfNotExist(host, fig); >- fig.setBackgroundColor(color); >- }else if(host instanceof CombinedFragmentEditPart){ >- CombinedFragmentFigure fig = ((CombinedFragmentEditPart)host).getPrimaryShape(); >- saveIfNotExist(host, fig); >- fig.setBackgroundColor(color); >- }else if(host instanceof InteractionOperandEditPart){ >- InteractionOperandEditPart op = (InteractionOperandEditPart) host; >- CombinedFragmentEditPart cep = (CombinedFragmentEditPart) op.getParent().getParent(); >- CombinedFragmentFigure fig = cep.getPrimaryShape(); >- saveIfNotExist(host, fig); >- fig.setBackgroundColor(color); >- }else if(host instanceof CommentEditPart){ >- HTMLCornerBentFigure fig = ((CommentEditPart)host).getPrimaryShape(); >- saveIfNotExist(host, fig); >- fig.setBackgroundColor(color); >- }else if(host instanceof ConstraintEditPart){ >- ConstraintFigure fig = ( (ConstraintEditPart) host).getPrimaryShape(); >- saveIfNotExist(host, fig); >- fig.setBackgroundColor(color); >+ figures.add(part.getPrimaryShape().getFigureLifelineNameContainerFigure()); >+ figures.add(part.getPrimaryShape().getFigureLifelineDotLineFigure()); >+ } else if(host instanceof AbstractExecutionSpecificationEditPart) { >+ figures.add(((AbstractExecutionSpecificationEditPart)host).getPrimaryShape()); >+ } else if(host instanceof CombinedFragmentEditPart) { >+ figures.add(((CombinedFragmentEditPart)host).getPrimaryShape()); >+ } else if(host instanceof InteractionOperandEditPart) { >+ InteractionOperandEditPart op = (InteractionOperandEditPart)host; >+ CombinedFragmentEditPart cep = (CombinedFragmentEditPart)op.getParent().getParent(); >+ figures.add(cep.getPrimaryShape()); >+ } else if(host instanceof CommentEditPart) { >+ figures.add(((CommentEditPart)host).getPrimaryShape()); >+ } else if(host instanceof ConstraintEditPart) { >+ figures.add(((ConstraintEditPart)host).getPrimaryShape()); >+ } else if(host instanceof IPapyrusEditPart) { >+ figures.add(((IPapyrusEditPart)host).getPrimaryShape()); > } >+ return figures; > } > >- protected static void saveIfNotExist(EditPart host, IFigure fig) { >- if(!figureState.containsKey(host)) >- figureState.put(host, new FigureState(fig.getBackgroundColor())); >+ /** >+ * Maybe this value can be managed by preferences. >+ */ >+ private Color getHighlightForeground() { >+ return null; > } >- >- public static void eraseConnectionFeedback(EditPart host) { >- FigureState s = figureState.get(host); >- if(s == null) >+ >+ public void highlight(EditPart host) { >+ List<IFigure> highlightFigures = getHighlightFigures(host); >+ if(highlightFigures.isEmpty()) { > return; >- >- if(host instanceof LifelineEditPart){ >- LifelineEditPart part = (LifelineEditPart)host; >- RectangleFigure fig = part.getPrimaryShape().getFigureLifelineNameContainerFigure(); >- fig.setBackgroundColor(s.bgColor); >- fig.setFill(true); >- }else if(host instanceof AbstractExecutionSpecificationEditPart){ >- ExecutionSpecificationRectangleFigure fig = ((AbstractExecutionSpecificationEditPart)host).getPrimaryShape(); >- fig.setBackgroundColor(s.bgColor); >- }else if(host instanceof CombinedFragmentEditPart){ >- CombinedFragmentEditPart cep = (CombinedFragmentEditPart)host; >- cep.getPrimaryShape().setBackgroundColor(s.bgColor); >- }else if(host instanceof InteractionOperandEditPart){ >- InteractionOperandEditPart op = (InteractionOperandEditPart) host; >- CombinedFragmentEditPart cep = (CombinedFragmentEditPart) op.getParent().getParent(); >- cep.getPrimaryShape().setBackgroundColor(s.bgColor); >- }else if(host instanceof CommentEditPart){ >- HTMLCornerBentFigure fig = ((CommentEditPart)host).getPrimaryShape(); >- fig.setBackgroundColor(s.bgColor); >- }else if(host instanceof ConstraintEditPart){ >- ConstraintFigure fig = ( (ConstraintEditPart) host).getPrimaryShape(); >- fig.setBackgroundColor(s.bgColor); >+ } >+ >+ Color background = getHighlightBackground(); >+ Color foreground = getHighlightForeground(); >+ int lineWidth = getHighlightBorderWidth(); >+ for(IFigure figure : highlightFigures) { >+ saveIfNotExist(figure, figure); >+ updateFigure(figure, background, foreground, lineWidth); > } >- >- figureState.remove(host); > } >- >- static class FigureState{ >- Color bgColor; >- >- public FigureState(Color bgColor) { >- this.bgColor = bgColor; >+ >+ protected void saveIfNotExist(Object host, IFigure fig) { >+ if(!figureState.containsKey(host)) { >+ int lineWidth = 1; >+ Border border = fig.getBorder(); >+ if(border instanceof LineBorder) { >+ lineWidth = ((LineBorder)border).getWidth(); >+ } else if(fig instanceof Shape) { >+ lineWidth = ((Shape)fig).getLineWidth(); >+ } >+ figureState.put(host, new FigureState(fig.getBackgroundColor(), fig.getForegroundColor(), lineWidth)); > } > } >+ >+ public void unhighlight() { >+ if(figureState == null || figureState.isEmpty()) { >+ return; >+ } >+ Set<Entry<Object, FigureState>> entrySet = figureState.entrySet(); >+ for(Entry<Object, FigureState> entry : entrySet) { >+ Object key = entry.getKey(); >+ FigureState value = entry.getValue(); >+ if(key instanceof IFigure) { >+ IFigure fig = (IFigure)key; >+ updateFigure(fig, value.bgColor, value.fgColor, value.lineWidth); >+ } else if(key instanceof EditPart) { >+ List<IFigure> figures = getHighlightFigures((EditPart)key); >+ for(IFigure fig : figures) { >+ updateFigure(fig, value.bgColor, value.fgColor, value.lineWidth); >+ } >+ } >+ } >+ figureState.clear(); >+ } >+ >+ public void unhighlight(EditPart host) { >+ List<IFigure> highlightFigures = getHighlightFigures(host); >+ if(highlightFigures.isEmpty()) { >+ return; >+ } >+ for(IFigure figure : highlightFigures) { >+ FigureState s = figureState.remove(figure); >+ if(s == null) { >+ continue; >+ } >+ updateFigure(figure, s.bgColor, s.fgColor, s.lineWidth); >+ } >+ } >+ >+ private void updateFigure(IFigure fig, Color bgColor, Color fgColor, int lineWidth) { >+ if(fig == null) { >+ return; >+ } >+ if(lineWidth > 0) { >+ Border border = fig.getBorder(); >+ if(border != null && border instanceof LineBorder) { >+ ((LineBorder)border).setWidth(lineWidth); >+ } else if(fig instanceof Shape) { >+ ((Shape)fig).setLineWidth(lineWidth); >+ } else if(fig instanceof Polyline) { >+ ((Polyline)fig).setLineWidth(lineWidth); >+ } >+ } >+ if(bgColor != null) { >+ fig.setBackgroundColor(bgColor); >+ } >+ if(fgColor != null) { >+ fig.setForegroundColor(fgColor); >+ } >+ fig.repaint(); >+ } > } >Index: custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LifelineModelChildrenHelper.java >=================================================================== >--- custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LifelineModelChildrenHelper.java (revision 0) >+++ custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LifelineModelChildrenHelper.java (revision 0) >@@ -0,0 +1,90 @@ >+package org.eclipse.papyrus.uml.diagram.sequence.util; >+ >+import java.util.ArrayList; >+import java.util.Collections; >+import java.util.Comparator; >+import java.util.List; >+ >+import org.eclipse.draw2d.geometry.Rectangle; >+import org.eclipse.emf.ecore.EObject; >+import org.eclipse.emf.ecore.EStructuralFeature; >+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; >+import org.eclipse.gmf.runtime.notation.NotationPackage; >+import org.eclipse.gmf.runtime.notation.View; >+import org.eclipse.uml2.uml.ExecutionSpecification; >+ >+ >+public class LifelineModelChildrenHelper { >+ >+ /** >+ * Try to fixed the bug about display ExecutionSpecifications(ES). >+ * >+ * At some times, the child ES would be displayed under the parent ES. >+ * >+ * Fixed to sort them with bounds in model before creating. >+ */ >+ public static List<View> getModelChildren(View lifeline) { >+ if(lifeline == null) { >+ return Collections.emptyList(); >+ } >+ @SuppressWarnings("unchecked") >+ List<View> children = new ArrayList<View>(lifeline.getVisibleChildren()); >+ sortChildren(children); >+ return children; >+ } >+ >+ private static void sortChildren(List<View> children) { >+ Collections.sort(children, new Comparator<Object>() { >+ >+ public int compare(Object o1, Object o2) { >+ if(!(o1 instanceof View && o2 instanceof View)) { >+ return 0; >+ } >+ View v1 = (View)o1; >+ View v2 = (View)o2; >+ EObject e1 = ViewUtil.resolveSemanticElement(v1); >+ EObject e2 = ViewUtil.resolveSemanticElement(v2); >+ if(!(e1 instanceof ExecutionSpecification && e2 instanceof ExecutionSpecification)) { >+ return 0; >+ } >+ Rectangle r1 = getViewBounds(v1); >+ Rectangle r2 = getViewBounds(v2); >+ if(r1 == null || r2 == null) { >+ return 0; >+ } >+ if(r1.width <= 0) { >+ r1.width = 16; >+ } >+ if(r2.width <= 0) { >+ r2.width = 16; >+ } >+ >+ if((r1.x < r2.x) || r1.right() < r2.right()) { >+ return -1; >+ } >+ return 1; >+ } >+ }); >+ } >+ >+ private static Rectangle getViewBounds(View view) { >+ if(view == null) { >+ return null; >+ } >+ Integer x = getFeatureValue(view, NotationPackage.eINSTANCE.getLocation_X()); >+ Integer y = getFeatureValue(view, NotationPackage.eINSTANCE.getLocation_Y()); >+ Integer width = getFeatureValue(view, NotationPackage.eINSTANCE.getSize_Width()); >+ Integer height = getFeatureValue(view, NotationPackage.eINSTANCE.getSize_Height()); >+ if(x == null && y == null && width == null && height == null) { >+ return null; >+ } >+ return new Rectangle(x == null ? 0 : x.intValue(), y == null ? 0 : y.intValue(), width == null ? -1 : width.intValue(), height == null ? -1 : height.intValue()); >+ } >+ >+ private static Integer getFeatureValue(View view, EStructuralFeature feature) { >+ if(view == null || feature == null) { >+ return null; >+ } >+ return (Integer)ViewUtil.getPropertyValue(view, feature, feature.getEContainingClass()); >+ } >+} >Index: src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/MessageReorientCommand.java >=================================================================== >--- src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/MessageReorientCommand.java (revision 9538) >+++ src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/MessageReorientCommand.java (working copy) >@@ -83,11 +83,16 @@ > return false; > } > Interaction container = (Interaction)getLink().eContainer(); >- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4003(container, getLink(), getNewSource(), getOldTarget()); >+ boolean canExistMessage = UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4003(container, getLink(), getNewSource(), getOldTarget()); >+ if(!canExistMessage) { >+ return false; >+ } >+ //Fixed bug about reconnect messages. >+ return ReconnectMessageHelper.canReorientSource(getLink(), getNewSource()); > } > > /** >- * @generated >+ * @generated NOT > */ > protected boolean canReorientTarget() { > if(!(oldEnd instanceof Element && newEnd instanceof Element)) { >@@ -98,7 +103,10 @@ > return false; > } > Interaction container = (Interaction)getLink().eContainer(); >- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4003(container, getLink(), source, getNewTarget()); >+ if(!UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4003(container, getLink(), source, getNewTarget())) { >+ return false; >+ } >+ return ReconnectMessageHelper.canReorientTarget(getLink(), getNewTarget()); > } > > /** >Index: src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/BehaviorExecutionSpecificationEditPart.java >=================================================================== >--- src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/BehaviorExecutionSpecificationEditPart.java (revision 9538) >+++ src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/BehaviorExecutionSpecificationEditPart.java (working copy) >@@ -36,7 +36,6 @@ > import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; > import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; > import org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifiedTypeConnectionRequest; >-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifiedTypeRequest; > import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities; > import org.eclipse.gmf.runtime.emf.type.core.IElementType; > import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure; >@@ -1115,37 +1114,4 @@ > return super.getSourceConnectionAnchor(connEditPart); > } > >- /** >- * Override for add elements on ExecutionSpecification >- */ >- @Override >- public Command getCommand(Request request) { >- if(request instanceof CreateUnspecifiedTypeRequest) { >- return getParent().getCommand(request); >- } >- return super.getCommand(request); >- } >- >- /** >- * @generated NOT Override for redirecting creation request to the lifeline >- */ >- @Override >- public void showSourceFeedback(Request request) { >- if(request instanceof CreateUnspecifiedTypeRequest) { >- getParent().showSourceFeedback(request); >- } >- super.showSourceFeedback(request); >- } >- >- /** >- * @generated NOT Override for redirecting creation request to the lifeline >- */ >- @Override >- public void eraseSourceFeedback(Request request) { >- if(request instanceof CreateUnspecifiedTypeRequest) { >- getParent().eraseSourceFeedback(request); >- } >- super.eraseSourceFeedback(request); >- } >- > } >Index: src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/LifelineEditPart.java >=================================================================== >--- src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/LifelineEditPart.java (revision 9538) >+++ src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/LifelineEditPart.java (working copy) >@@ -116,6 +116,7 @@ > import org.eclipse.papyrus.uml.diagram.sequence.util.CommandHelper; > import org.eclipse.papyrus.uml.diagram.sequence.util.LifelineCoveredByUpdater; > import org.eclipse.papyrus.uml.diagram.sequence.util.LifelineMessageCreateHelper; >+import org.eclipse.papyrus.uml.diagram.sequence.util.LifelineModelChildrenHelper; > import org.eclipse.papyrus.uml.diagram.sequence.util.LifelineResizeHelper; > import org.eclipse.papyrus.uml.diagram.sequence.util.NotificationHelper; > import org.eclipse.swt.graphics.Color; >@@ -1150,6 +1151,16 @@ > } > return types; > } >+ >+ @Override >+ protected List getModelChildren() { >+ Object model = getModel(); >+ //Fixed bug about inverse order for ExecutionSpecifications. >+ if (model instanceof View){ >+ return LifelineModelChildrenHelper.getModelChildren((View)model); >+ } >+ return super.getModelChildren(); >+ } > > /** > * @generated >Index: src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ActionExecutionSpecificationEditPart.java >=================================================================== >--- src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ActionExecutionSpecificationEditPart.java (revision 9538) >+++ src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ActionExecutionSpecificationEditPart.java (working copy) >@@ -36,7 +36,6 @@ > import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; > import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; > import org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifiedTypeConnectionRequest; >-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifiedTypeRequest; > import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities; > import org.eclipse.gmf.runtime.emf.type.core.IElementType; > import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure; >@@ -172,7 +171,7 @@ > final NodeFigure figure = createNodePlate(); > figure.setLayoutManager(new DelegatingLayout()); > //figure.setLayoutManager(new StackLayout()); >- >+ > IFigure shape = createNodeShape(); > figure.add(shape, new FillParentLocator()); > contentPane = setupContentPane(shape); >@@ -212,15 +211,15 @@ > } > } > >-// /** >-// * @generated >-// */ >-// @Override >-// protected void setLineWidth(int width) { >-// if(primaryShape instanceof Shape) { >-// ((Shape)primaryShape).setLineWidth(width); >-// } >-// } >+ // /** >+ // * @generated >+ // */ >+ // @Override >+ // protected void setLineWidth(int width) { >+ // if(primaryShape instanceof Shape) { >+ // ((Shape)primaryShape).setLineWidth(width); >+ // } >+ // } > > /** > * @generated >@@ -976,20 +975,20 @@ > return types; > } > >-// /** >-// * @generated >-// */ >-// public class ExecutionSpecificationRectangleFigure extends RectangleFigure { >-// >-// /** >-// * @generated >-// */ >-// public ExecutionSpecificationRectangleFigure() { >-// this.setPreferredSize(new Dimension(getMapMode().DPtoLP(16), getMapMode().DPtoLP(60))); >-// this.setMinimumSize(new Dimension(getMapMode().DPtoLP(16), getMapMode().DPtoLP(20))); >-// } >-// >-// } >+ // /** >+ // * @generated >+ // */ >+ // public class ExecutionSpecificationRectangleFigure extends RectangleFigure { >+ // >+ // /** >+ // * @generated >+ // */ >+ // public ExecutionSpecificationRectangleFigure() { >+ // this.setPreferredSize(new Dimension(getMapMode().DPtoLP(16), getMapMode().DPtoLP(60))); >+ // this.setMinimumSize(new Dimension(getMapMode().DPtoLP(16), getMapMode().DPtoLP(20))); >+ // } >+ // >+ // } > > /** > * @generated >@@ -1028,7 +1027,7 @@ > /** > * Add connection on top off the figure during the feedback. > */ >- >+ > public ConnectionAnchor getTargetConnectionAnchor(Request request) { > if(request instanceof CreateUnspecifiedTypeConnectionRequest) { > CreateUnspecifiedTypeConnectionRequest createRequest = (CreateUnspecifiedTypeConnectionRequest)request; >@@ -1118,36 +1117,4 @@ > return super.getSourceConnectionAnchor(connEditPart); > } > >- /** >- * Override for adding elements on ExecutionSpecification >- */ >- @Override >- public Command getCommand(Request request) { >- if(request instanceof CreateUnspecifiedTypeRequest) { >- return getParent().getCommand(request); >- } >- return super.getCommand(request); >- } >- >- /** >- * @generated NOT Override for redirecting creation request to the lifeline >- */ >- @Override >- public void showSourceFeedback(Request request) { >- if(request instanceof CreateUnspecifiedTypeRequest) { >- getParent().showSourceFeedback(request); >- } >- super.showSourceFeedback(request); >- } >- >- /** >- * @generated NOT Override for redirecting creation request to the lifeline >- */ >- @Override >- public void eraseSourceFeedback(Request request) { >- if(request instanceof CreateUnspecifiedTypeRequest) { >- getParent().eraseSourceFeedback(request); >- } >- super.eraseSourceFeedback(request); >- } > }
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 377501
:
214914
|
220884
| 224162 |
224421
|
224672
|
224673