diff options
author | Benoit Maggi | 2018-06-21 08:20:43 +0000 |
---|---|---|
committer | Quentin Le Menez | 2018-06-21 10:19:13 +0000 |
commit | c57b8da1274dd168fac36523d156f5872541682d (patch) | |
tree | a60264274ea97e7f146af207f84e8332d2f9a698 /plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src | |
parent | a5939d660d706c1cc5cf86083981d67e0219c5b9 (diff) | |
download | org.eclipse.papyrus-c57b8da1274dd168fac36523d156f5872541682d.tar.gz org.eclipse.papyrus-c57b8da1274dd168fac36523d156f5872541682d.tar.xz org.eclipse.papyrus-c57b8da1274dd168fac36523d156f5872541682d.zip |
Bug 536116 - [Quality] Remove deprecated SemanticAdapter
- delete SemanticAdapter in UML layer
- use the SemanticAdapter provided by infra
- remove unused import/variable
Change-Id: I78ecab2792303a2f85083eca5093d3168d70e036
Signed-off-by: Benoit Maggi <benoit.maggi@cea.fr>
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src')
9 files changed, 10 insertions, 262 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/UmlActivityDiagramForMultiEditor.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/UmlActivityDiagramForMultiEditor.java index ea4bf393c1d..644ae432c8f 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/UmlActivityDiagramForMultiEditor.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/UmlActivityDiagramForMultiEditor.java @@ -35,7 +35,7 @@ import org.eclipse.papyrus.infra.internationalization.utils.utils.LabelInternati import org.eclipse.papyrus.uml.diagram.activity.part.UMLDiagramEditor; import org.eclipse.papyrus.uml.diagram.activity.part.UMLDiagramEditorPlugin; import org.eclipse.papyrus.uml.diagram.activity.providers.UMLElementTypes; -import org.eclipse.papyrus.uml.diagram.common.commands.SemanticAdapter; +import org.eclipse.papyrus.infra.gmfdiag.common.adapter.SemanticAdapter; import org.eclipse.papyrus.uml.diagram.common.listeners.DropTargetListener; import org.eclipse.swt.dnd.TransferData; import org.eclipse.swt.graphics.Image; diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/commands/ChangeParentCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/commands/ChangeParentCommand.java index dbc35b95d99..8da4ac12ec7 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/commands/ChangeParentCommand.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/commands/ChangeParentCommand.java @@ -99,8 +99,8 @@ public class ChangeParentCommand extends AbstractTransactionalCommand { /** * Change graphical parent */ - View childView = (View) child.getAdapter(View.class); - View parentView = (View) parent.getAdapter(View.class); + View childView = child.getAdapter(View.class); + View parentView = parent.getAdapter(View.class); EObject oldParent = childView.eContainer(); if (oldParent instanceof View) { ((View) oldParent).removeChild(childView); @@ -111,10 +111,8 @@ public class ChangeParentCommand extends AbstractTransactionalCommand { parentView.insertChildAt(childView, index); } /** - * Change coordiante + * Change coordinate */ - Point childViewCoordinate = getLocation(childView); - Point parentViewCoordinate = getLocation(parentView); ViewUtil.setStructuralFeatureValue(childView, NotationPackage.eINSTANCE.getLocation_X(), Integer.valueOf(110)); ViewUtil.setStructuralFeatureValue(childView, NotationPackage.eINSTANCE.getLocation_Y(), Integer.valueOf(110)); return CommandResult.newOKCommandResult(); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/commands/CreateActionLocalConditionViewCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/commands/CreateActionLocalConditionViewCommand.java index eb59b44bf16..38b615f742f 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/commands/CreateActionLocalConditionViewCommand.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/commands/CreateActionLocalConditionViewCommand.java @@ -32,8 +32,8 @@ import org.eclipse.papyrus.infra.services.edit.service.IElementEditService; import org.eclipse.papyrus.infra.ui.util.EditorUtils; import org.eclipse.papyrus.uml.diagram.activity.edit.parts.ActivityActivityContentCompartmentEditPart; import org.eclipse.papyrus.uml.diagram.activity.providers.UMLElementTypes; -import org.eclipse.papyrus.uml.diagram.common.commands.CommonDeferredCreateConnectionViewCommand; -import org.eclipse.papyrus.uml.diagram.common.commands.SemanticAdapter; +import org.eclipse.papyrus.infra.gmfdiag.common.commands.CommonDeferredCreateConnectionViewCommand; +import org.eclipse.papyrus.infra.gmfdiag.common.adapter.SemanticAdapter; import org.eclipse.uml2.uml.Constraint; /** diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/part/CustomActivityEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/part/CustomActivityEditPart.java index 94910942801..7a174fb7b4d 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/part/CustomActivityEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/part/CustomActivityEditPart.java @@ -18,7 +18,6 @@ import org.eclipse.draw2d.geometry.Dimension; import org.eclipse.gef.EditPolicy; import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart; import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; -import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure; import org.eclipse.gmf.runtime.notation.View; import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.GetChildLayoutEditPolicy; import org.eclipse.papyrus.uml.diagram.activity.edit.parts.ActivityEditPart; diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/part/CustomActivityParameterNodeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/part/CustomActivityParameterNodeEditPart.java index 492552c5d86..bbf60f7e678 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/part/CustomActivityParameterNodeEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/part/CustomActivityParameterNodeEditPart.java @@ -17,10 +17,7 @@ import org.eclipse.draw2d.PositionConstants; import org.eclipse.draw2d.geometry.Dimension; import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart; import org.eclipse.gmf.runtime.draw2d.ui.figures.IBorderItemLocator; -import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure; -import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure; import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.RoundedRectangleNodePlateFigure; import org.eclipse.papyrus.uml.diagram.activity.edit.parts.ActivityParameterNodeEditPart; import org.eclipse.papyrus.uml.diagram.common.editparts.FloatingLabelEditPart; import org.eclipse.papyrus.uml.diagram.common.locator.RoundedRectangleLabelPositionLocator; @@ -38,28 +35,6 @@ public class CustomActivityParameterNodeEditPart extends ActivityParameterNodeEd } /** - * @see org.eclipse.papyrus.uml.diagram.activity.edit.parts.BroadcastSignalActionEditPart#createDefaultEditPolicies() - * - */ - @Override - protected void createDefaultEditPolicies() { - super.createDefaultEditPolicies(); - // installEditPolicy(EditPolicy.LAYOUT_ROLE, new GetChildLayoutEditPolicy()); - } - - /** - * @see org.eclipse.papyrus.uml.diagram.activity.edit.parts.BroadcastSignalActionEditPart#createNodePlate() - * - * @return - */ - @Override - protected NodeFigure createNodePlate() { - DefaultSizeNodeFigure result = new RoundedRectangleNodePlateFigure(-20, 40); - return super.createNodePlate();// result; - - } - - /** * @see org.eclipse.papyrus.uml.diagram.activity.edit.parts.BroadcastSignalActionEditPart#addBorderItem(org.eclipse.draw2d.IFigure, org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart) * * @param borderItemContainer diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/policies/PinLayoutEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/policies/PinLayoutEditPolicy.java index b113fcf26a3..68be7690396 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/policies/PinLayoutEditPolicy.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/policies/PinLayoutEditPolicy.java @@ -19,7 +19,6 @@ import org.eclipse.gef.Request; import org.eclipse.gef.commands.Command; import org.eclipse.gef.editpolicies.LayoutEditPolicy; import org.eclipse.gef.requests.CreateRequest; -import org.eclipse.gmf.runtime.notation.View; /** * This edit policy replaces the GMF generated edit policy for Port. @@ -31,8 +30,6 @@ public class PinLayoutEditPolicy extends LayoutEditPolicy { @Override protected EditPolicy createChildEditPolicy(EditPart child) { - View childView = (View) child.getModel(); - return new ExternalLabelPrimaryDragRoleEditPolicy(); } diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/utils/updater/AbstractActionPinUpdater.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/utils/updater/AbstractActionPinUpdater.java index c36e5b42178..baa7050313d 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/utils/updater/AbstractActionPinUpdater.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/utils/updater/AbstractActionPinUpdater.java @@ -30,9 +30,7 @@ import org.eclipse.uml2.uml.Model; import org.eclipse.uml2.uml.Package; import org.eclipse.uml2.uml.Pin; import org.eclipse.uml2.uml.PrimitiveType; -import org.eclipse.uml2.uml.SignalEvent; import org.eclipse.uml2.uml.StructuredActivityNode; -import org.eclipse.uml2.uml.Trigger; import org.eclipse.uml2.uml.Type; /** diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/AcceptEventActionFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/AcceptEventActionFigure.java index 391c21754ba..a12b89a4f5f 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/AcceptEventActionFigure.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/AcceptEventActionFigure.java @@ -27,44 +27,18 @@ import org.eclipse.swt.graphics.Image; public class AcceptEventActionFigure extends RoundedCompartmentFigure { - /** - * this label is internal to the figure and represents the name of the acceptEventAction - */ - // private CenteredWrappedLabel fAcceptEventActionLabel; - - // private final Insets marginTemplate; /** The helper which handles stereotype aspects */ private StereotypeFigureHelper stereotypeHelper; public AcceptEventActionFigure() { - // CenteredColumnLayout layoutThis = new CenteredColumnLayout(); - // this.setLayoutManager(layoutThis); - // this.addPoint(new Point(0, 0)); - // this.addPoint(new Point(200, 0)); - // this.addPoint(new Point(200, 50)); - // this.addPoint(new Point(0, 50)); - // this.addPoint(new Point(50, 25)); - // // add time template - // this.addTimePoint(new Point(0, 0)); - // this.addTimePoint(new Point(100, 0)); - // this.addTimePoint(new Point(50, 25)); - // this.addTimePoint(new Point(100, 50)); - // this.addTimePoint(new Point(0, 50)); - // this.addTimePoint(new Point(50, 25)); - // this.setFill(true); - // this.setLineWidth(1); - // make margin border relative - // marginTemplate = new Insets(0, 50, 0, 0); - // this.setBorder(new MarginBorder(marginTemplate)); createContents(); // use StereotypeFigureHelper stereotypeHelper = new StereotypeFigureHelper(this) { @Override public Object getStereotypeRectangleConstraint() { - CenteredColumnConstraint constraintStereotypeRect0 = new CenteredColumnConstraint(false); - return constraintStereotypeRect0; + return new CenteredColumnConstraint(false); } }; } @@ -73,33 +47,8 @@ public class AcceptEventActionFigure extends RoundedCompartmentFigure { * This method is used to create the content into the figure, in our case this is the label of the acceptEventAction */ private void createContents() { - // RectangleFigure labelRect0 = new RectangleFigure(); - // labelRect0.setFill(false); - // labelRect0.setOutline(false); - // labelRect0.setLineWidth(1); - // // use CenteredColumnConstraint - // CenteredColumnConstraint constraintLabelRect0 = new CenteredColumnConstraint(true); - // this.add(labelRect0, constraintLabelRect0); - // CenterLayout layoutLabelRect0 = new CenterLayout(); - // labelRect0.setLayoutManager(layoutLabelRect0); - // fAcceptEventActionLabel = new CenteredWrappedLabel(); - // fAcceptEventActionLabel.setBorder(new MarginBorder(5, 5, 5, 5)); - // this.add(fAcceptEventActionLabel); } - // - // - // private final PointList myTemplate = new PointList(); - // - // - // private Rectangle myTemplateBounds; - - // - // @Override - // public void addPoint(Point point) { - // myTemplate.addPoint(point); - // myTemplateBounds = null; - // } /** * Refresh the layout of the figure @@ -171,27 +120,9 @@ public class AcceptEventActionFigure extends RoundedCompartmentFigure { stereotypePropertiesInCompartment = stereotypeProperties; } - /** - * Gets the stereotype label. - * - * @return the stereotype label - * @unused - * @deprecated - */ - // @Override - // @Deprecated - // public Label getStereotypesLabel() { - // return null;// fActionStereotypeLabel; - // } + private final PointList myTempslateTime = new PointList(); - /** - * @generated - */ - private final PointList myTemplateTime = new PointList(); - /** - * @generated - */ private boolean useTemplateTime = false; /** @@ -226,153 +157,4 @@ public class AcceptEventActionFigure extends RoundedCompartmentFigure { return useTemplateTime; } - // private Rectangle myTemplateTimeBounds; - - // public void addTimePoint(Point point) { - // myTemplateTime.addPoint(point); - // myTemplateTimeBounds = null; - // } - - // - // @Override - // protected void fillShape(Graphics graphics) { - // Rectangle bounds = getBounds(); - // graphics.pushState(); - // graphics.translate(bounds.x, bounds.y); - // graphics.fillPolygon(scalePointList()); - // graphics.popState(); - // // refresh relative margin - // Insets newInsets = scaleMargin(); - // if (!newInsets.equals(getBorder().getInsets(this))) { - // this.setBorder(new MarginBorder(scaleMargin())); - // } - // } - - // @Override - // protected void outlineShape(Graphics graphics) { - // Rectangle bounds = getBounds(); - // graphics.pushState(); - // graphics.translate(bounds.x, bounds.y); - // graphics.setLineWidth(Math.max(1, getLineWidth())); - // graphics.drawPolygon(scalePointList()); - // graphics.popState(); - // } - - // private Insets scaleMargin() { - // Rectangle pointsBounds = getTemplateBounds(); - // Rectangle actualBounds = getBounds(); - // float xScale = ((float) actualBounds.width) / pointsBounds.width; - // float yScale = ((float) actualBounds.height) / pointsBounds.height; - // if (xScale == 1 && yScale == 1) { - // return marginTemplate; - // } - // Insets scaled = new Insets(marginTemplate); - // scaled.top = (int) Math.floor(scaled.top * yScale); - // scaled.left = (int) Math.floor(scaled.left * xScale); - // scaled.bottom = (int) Math.floor(scaled.bottom * yScale); - // scaled.right = (int) Math.floor(scaled.right * xScale); - // return scaled; - // } - - // /** - // * switch between the two templates - // */ - // private Rectangle getTemplateBounds() { - // if (myTemplateBounds == null) { - // myTemplateBounds = myTemplate.getBounds().getCopy().union(0, 0); - // // just safety -- we are going to use this as divider - // if (myTemplateBounds.width < 1) { - // myTemplateBounds.width = 1; - // } - // if (myTemplateBounds.height < 1) { - // myTemplateBounds.height = 1; - // } - // } - // // switch between the two templates : create the second template bounds - // if (myTemplateTimeBounds == null) { - // myTemplateTimeBounds = myTemplateTime.getBounds().getCopy().union(0, 0); - // // just safety -- we are going to use this as divider - // if (myTemplateTimeBounds.width < 1) { - // myTemplateTimeBounds.width = 1; - // } - // if (myTemplateTimeBounds.height < 1) { - // myTemplateTimeBounds.height = 1; - // } - // } - // // switch between the two templates : choose appropriate one - // if (useTemplateTime) { - // return myTemplateTimeBounds; - // } else { - // return myTemplateBounds; - // } - // } - - // private int[] scalePointList() { - // Rectangle pointsBounds = getTemplateBounds(); - // Rectangle actualBounds = getBounds(); - // float xScale = ((float) actualBounds.width) / pointsBounds.width; - // float yScale = ((float) actualBounds.height) / pointsBounds.height; - // if (xScale == 1 && yScale == 1) { - // // switch between the two templates - // if (useTemplateTime) { - // return myTemplateTime.toIntArray(); - // } else { - // return myTemplate.toIntArray(); - // } - // } - // // switch between the two templates - // int[] scaled; - // if (useTemplateTime) { - // scaled = myTemplateTime.toIntArray().clone(); - // } else { - // scaled = myTemplate.toIntArray().clone(); - // } - // for (int i = 0; i < scaled.length; i += 2) { - // scaled[i] = (int) Math.floor(scaled[i] * xScale); - // scaled[i + 1] = (int) Math.floor(scaled[i + 1] * yScale); - // } - // return scaled; - // } - - // /** - // * @generated - // */ - // public CenteredWrappedLabel getAcceptEventActionLabel() { - // return fAcceptEventActionLabel; - // // return getNameLabel(); - // } - - // @Override - // public Color getBorderColor() { - // return null; - // } - // - // @Override - // public boolean isShadow() { - // return false; - // } - // - // @Override - // public void setBorderColor(Color borderColor) { - // - // } - // - // @Override - // public void setShadow(boolean shadow) { - // - // } - // - // @Override - // public void setTransparency(int transparency) { - // - // } - // - // @Override - // public void setGradientData(int gradientColor1, int gradientColor2, int gradientStyle) { - // } - // - // @Override - // public void setIsUsingGradient(boolean b) { - // - // } } diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/InterruptibleActivityRegionFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/InterruptibleActivityRegionFigure.java index 90ca5f9e716..a986c08c241 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/InterruptibleActivityRegionFigure.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/InterruptibleActivityRegionFigure.java @@ -36,7 +36,7 @@ import org.eclipse.papyrus.infra.gmfdiag.common.utils.FigureUtils; import org.eclipse.papyrus.uml.diagram.common.figure.node.AutomaticCompartmentLayoutManager; import org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusNodeUMLElementFigure; import org.eclipse.papyrus.uml.diagram.common.figure.node.PapyrusNodeFigure; -import org.eclipse.papyrus.uml.diagram.common.figure.node.SubCompartmentLayoutManager; +import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.SubCompartmentLayoutManager; import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Pattern; @@ -174,11 +174,10 @@ public class InterruptibleActivityRegionFigure extends PapyrusNodeFigure impleme * the compartment figure */ protected void createContentPane(List<String> compartmentFigure) { - containerFigures = new HashMap<String, RectangleFigure>(); + containerFigures = new HashMap<>(); for (String id : compartmentFigure) { RectangleFigure newFigure = new RectangleFigure(); newFigure.setLayoutManager(new SubCompartmentLayoutManager()); - // to debug graphically: newFigure.setFill(true); newFigure.setFill(false); newFigure.setBorder(null); newFigure.setOutline(false); |