Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuentin Le Menez2017-07-18 15:33:51 +0000
committerPatrick Tessier2017-08-31 13:24:11 +0000
commit7c97222c5dfcd71c609af06d62633d0fccdaf4f2 (patch)
treef54490f5d177e9a893878e9ae5576dbd5123a681 /plugins/uml
parente3f10f66a15b3ca0586ff4b1abf95607796bf312 (diff)
downloadorg.eclipse.papyrus-7c97222c5dfcd71c609af06d62633d0fccdaf4f2.tar.gz
org.eclipse.papyrus-7c97222c5dfcd71c609af06d62633d0fccdaf4f2.tar.xz
org.eclipse.papyrus-7c97222c5dfcd71c609af06d62633d0fccdaf4f2.zip
Bug 520838 - [timing diagram] The timing diagram needs to be rewired
Change-Id: I342c75ffc427c507e06e70d53a6d236960432a24 Signed-off-by: Quentin Le Menez <quentin.lemenez@cea.fr>
Diffstat (limited to 'plugins/uml')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomInteractionEditPartTN.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomTimingDiagramEditPart.java19
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomUMLEditPartFactory.java140
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomFullLifelineTimelineCompartmentItemSemanticEditPolicyCN.java17
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/CustomInteractionRectangleFigure.java33
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/DimensioningArrowFigure.java12
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/GeneralOrderingHorizontalFigure.java12
-rwxr-xr-xplugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/InteractionTimingRectangleFigure.java104
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src-gen/org/eclipse/papyrus/uml/diagram/timing/edit/parts/InteractionEditPartTN.java23
9 files changed, 258 insertions, 108 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomInteractionEditPartTN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomInteractionEditPartTN.java
index 6bfc8411c52..5c47ba0ad0e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomInteractionEditPartTN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomInteractionEditPartTN.java
@@ -50,7 +50,7 @@ public class CustomInteractionEditPartTN extends InteractionEditPartTN {
@Override
protected IFigure createNodeShape() {
final CustomInteractionRectangleFigure interactionRectangleFigure = new CustomInteractionRectangleFigure();
- //interactionRectangleFigure.getCompartmentFigure().setOutline(false);
+ interactionRectangleFigure.getCompartmentFigure().setOutline(false);
interactionRectangleFigure.getNameLabel().setVisible(false);
// disable the shadow because it stays behind after move then Ctrl+Z
interactionRectangleFigure.setShadow(false);
@@ -67,8 +67,8 @@ public class CustomInteractionEditPartTN extends InteractionEditPartTN {
int consumedHeight = 0;
for (int i = 0; i < children.size(); i++) {
final IFigure child = children.get(i);
- if (child.equals(interactionRectangleFigure.getNameLabel())) {
- final int height = Math.max(interactionRectangleFigure.getNameLabel().getPreferredSize().height + HEADER_HEIGHT_PADDING, MIN_HEADER_HEIGHT);
+ if (child.equals(interactionRectangleFigure.getHeaderLabelContainer())) {
+ final int height = Math.max(interactionRectangleFigure.getHeaderLabel().getPreferredSize().height + HEADER_HEIGHT_PADDING, MIN_HEADER_HEIGHT);
child.setBounds(new Rectangle(clientArea.x, clientArea.y + consumedHeight, clientArea.width, height));
consumedHeight = consumedHeight + height;
} else if (child.equals(interactionRectangleFigure.getCompartmentFigure())) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomTimingDiagramEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomTimingDiagramEditPart.java
index d00db84b51d..94679a96155 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomTimingDiagramEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomTimingDiagramEditPart.java
@@ -49,22 +49,5 @@ public class CustomTimingDiagramEditPart extends TimingDiagramEditPart {
}
return true;
}
- /**
- * @see org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart#createFigure()
- *
- * @return
- */
- @Override
- protected IFigure createFigure() {
- IFigure fig= super.createFigure();
- String message="This diagram is not available, it will be fixed for the next service release.";
- org.eclipse.draw2d.Label label = new org.eclipse.draw2d.Label(message);
- label.setBackgroundColor(ColorConstants.lightBlue);
- label.setOpaque(true);
- label.setBounds(new Rectangle(20,20,600,40));
- fig.add(label);
- return fig;
-
-
- }
+
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomUMLEditPartFactory.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomUMLEditPartFactory.java
index f3003c6b22c..5b9481aacb8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomUMLEditPartFactory.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomUMLEditPartFactory.java
@@ -59,76 +59,76 @@ public class CustomUMLEditPartFactory extends UMLEditPartFactory {
switch (visualID) {
case TimingDiagramEditPart.VISUAL_ID:
return new CustomTimingDiagramEditPart(view);
-// case InteractionEditPartTN.VISUAL_ID:
-// return new CustomInteractionEditPartTN(view);
-// case InteractionCompartmentEditPartTN.VISUAL_ID:
-// return new CustomInteractionCompartmentEditPartTN(view);
-// case FullLifelineStateDefinitionCompartmentEditPartCN.VISUAL_ID:
-// return new CustomFullLifelineStateDefinitionCompartmentEditPartCN(view);
-// case FullLifelineTimelineCompartmentEditPartCN.VISUAL_ID:
-// return new CustomFullLifelineTimelineCompartmentEditPartCN(view);
-// case StateDefinitionEditPart.VISUAL_ID:
-// return new CustomStateDefinitionEditPart(view);
-// case OccurrenceSpecificationLabelEditPart.VISUAL_ID:
-// return new CustomOccurrenceSpecificationLabelEditPart(view);
-// case FullStateInvariantEditPartCN.VISUAL_ID:
-// return new CustomFullStateInvariantEditPartCN(view);
-// case OccurrenceSpecificationEditPartCN.VISUAL_ID:
-// return new CustomOccurrenceSpecificationEditPartCN(view);
-// case MessageOccurrenceSpecificationEditPartCN.VISUAL_ID:
-// return new CustomMessageOccurrenceSpecificationEditPartCN(view);
-// case MessageOccurrenceSpecificationLabelEditPart.VISUAL_ID:
-// return new CustomMessageOccurrenceSpecificationLabelEditPart(view);
-// case TimeConstraintEditPart.VISUAL_ID:
-// return new CustomTimeConstraintEditPart(view);
-// case TimeObservationEditPart.VISUAL_ID:
-// return new CustomTimeObservationEditPart(view);
-// case DurationObservationEditPartCN.VISUAL_ID:
-// return new CustomDurationObservationEditPart(view);
-// case DurationConstraintEditPartCN.VISUAL_ID:
-// return new CustomDurationConstraintEditPart(view);
-// case FullLifelineEditPartCN.VISUAL_ID:
-// return new CustomFullLifelineEditPartCN(view);
-// case CompactLifelineEditPartCN.VISUAL_ID:
-// return new CustomCompactLifelineEditPartCN(view);
-// case CompactLifelineCompartmentEditPartCN.VISUAL_ID:
-// return new CustomCompactLifelineCompartmentEditPart(view);
-// case FreeTimingRulerEditPartCN.VISUAL_ID:
-// return new CustomFreeTimingRulerEditPart(view);
-// case TickEditPart.VISUAL_ID:
-// return new CustomTickEditPart(view);
-// case DestructionOccurrenceSpecificationEditPartCN.VISUAL_ID:
-// return new CustomDestructionOccurrenceSpecificationEditPartCN(view);
-// case CompactStateInvariantEditPartCN.VISUAL_ID:
-// return new CustomCompactStateInvariantEditPartCN(view);
-// case TimeRulerCompartmentEditPartCN.VISUAL_ID:
-// return new CustomTimeRulerCompartmentEditPartCN(view);
-// case CompactStateInvariantNameEditPart.VISUAL_ID:
-// return new CustomCompactStateInvariantNameEditPart(view);
-// case DestructionOccurrenceSpecificationLabelEditPart.VISUAL_ID:
-// return new CustomDestructionOccurrenceSpecificationLabelEditPart(view);
-// case StateDefinitionLabelEditPart.VISUAL_ID:
-// return new CustomStateDefinitionLabelEditPart(view);
-// case FullStateInvariantVerticalLineEditPart.VISUAL_ID:
-// return new CustomFullStateInvariantVerticalLineEditPart(view);
-// case MessageLostEditPart.VISUAL_ID:
-// return new CustomMessageLostEditPart(view);
-// case MessageFoundEditPart.VISUAL_ID:
-// return new CustomMessageFoundEditPart(view);
-// case GeneralOrderingEditPart.VISUAL_ID:
-// return new CustomGeneralOrderingEditPart(view);
-// case GateEditPart.VISUAL_ID:
-// return new CustomGateEditPart(view);
-// case FreeTimeRulerCompartmentEditPart.VISUAL_ID:
-// return new CustomFreeTimeRulerCompartmentEditPart(view);
-// case FullLifelineTimeRulerCompartmentEditPartCN.VISUAL_ID:
-// return new CustomFullLifelineTimeRulerCompartmentEditPartCN(view);
-// case CompactLifelineTimeRulerCompartmentEditPartCN.VISUAL_ID:
-// return new CustomCompactLifelineTimeRulerCompartmentEditPartCN(view);
- default:
- return new NoVisibleEditPart(view);
- // when adding cases to this switch, also add the corresponding IDs in the extension
- // org.eclipse.gmf.runtime.diagram.ui.editpartProviders
+ case InteractionEditPartTN.VISUAL_ID:
+ return new CustomInteractionEditPartTN(view);
+ case InteractionCompartmentEditPartTN.VISUAL_ID:
+ return new CustomInteractionCompartmentEditPartTN(view);
+ case FullLifelineStateDefinitionCompartmentEditPartCN.VISUAL_ID:
+ return new CustomFullLifelineStateDefinitionCompartmentEditPartCN(view);
+ case FullLifelineTimelineCompartmentEditPartCN.VISUAL_ID:
+ return new CustomFullLifelineTimelineCompartmentEditPartCN(view);
+ case StateDefinitionEditPart.VISUAL_ID:
+ return new CustomStateDefinitionEditPart(view);
+ case OccurrenceSpecificationLabelEditPart.VISUAL_ID:
+ return new CustomOccurrenceSpecificationLabelEditPart(view);
+ case FullStateInvariantEditPartCN.VISUAL_ID:
+ return new CustomFullStateInvariantEditPartCN(view);
+ case OccurrenceSpecificationEditPartCN.VISUAL_ID:
+ return new CustomOccurrenceSpecificationEditPartCN(view);
+ case MessageOccurrenceSpecificationEditPartCN.VISUAL_ID:
+ return new CustomMessageOccurrenceSpecificationEditPartCN(view);
+ case MessageOccurrenceSpecificationLabelEditPart.VISUAL_ID:
+ return new CustomMessageOccurrenceSpecificationLabelEditPart(view);
+ case TimeConstraintEditPart.VISUAL_ID:
+ return new CustomTimeConstraintEditPart(view);
+ case TimeObservationEditPart.VISUAL_ID:
+ return new CustomTimeObservationEditPart(view);
+ case DurationObservationEditPartCN.VISUAL_ID:
+ return new CustomDurationObservationEditPart(view);
+ case DurationConstraintEditPartCN.VISUAL_ID:
+ return new CustomDurationConstraintEditPart(view);
+ case FullLifelineEditPartCN.VISUAL_ID:
+ return new CustomFullLifelineEditPartCN(view);
+ case CompactLifelineEditPartCN.VISUAL_ID:
+ return new CustomCompactLifelineEditPartCN(view);
+ case CompactLifelineCompartmentEditPartCN.VISUAL_ID:
+ return new CustomCompactLifelineCompartmentEditPart(view);
+ case FreeTimingRulerEditPartCN.VISUAL_ID:
+ return new CustomFreeTimingRulerEditPart(view);
+ case TickEditPart.VISUAL_ID:
+ return new CustomTickEditPart(view);
+ case DestructionOccurrenceSpecificationEditPartCN.VISUAL_ID:
+ return new CustomDestructionOccurrenceSpecificationEditPartCN(view);
+ case CompactStateInvariantEditPartCN.VISUAL_ID:
+ return new CustomCompactStateInvariantEditPartCN(view);
+ case TimeRulerCompartmentEditPartCN.VISUAL_ID:
+ return new CustomTimeRulerCompartmentEditPartCN(view);
+ case CompactStateInvariantNameEditPart.VISUAL_ID:
+ return new CustomCompactStateInvariantNameEditPart(view);
+ case DestructionOccurrenceSpecificationLabelEditPart.VISUAL_ID:
+ return new CustomDestructionOccurrenceSpecificationLabelEditPart(view);
+ case StateDefinitionLabelEditPart.VISUAL_ID:
+ return new CustomStateDefinitionLabelEditPart(view);
+ case FullStateInvariantVerticalLineEditPart.VISUAL_ID:
+ return new CustomFullStateInvariantVerticalLineEditPart(view);
+ case MessageLostEditPart.VISUAL_ID:
+ return new CustomMessageLostEditPart(view);
+ case MessageFoundEditPart.VISUAL_ID:
+ return new CustomMessageFoundEditPart(view);
+ case GeneralOrderingEditPart.VISUAL_ID:
+ return new CustomGeneralOrderingEditPart(view);
+ case GateEditPart.VISUAL_ID:
+ return new CustomGateEditPart(view);
+ case FreeTimeRulerCompartmentEditPart.VISUAL_ID:
+ return new CustomFreeTimeRulerCompartmentEditPart(view);
+ case FullLifelineTimeRulerCompartmentEditPartCN.VISUAL_ID:
+ return new CustomFullLifelineTimeRulerCompartmentEditPartCN(view);
+ case CompactLifelineTimeRulerCompartmentEditPartCN.VISUAL_ID:
+ return new CustomCompactLifelineTimeRulerCompartmentEditPartCN(view);
+ // default:
+ // return new NoVisibleEditPart(view);
+ // when adding cases to this switch, also add the corresponding IDs in the extension
+ // org.eclipse.gmf.runtime.diagram.ui.editpartProviders
}
}
return super.createEditPart(context, model);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomFullLifelineTimelineCompartmentItemSemanticEditPolicyCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomFullLifelineTimelineCompartmentItemSemanticEditPolicyCN.java
index d6f5679418c..16c47112ebb 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomFullLifelineTimelineCompartmentItemSemanticEditPolicyCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomFullLifelineTimelineCompartmentItemSemanticEditPolicyCN.java
@@ -13,6 +13,7 @@ import org.eclipse.gef.requests.ReconnectRequest;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.CustomDurationConstraintCreateCommand;
import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.CustomDurationObservationCreateCommand;
import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.CustomGeneralOrderingCreateCommand;
@@ -72,4 +73,20 @@ public class CustomFullLifelineTimelineCompartmentItemSemanticEditPolicyCN exten
}
return super.getCreateCommand(req);
}
+
+ /**
+ * @see org.eclipse.papyrus.uml.diagram.timing.edit.policies.UMLBaseItemSemanticEditPolicy#getSemanticCommand(org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest)
+ *
+ * @param request
+ * @return
+ */
+ @Override
+ protected Command getSemanticCommand(IEditCommandRequest request) {
+ // This override is used to suppplement the missing elementtypes in order to call the right creation command
+ if (request instanceof CreateElementRequest) {
+ return getCreateCommand((CreateElementRequest) request);
+ }
+
+ return super.getSemanticCommand(request);
+ }
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/CustomInteractionRectangleFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/CustomInteractionRectangleFigure.java
index 4db58411385..25b6128c496 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/CustomInteractionRectangleFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/CustomInteractionRectangleFigure.java
@@ -8,8 +8,6 @@
*******************************************************************************/
package org.eclipse.papyrus.uml.diagram.timing.custom.figures;
-import java.util.List;
-
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.MarginBorder;
import org.eclipse.draw2d.RectangleFigure;
@@ -18,18 +16,20 @@ import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.PapyrusWrappingLabel;
import org.eclipse.papyrus.uml.diagram.common.draw2d.InteractionFigure;
import org.eclipse.papyrus.uml.diagram.common.draw2d.LeftToolbarLayout;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.InteractionRectangleFigure;
-public class CustomInteractionRectangleFigure extends InteractionRectangleFigure {
+public class CustomInteractionRectangleFigure extends InteractionTimingRectangleFigure {
private RectangleFigure timeRulerCompartment;
public CustomInteractionRectangleFigure() {
setLayoutManager(new ToolbarLayout());
+ createContents();
}
@Override
- protected void createContentPane(final List<String> compartmentFigure) {
+ protected void createContents() {
+ add(createInteractionFigureHeader());
+ add(createContentPane());
final int childrenSize = getChildren().size();
add(createTimeRulerCompartment(), childrenSize);
}
@@ -38,9 +38,30 @@ public class CustomInteractionRectangleFigure extends InteractionRectangleFigure
return this.timeRulerCompartment = new TimeRulerFigure();
}
-
+ protected InteractionFigure createInteractionFigureHeader() {
+ this.interactionLabel = new PapyrusWrappingLabel() {
+
+ @Override
+ public Dimension getPreferredSize(final int wHint, final int hHint) {
+ final Dimension preferredSize = super.getPreferredSize(wHint, hHint);
+ if (preferredSize.width == 0) {
+ return preferredSize;
+ }
+ return new Dimension(preferredSize.width + 2, preferredSize.height + 2);
+ }
+ };
+ this.interactionLabelContainer = new InteractionFigure();
+ this.interactionLabelContainer.setBorder(new MarginBorder(3, 3, 0, 0));
+ this.interactionLabelContainer.setLayoutManager(new LeftToolbarLayout());
+ this.interactionLabelContainer.add(this.interactionLabel);
+ return this.interactionLabelContainer;
+ }
+
+ public InteractionFigure getHeaderLabelContainer() {
+ return this.interactionLabelContainer;
+ }
public RectangleFigure getTimeRulerContainerFigure() {
return this.timeRulerCompartment;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/DimensioningArrowFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/DimensioningArrowFigure.java
index 501e4d48664..74f48040d52 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/DimensioningArrowFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/DimensioningArrowFigure.java
@@ -10,6 +10,7 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.timing.custom.figures;
+import org.eclipse.draw2d.Border;
import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.papyrus.uml.diagram.common.figure.node.PapyrusNodeFigure;
@@ -25,6 +26,17 @@ public class DimensioningArrowFigure extends PapyrusNodeFigure {
setBorder(null);
}
+ /**
+ * @see org.eclipse.draw2d.Figure#setBorder(org.eclipse.draw2d.Border)
+ *
+ * @param border
+ */
+ @Override
+ public void setBorder(Border border) {
+ // there should not be a visible border on the element
+ super.setBorder(null);
+ }
+
@Override
public void paintFigure(final Graphics g) {
g.pushState();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/GeneralOrderingHorizontalFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/GeneralOrderingHorizontalFigure.java
index e2ec72f89e9..63349514ce7 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/GeneralOrderingHorizontalFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/GeneralOrderingHorizontalFigure.java
@@ -10,6 +10,7 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.timing.custom.figures;
+import org.eclipse.draw2d.Border;
import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.papyrus.uml.diagram.common.figure.node.PapyrusNodeFigure;
@@ -25,6 +26,17 @@ public class GeneralOrderingHorizontalFigure extends PapyrusNodeFigure {
setBorder(null);
}
+ /**
+ * @see org.eclipse.draw2d.Figure#setBorder(org.eclipse.draw2d.Border)
+ *
+ * @param border
+ */
+ @Override
+ public void setBorder(Border border) {
+ // there should not be a visible border on the element
+ super.setBorder(null);
+ }
+
@Override
public void paintFigure(final Graphics g) {
g.pushState();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/InteractionTimingRectangleFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/InteractionTimingRectangleFigure.java
new file mode 100755
index 00000000000..635415666db
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/InteractionTimingRectangleFigure.java
@@ -0,0 +1,104 @@
+/*****************************************************************************
+* Copyright (c) 2016 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+* Atos Origin - Initial API and implementation
+* Patrick Tessier (CEA LIST) - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.timing.custom.figures;
+
+import org.eclipse.draw2d.BorderLayout;
+import org.eclipse.draw2d.MarginBorder;
+import org.eclipse.draw2d.OrderedLayout;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.ToolbarLayout;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.PapyrusWrappingLabel;
+import org.eclipse.papyrus.uml.diagram.common.draw2d.InteractionFigure;
+import org.eclipse.papyrus.uml.diagram.common.draw2d.LeftToolbarLayout;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure;
+
+public class InteractionTimingRectangleFigure extends RoundedCompartmentFigure {
+
+ protected InteractionFigure interactionLabelContainer;
+
+ protected RectangleFigure interactionContentPane;
+
+ protected PapyrusWrappingLabel interactionLabel;
+
+ private boolean myUseLocalCoordinates = false;
+
+ /**
+ * @param marginBorder
+ *
+ */
+ public InteractionTimingRectangleFigure() {
+ setLayoutManager(new BorderLayout());
+ createContents();
+ }
+
+
+ protected void createContents() {
+ add(createHeader(), BorderLayout.TOP);
+ add(createContentPane(), BorderLayout.CENTER);
+ }
+
+ protected RectangleFigure createContentPane() {
+ interactionContentPane = new RectangleFigure();
+ // Margin allow to add message easily
+ interactionContentPane.setBorder(new MarginBorder(5, 5, 5, 5));
+ interactionContentPane.setFill(false);
+ interactionContentPane.setOutline(true);
+
+ return interactionContentPane;
+ }
+
+ protected RectangleFigure createHeader() {
+ interactionLabel = new PapyrusWrappingLabel();
+
+ interactionLabelContainer = new InteractionFigure();
+ interactionLabelContainer.setBorder(new MarginBorder(3, 3, 3, 3));
+ interactionLabelContainer.setLayoutManager(new LeftToolbarLayout());
+
+ interactionLabelContainer.add(interactionLabel);
+
+ RectangleFigure container = new RectangleFigure();
+ container.setOutline(false);
+ container.setFill(false);
+ container.setLayoutManager(new ToolbarLayout(false));
+ container.add(interactionLabelContainer, OrderedLayout.ALIGN_CENTER);
+ return container;
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ protected boolean useLocalCoordinates() {
+ return myUseLocalCoordinates;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
+ myUseLocalCoordinates = useLocalCoordinates;
+ }
+
+ /**
+ * @generated
+ */
+ public WrappingLabel getHeaderLabel() {
+ return interactionLabel;
+ }
+
+ public RectangleFigure getCompartmentFigure() {
+ return interactionContentPane;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src-gen/org/eclipse/papyrus/uml/diagram/timing/edit/parts/InteractionEditPartTN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src-gen/org/eclipse/papyrus/uml/diagram/timing/edit/parts/InteractionEditPartTN.java
index ab01d60514b..8471144d81d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src-gen/org/eclipse/papyrus/uml/diagram/timing/edit/parts/InteractionEditPartTN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src-gen/org/eclipse/papyrus/uml/diagram/timing/edit/parts/InteractionEditPartTN.java
@@ -1,13 +1,13 @@
/**
* Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
*/
package org.eclipse.papyrus.uml.diagram.timing.edit.parts;
@@ -167,7 +167,7 @@ public class InteractionEditPartTN extends NamedElementEditPart {
*/
protected boolean addFixedChild(EditPart childEditPart) {
if (childEditPart instanceof InteractionNameEditPart) {
- ((InteractionNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ ((InteractionNameEditPart) childEditPart).setLabel(getPrimaryShape().getHeaderLabel());
return true;
}
@@ -267,10 +267,10 @@ public class InteractionEditPartTN extends NamedElementEditPart {
/**
* Creates figure for this edit part.
- *
+ *
* Body of this method does not depend on settings in generation model
* so you may safely remove <i>generated</i> tag and modify it.
- *
+ *
* @generated
*/
@Override
@@ -368,4 +368,5 @@ public class InteractionEditPartTN extends NamedElementEditPart {
}
return super.getTargetEditPart(request);
}
+
}

Back to the top