diff options
Diffstat (limited to 'plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org')
18 files changed, 0 insertions, 1182 deletions
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/Messages.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/Messages.java deleted file mode 100644 index 17b09d4509d..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/Messages.java +++ /dev/null @@ -1,63 +0,0 @@ -/*****************************************************************************
- * Copyright (c) 2009 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:
- * Hubert Dubois (CEA LIST) hubert.dubois@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.requirement;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * @generated
- */
-public class Messages extends NLS {
-
- /**
- * @generated
- */
- public static String Diagram_Name;
-
- /**
- * @generated
- */
- public static String Problem_Opening;
-
- /**
- * @generated
- */
- public static String Cannot_Open_Input_Element;
-
- /**
- * @generated
- */
- public static String No_EditPart_Can_Be_Created;
-
- /**
- * @generated
- */
- public static String No_View_Can_Be_Created;
-
- /**
- * @generated
- */
- static {
- NLS.initializeMessages("messages", Messages.class);
- }
-
- // TODO: put accessor fields manually
-
- /**
- * @generated
- */
- private Messages() {
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/RequirementDiagramCreationCondition.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/RequirementDiagramCreationCondition.java deleted file mode 100644 index dcc3159edf8..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/RequirementDiagramCreationCondition.java +++ /dev/null @@ -1,32 +0,0 @@ -/*****************************************************************************
- * Copyright (c) 2009 Atos Origin.
- *
- *
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- * Laurent Wouters (CEA LIST) laurent.wouters@cea.fr - Viewpoints application
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.requirement;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.papyrus.infra.ui.extension.commands.PerspectiveContextDependence;
-
-/**
- * RequirementDiagramCondition to set conditions for the diagram creation
- */
-public class RequirementDiagramCreationCondition extends PerspectiveContextDependence {
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean create(EObject selectedElement) {
- return false;
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/edit/part/CustomAbstractRequirementInformationLabelEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/edit/part/CustomAbstractRequirementInformationLabelEditPart.java deleted file mode 100644 index fce18347ab4..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/edit/part/CustomAbstractRequirementInformationLabelEditPart.java +++ /dev/null @@ -1,95 +0,0 @@ -/*****************************************************************************
- * Copyright (c) 2012 ATOS.
- *
- *
- * 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:
- * Olivier Mélois (ATOS) - Initial API and implementation
- *
- ******************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.requirement.edit.part;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.sysml.diagram.requirement.edit.policy.CustomRequirementInfoLabelUpdateEditPolicy;
-import org.eclipse.papyrus.sysml.requirements.Requirement;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.uml2.uml.Element;
-
-public abstract class CustomAbstractRequirementInformationLabelEditPart extends LabelEditPart {
-
- Requirement requirement;
-
- public CustomAbstractRequirementInformationLabelEditPart(View view) {
- super(view);
- }
-
- @Override
- protected void createDefaultEditPolicies() {
-
- /*
- * edit policy used to refresh the labels when the stereotype application "Requirement" is updated.
- */
- installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new CustomRequirementInfoLabelUpdateEditPolicy());
- super.createDefaultEditPolicies();
- // Removing useless edit policies installed by superclasses.
- removeEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- removeEditPolicy(EditPolicy.COMPONENT_ROLE);
- }
-
- @Override
- protected IFigure createFigure() {
- IFigure figure = new WrappingLabel();
- ((WrappingLabel) figure).setTextWrap(true);
- figure.setFont(Display.getDefault().getSystemFont());
- return figure;
- }
-
- @Override
- public IFigure getFigure() {
- IFigure figure = super.getFigure();
- refreshLabelText();
- return figure;
- }
-
- public abstract void refreshLabelText();
-
- /**
- * Refreshes the text of the label.
- */
- @Override
- public void refresh() {
- this.refreshLabelText();
- super.refresh();
- }
-
- /**
- * Gets the requirement associated to this edit part.
- */
- protected Requirement getRequirement() {
- EditPart compartment = this.getParent();
- EditPart classEditPart = compartment.getParent();
- // Getting the class out of the edit part.
- Element clazz = (Element) ((View) classEditPart.getModel()).getElement();
- // Getting the requirement out of the class.
- if (clazz != null) {
- for (EObject appliedStereotype : clazz.getStereotypeApplications()) {
- if (appliedStereotype instanceof Requirement) {
- return ((Requirement) appliedStereotype);
- }
- }
- }
- return null;
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/edit/part/CustomRequirementEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/edit/part/CustomRequirementEditPart.java deleted file mode 100644 index fc917caf9bb..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/edit/part/CustomRequirementEditPart.java +++ /dev/null @@ -1,88 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 ATOS. - * - * - * 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: - * Olivier Mélois (ATOS) - Initial API and implementation - * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Bug 496905 - * - ******************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.requirement.edit.part; - -import org.eclipse.draw2d.IFigure; -import org.eclipse.gef.EditPart; -import org.eclipse.gef.Request; -import org.eclipse.gef.commands.Command; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.papyrus.sysml.diagram.requirement.figure.CustomRequirementFigure; -import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ClassEditPart; -import org.eclipse.papyrus.uml.diagram.common.commands.ShowHideCompartmentRequest; -import org.eclipse.papyrus.uml.internationalization.utils.utils.UMLLabelInternationalization; -import org.eclipse.uml2.uml.NamedElement; - -public class CustomRequirementEditPart extends ClassEditPart { - - //protected static final String ICONS_PATH = "/org.eclipse.papyrus.sysml/icons/requirements/Requirement.gif"; //$NON-NLS-1$ - - public CustomRequirementEditPart(View view) { - super(view); - } - - - @Override - protected IFigure createNodeShape() { - // Showing the information compartment. - View notationView = getNotationView(); - Request request = new ShowHideCompartmentRequest(ShowHideCompartmentRequest.SHOW, notationView); - request.setType(ShowHideCompartmentRequest.SHOW_HIDE_COMPARTMENT); - Command showCompartmentCommand = this.getCommand(request); - getEditDomain().getCommandStack().execute(showCompartmentCommand); - - primaryShape = new CustomRequirementFigure(); - // ((CustomRequirementFigure)primaryShape).setTagIcon(Activator.getPluginIconImage(Activator.ID, ICONS_PATH)); - return primaryShape; - } - - public void refreshTitle() { - NamedElement clazz = (NamedElement) ((View) this.getModel()).getElement(); - String requirementName = UMLLabelInternationalization.getInstance().getLabel(clazz); - ((CustomRequirementFigure) this.getFigure()).setName(requirementName); - } - - @Override - protected boolean addFixedChild(EditPart childEditPart) { - if (childEditPart instanceof CustomRequirementInformationCompartmentEditPart) { - IFigure pane = ((CustomRequirementFigure) getPrimaryShape()).getRequirementIdInformationCompartmentFigure(); - setupContentPane(pane); // FIXME each compartment should handle his content pane in his own way - pane.add(((CustomRequirementInformationCompartmentEditPart) childEditPart).getFigure()); - return true; - } - return super.addFixedChild(childEditPart); - } - - @Override - protected boolean removeFixedChild(EditPart childEditPart) { - if (childEditPart instanceof CustomRequirementInformationCompartmentEditPart) { - IFigure pane = ((CustomRequirementFigure) getPrimaryShape()).getRequirementIdInformationCompartmentFigure(); - setupContentPane(pane); // FIXME each compartment should handle his content pane in his own way - pane.remove(((CustomRequirementInformationCompartmentEditPart) childEditPart).getFigure()); - return true; - } - return super.removeFixedChild(childEditPart); - } - - @Override - public IFigure getContentPaneFor(IGraphicalEditPart editPart) { - if (editPart instanceof CustomRequirementInformationCompartmentEditPart) { - return ((CustomRequirementFigure) getPrimaryShape()).getRequirementIdInformationCompartmentFigure(); - } - return super.getContentPaneFor(editPart); - } - -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/edit/part/CustomRequirementIdLabelEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/edit/part/CustomRequirementIdLabelEditPart.java deleted file mode 100644 index eee3e13b79c..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/edit/part/CustomRequirementIdLabelEditPart.java +++ /dev/null @@ -1,42 +0,0 @@ -/*****************************************************************************
- * Copyright (c) 2012 ATOS.
- *
- *
- * 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:
- * Olivier Mélois (ATOS) - Initial API and implementation
- *
- ******************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.requirement.edit.part;
-
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.sysml.requirements.Requirement;
-
-/**
- * Label used to display the id of a requirement
- */
-public class CustomRequirementIdLabelEditPart extends CustomAbstractRequirementInformationLabelEditPart {
-
- public CustomRequirementIdLabelEditPart(View view) {
- super(view);
- }
-
- @Override
- public void refreshLabelText() {
- if (this.figure != null && this.getRequirement() != null) {
- WrappingLabel wrappingLabel = (WrappingLabel) figure;
- Requirement req = this.getRequirement();
- String id = req.getId();
- if (id == null) {
- id = ""; //$NON-NLS-1$
- }
- wrappingLabel.setText("id = \"" + id + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/edit/part/CustomRequirementInformationCompartmentEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/edit/part/CustomRequirementInformationCompartmentEditPart.java deleted file mode 100644 index e4ee08a1f7f..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/edit/part/CustomRequirementInformationCompartmentEditPart.java +++ /dev/null @@ -1,98 +0,0 @@ -/*****************************************************************************
- * Copyright (c) 2012 ATOS.
- *
- *
- * 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:
- * Olivier Mélois (ATOS) - Initial API and implementation
- *
- ******************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.requirement.edit.part;
-
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableCompartmentEditPolicy;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpart.ResizeableListCompartmentEditPart;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultCompartmentSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.PasteEditPolicy;
-
-/**
- * Compartment used to display the id and the text of the requirement.
- * The actual display of these information is performed by
- * RequirementIdLabelEditPart and RequirementTextLabelEditPart
- *
- */
-public class CustomRequirementInformationCompartmentEditPart extends ResizeableListCompartmentEditPart {
-
- public static final String COMPARTMENT_NAME = "InformationCompartment"; //$NON-NLS-1$
-
- public CustomRequirementInformationCompartmentEditPart(EObject model) {
- super(model);
- }
-
- @Override
- protected boolean hasModelChildrenChanged(Notification evt) {
- return false;
- }
-
- @Override
- public String getCompartmentName() {
- return COMPARTMENT_NAME;
- }
-
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ResizableCompartmentEditPolicy());
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultCompartmentSemanticEditPolicy());
- installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicy());
- installEditPolicy(PasteEditPolicy.PASTE_ROLE, new PasteEditPolicy());
- }
-
- @Override
- protected void setRatio(Double ratio) {
- if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
- super.setRatio(ratio);
- }
- }
-
- @Override
- protected void handleNotificationEvent(Notification notification) {
- Object feature = notification.getFeature();
- if (NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
- refreshBounds();
- }
- super.handleNotificationEvent(notification);
- }
-
- @Override
- protected void refreshBounds() {
- int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
- Dimension size = new Dimension(width, height);
- int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
- Point loc = new Point(x, y);
- ((GraphicalEditPart) getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
- }
-
- @Override
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshBounds();
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/edit/part/CustomRequirementNameEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/edit/part/CustomRequirementNameEditPart.java deleted file mode 100644 index da5a3de1894..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/edit/part/CustomRequirementNameEditPart.java +++ /dev/null @@ -1,48 +0,0 @@ -/*****************************************************************************
- * Copyright (c) 2011 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
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.requirement.edit.part;
-
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.emf.appearance.helper.AppearanceHelper;
-import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ClassNameEditPart;
-import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil;
-import org.eclipse.swt.graphics.Image;
-
-public class CustomRequirementNameEditPart extends ClassNameEditPart { // NamedElementNodeLabelNameEditPart {
-
- /** Constructor */
- public CustomRequirementNameEditPart(View view) {
- super(view);
- }
-
- @Override
- protected Image getLabelIcon() {
- EObject parserElement = getParserElement();
- if (parserElement == null) {
- return null;
- }
-
- List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for (View view : views) {
- if (AppearanceHelper.showElementIcon(view)) {
- return org.eclipse.papyrus.sysml.diagram.common.Activator.getInstance().getLabelProvider().getImage(parserElement);
- }
- }
- return null;
-
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/edit/part/CustomRequirementTextLabelEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/edit/part/CustomRequirementTextLabelEditPart.java deleted file mode 100644 index c89c739bb41..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/edit/part/CustomRequirementTextLabelEditPart.java +++ /dev/null @@ -1,42 +0,0 @@ -/*****************************************************************************
- * Copyright (c) 2012 ATOS.
- *
- *
- * 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:
- * Olivier Mélois (ATOS) - Initial API and implementation
- *
- ******************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.requirement.edit.part;
-
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.sysml.requirements.Requirement;
-
-/**
- * Label used to display the text of a requirement
- */
-public class CustomRequirementTextLabelEditPart extends CustomAbstractRequirementInformationLabelEditPart {
-
- public CustomRequirementTextLabelEditPart(View view) {
- super(view);
- }
-
- @Override
- public void refreshLabelText() {
- if (this.figure != null && this.getRequirement() != null) {
- WrappingLabel wrappingLabel = (WrappingLabel) figure;
- Requirement req = this.getRequirement();
- String text = req.getText();
- if (text == null) {
- text = ""; //$NON-NLS-1$
- }
- wrappingLabel.setText("text = \"" + text + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/edit/policy/CustomAppliedStereotypeLabelDisplayEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/edit/policy/CustomAppliedStereotypeLabelDisplayEditPolicy.java deleted file mode 100644 index 889e1765ea1..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/edit/policy/CustomAppliedStereotypeLabelDisplayEditPolicy.java +++ /dev/null @@ -1,30 +0,0 @@ -/*****************************************************************************
- * Copyright (c) 2012 ATOS.
- *
- *
- * 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:
- * Olivier Mélois (Atos) olivier.melois@atos.net - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.sysml.diagram.requirement.edit.policy;
-
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy;
-
-/**
- * Edit policy responsible of the display of stereotypes. It does not rely
- * on commands to get the stereotypes (the computation of the text was
- * formerly processed by commands executed when the object was dragged
- * from a palette, from instance).
- *
- * @author omelois
- */
-public class CustomAppliedStereotypeLabelDisplayEditPolicy extends AppliedStereotypeNodeLabelDisplayEditPolicy {
-
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/edit/policy/CustomDragDropEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/edit/policy/CustomDragDropEditPolicy.java deleted file mode 100644 index a5a4a9c367a..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/edit/policy/CustomDragDropEditPolicy.java +++ /dev/null @@ -1,123 +0,0 @@ -/*****************************************************************************
- * Copyright (c) 2013 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:
- * Nizar GUEDIDI (CEA LIST) - Initial API and implementation
- /*****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.requirement.edit.policy;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.sysml.diagram.requirement.provider.ElementTypes;
-import org.eclipse.papyrus.sysml.util.SysmlResource;
-import org.eclipse.uml2.uml.Abstraction;
-import org.eclipse.uml2.uml.Comment;
-import org.eclipse.uml2.uml.Constraint;
-import org.eclipse.uml2.uml.Dependency;
-import org.eclipse.uml2.uml.PackageImport;
-import org.eclipse.uml2.uml.Realization;
-
-public class CustomDragDropEditPolicy extends RequirementDiagramDragDropEditPolicy {
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected Set<String> getDroppableElementVisualId() {
- Set<String> droppableElementsVisualID = new HashSet<String>();
- return droppableElementsVisualID;
- }
-
- @Override
- public String getNodeVisualID(View containerView, EObject domainElement) {
- String semanticHint = null;
-
- // Fill the semantic hint during the drop when the top level is the Requirement Diagram
- if (containerView instanceof Diagram) {
- if (domainElement instanceof org.eclipse.uml2.uml.Package) {
- semanticHint = ElementTypes.PACKAGE.getSemanticHint();
- }
- if ((domainElement instanceof org.eclipse.uml2.uml.Class)) {
- org.eclipse.uml2.uml.Class domainElementClass = (org.eclipse.uml2.uml.Class) domainElement;
- if (domainElementClass.getAppliedStereotype(SysmlResource.REQUIREMENT_ID) != null) {
- semanticHint = ElementTypes.CLASS.getSemanticHint();
- }
- }
-
- if (domainElement instanceof Comment) {
- semanticHint = ElementTypes.COMMENT.getSemanticHint();
- }
-
- if (domainElement instanceof Constraint) {
- semanticHint = ElementTypes.CONSTRAINT.getSemanticHint();
- }
-
- }
-
- // Fill the semantic hint during the drop when the top level is the an element in the Requirement Diagram (a Package for instance)
- else {
- if (domainElement instanceof org.eclipse.uml2.uml.Package) {
- semanticHint = ElementTypes.PACKAGE_CN.getSemanticHint();
- }
- if ((domainElement instanceof org.eclipse.uml2.uml.Class)) {
- org.eclipse.uml2.uml.Class domainElementClass = (org.eclipse.uml2.uml.Class) domainElement;
- if (domainElementClass.getAppliedStereotype(SysmlResource.REQUIREMENT_ID) != null) {
- semanticHint = ElementTypes.CLASS_CN.getSemanticHint();
- }
- }
-
- if (domainElement instanceof Comment) {
- semanticHint = ElementTypes.COMMENT_CN.getSemanticHint();
- }
-
- if (domainElement instanceof Constraint) {
- semanticHint = ElementTypes.CONSTRAINT_CN.getSemanticHint();
- }
-
- }
-
- // In the case of we want to Drag and drop something else than a package or a Requirement, if this is a NamedElement,
- // we can fill the semanticHint with the NamedElement dedicated Value
- if (semanticHint == null) {
- if ((domainElement instanceof org.eclipse.uml2.uml.NamedElement)) {
- semanticHint = ElementTypes.DEFAULT_NAMED_ELEMENT.getSemanticHint();
- }
- }
-
- return semanticHint;
- }
-
- @Override
- public String getLinkWithClassVisualID(EObject domainElement) {
- String semanticHint = null;
-
- if (domainElement instanceof Abstraction) {
- semanticHint = ElementTypes.ABSTRACTION.getSemanticHint();
- }
-
- if (domainElement instanceof Dependency) {
- semanticHint = ElementTypes.DEPENDENCY.getSemanticHint();
- }
-
- if (domainElement instanceof PackageImport) {
- semanticHint = ElementTypes.PACKAGE_IMPORT.getSemanticHint();
- }
- if (domainElement instanceof Realization) {
- semanticHint = ElementTypes.REALIZATION.getSemanticHint();
- }
-
- return semanticHint;
-
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/edit/policy/CustomRequirementInfoLabelUpdateEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/edit/policy/CustomRequirementInfoLabelUpdateEditPolicy.java deleted file mode 100644 index e0fe59b85f1..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/edit/policy/CustomRequirementInfoLabelUpdateEditPolicy.java +++ /dev/null @@ -1,49 +0,0 @@ -/*****************************************************************************
- * Copyright (c) 2012 ATOS.
- *
- *
- * 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:
- * Olivier Mélois (ATOS) - Initial API and implementation
- *
- ******************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.requirement.edit.policy;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.AbstractAppliedStereotypeDisplayEditPolicy;
-import org.eclipse.uml2.uml.Element;
-
-/**
- * Edit policy used to refresh the label that display the id and the text of a requirement.
- *
- */
-public class CustomRequirementInfoLabelUpdateEditPolicy extends AbstractAppliedStereotypeDisplayEditPolicy {
-
-
- @Override
- protected Element getUMLElement() {
- EditPart host = this.getHost();
- // Reminder : the label is in the compartment, which is in the class edit part.
- EditPart compartment = host.getParent();
- EditPart classEditPart = compartment.getParent();
- // Getting the class out of the edit part.
- Element clazz = (Element) ((View) classEditPart.getModel()).getElement();
- return clazz;
- }
-
- /**
- * @see org.eclipse.papyrus.uml.diagram.common.editpolicies.AbstractAppliedStereotypeDisplayEditPolicy#refreshDisplay()
- *
- */
- @Override
- public void refreshDisplay() {
- // Do nothing
-
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/factory/CustomRequirementUMLEditPartFactory.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/factory/CustomRequirementUMLEditPartFactory.java deleted file mode 100644 index bcdfd68727e..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/factory/CustomRequirementUMLEditPartFactory.java +++ /dev/null @@ -1,44 +0,0 @@ -/*****************************************************************************
- * Copyright (c) 2009 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:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.requirement.factory;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.sysml.diagram.requirement.edit.part.CustomRequirementNameEditPart;
-import org.eclipse.papyrus.uml.diagram.clazz.custom.factory.CustomUMLEditPartFactory;
-import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ClassNameEditPart;
-import org.eclipse.papyrus.uml.diagram.clazz.part.UMLVisualIDRegistry;
-
-/**
- * this is custom editpart factory to create our own editpart
- */
-public class CustomRequirementUMLEditPartFactory extends CustomUMLEditPartFactory {
-
- @Override
- public EditPart createEditPart(EditPart context, Object model) {
- if (model instanceof View) {
- View view = (View) model;
- String visualID = UMLVisualIDRegistry.getVisualID(view);
-
- if (visualID != null) {
- switch (visualID) {
- // redefined classes to modify the method createNodePlate
- case ClassNameEditPart.VISUAL_ID:
- return new CustomRequirementNameEditPart(view);
- }
- }
- }
- return super.createEditPart(context, model);
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/figure/CustomRequirementFigure.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/figure/CustomRequirementFigure.java deleted file mode 100644 index 663628fda0e..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/figure/CustomRequirementFigure.java +++ /dev/null @@ -1,57 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 ATOS. - * - * - * 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: - * Olivier Mélois (ATOS) - Initial API and implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.requirement.figure; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.draw2d.IFigure; -import org.eclipse.papyrus.uml.diagram.common.figure.node.ClassFigure; -import org.eclipse.papyrus.uml.diagram.common.figure.node.ClassifierFigure; - -public class CustomRequirementFigure extends ClassFigure { - - /** The Attribute Compartment */ - private final static String ATTRIBUTE_COMPARTMENT = "attributeCompartment"; - - /** The Operation Compartment */ - private final static String OPERATION_COMPARTMENT = "operationCompartment"; - - /** The NestedClassifier Compartment */ - private final static String NESTEDCLASSIFIER_COMPARTMENT = "nestedClassifierCompartment"; - - /** The RequirementIdInformation Compartment */ - private final static String REQUIREMENT_ID_INFO_COMPARTMENT = "requirementIdInformationCompartment"; - - /** The List of Compartment */ - private final static List<String> COMPARTMENT = new ArrayList<String>() { - - private static final long serialVersionUID = 1L; - { - add(ATTRIBUTE_COMPARTMENT); - add(OPERATION_COMPARTMENT); - add(NESTEDCLASSIFIER_COMPARTMENT); - add(REQUIREMENT_ID_INFO_COMPARTMENT); - } - }; - - public CustomRequirementFigure() { - super(); - createContentPane(COMPARTMENT); - } - - public IFigure getRequirementIdInformationCompartmentFigure() { - return getCompartment(REQUIREMENT_ID_INFO_COMPARTMENT); - } -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/provider/CUMLEditPartProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/provider/CUMLEditPartProvider.java deleted file mode 100644 index 1f940b5fa18..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/provider/CUMLEditPartProvider.java +++ /dev/null @@ -1,25 +0,0 @@ -/*****************************************************************************
- * Copyright (c) 2013 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:
- * Nizar GUEDIDI (CEA LIST) - Initial API and implementation
- /*****************************************************************************/
-
-package org.eclipse.papyrus.sysml.diagram.requirement.provider;
-
-import org.eclipse.papyrus.sysml.diagram.requirement.factory.CustomRequirementUMLEditPartFactory;
-import org.eclipse.papyrus.uml.diagram.clazz.providers.UMLEditPartProvider;
-
-public class CUMLEditPartProvider extends UMLEditPartProvider {
-
- public CUMLEditPartProvider() {
- setFactory(new CustomRequirementUMLEditPartFactory());
- setAllowCaching(true);
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/provider/CustomEditPolicyProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/provider/CustomEditPolicyProvider.java deleted file mode 100644 index 6b898bf2b87..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/provider/CustomEditPolicyProvider.java +++ /dev/null @@ -1,50 +0,0 @@ -/*****************************************************************************
- * Copyright (c) 2010 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
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.requirement.provider;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.common.core.service.IOperation;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.services.editpolicy.CreateEditPoliciesOperation;
-import org.eclipse.papyrus.sysml.diagram.requirement.edit.policy.CustomDragDropEditPolicy;
-import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.PackagePackageableElementCompartmentEditPart;
-import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.PackagePackageableElementCompartmentEditPartCN;
-
-/**
- * Requirement Diagram edit policy provider
- */
-public class CustomEditPolicyProvider extends RequirementDiagramEditPolicyProvider {
-
- @Override
- public boolean provides(IOperation operation) {
- CreateEditPoliciesOperation epOperation = (CreateEditPoliciesOperation) operation;
- if (!(epOperation.getEditPart() instanceof GraphicalEditPart)) {
- return false;
- }
- GraphicalEditPart gep = (GraphicalEditPart) epOperation.getEditPart();
- String diagramType = gep.getNotationView().getDiagram().getType();
- if (!ElementTypes.DIAGRAM_ID.equals(diagramType)) {
- return false;
- }
-
- if ((gep instanceof PackagePackageableElementCompartmentEditPart) || (gep instanceof PackagePackageableElementCompartmentEditPartCN)) {
- return true;
- }
-
- return false;
- }
-
- @Override
- public void createEditPolicies(EditPart editPart) {
- editPart.installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDragDropEditPolicy());
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/provider/CustomInheritedElementViewProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/provider/CustomInheritedElementViewProvider.java deleted file mode 100644 index a66cfc04b93..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/provider/CustomInheritedElementViewProvider.java +++ /dev/null @@ -1,199 +0,0 @@ -/*****************************************************************************
- * Copyright (c) 2017 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
- *
- * Mickaël ADAM (ALL4TEC) mickael.adam@all4tec.net - Bug 510587
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.requirement.provider;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
-import org.eclipse.gmf.runtime.diagram.core.services.view.CreateEdgeViewOperation;
-import org.eclipse.gmf.runtime.diagram.core.services.view.CreateNodeViewOperation;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.notation.Edge;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.NotationFactory;
-import org.eclipse.gmf.runtime.notation.Shape;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
-import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
-import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ClassAttributeCompartmentEditPart;
-import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ClassNameEditPart;
-import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ClassNestedClassifierCompartmentEditPart;
-import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ClassOperationCompartmentEditPart;
-import org.eclipse.papyrus.uml.diagram.clazz.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper;
-
-/**
- * SysML Requirement diagram inherited elements view providers from UML Class diagram view providers
- *
- */
-public class CustomInheritedElementViewProvider extends InheritedClassDiagramViewProvider {
-
- public CustomInheritedElementViewProvider() {
- super();
- }
-
- /**
- *
- * @see org.eclipse.papyrus.sysml.diagram.requirement.provider.InheritedClassDiagramViewProvider#provides(org.eclipse.gmf.runtime.diagram.core.services.view.CreateNodeViewOperation)
- */
- @Override
- protected boolean provides(final CreateNodeViewOperation operation) {
- boolean provides = false;
-
- // Must have a container
- if (operation.getContainerView() != null) {
-
- // This provider is registered for Requirement Diagram only
- String diagramType = operation.getContainerView().getDiagram().getType();
- if (ElementTypes.DIAGRAM_ID.equals(diagramType)) {
-
- // Get the type of the container
- String containerGraphicalType = operation.getContainerView().getType();
- if (ElementTypes.DIAGRAM_ID.equals(containerGraphicalType)) {
-
- // get the type
- IElementType elementType = (IElementType) operation.getSemanticAdapter().getAdapter(IElementType.class);
- if (SysMLElementTypes.REQUIREMENT == elementType
- || SysMLElementTypes.PROBLEM == elementType
- || SysMLElementTypes.RATIONALE == elementType) {
- provides = true;
- }
- }
- }
- }
- return provides || super.provides(operation);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.papyrus.sysml.diagram.requirement.provider.InheritedClassDiagramViewProvider#provides(org.eclipse.gmf.runtime.diagram.core.services.view.CreateEdgeViewOperation)
- */
- @Override
- protected boolean provides(final CreateEdgeViewOperation operation) {
- boolean provides = false;
-
- // Must have a container
- if (operation.getContainerView() != null) {
-
- String diagramType = operation.getContainerView().getDiagram().getType();
- if (ElementTypes.DIAGRAM_ID.equals(diagramType)) {
-
- // get the type
- IElementType elementType = (IElementType) operation.getSemanticAdapter().getAdapter(IElementType.class);
- if (SysMLElementTypes.COPY == elementType
- || SysMLElementTypes.DERIVE_REQT == elementType
- || SysMLElementTypes.SATISFY == elementType
- || SysMLElementTypes.VERIFY == elementType) {
- provides = true;
- }
- }
- }
- return provides || super.provides(operation);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.papyrus.sysml.diagram.requirement.provider.InheritedClassDiagramViewProvider#createNode(org.eclipse.core.runtime.IAdaptable, org.eclipse.gmf.runtime.notation.View, java.lang.String, int, boolean,
- * org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint)
- */
- @Override
- public Node createNode(final IAdaptable semanticAdapter, final View containerView, final String semanticHint, final int index, final boolean persisted, final PreferencesHint preferencesHint) {
- Node node = null;
- if (SysMLElementTypes.REQUIREMENT.getDisplayName().equals(semanticHint)) {
- node = createRequirementNode(semanticAdapter, containerView, index, persisted, preferencesHint);
- } else if (SysMLElementTypes.PROBLEM.getDisplayName().equals(semanticHint)
- || SysMLElementTypes.RATIONALE.getDisplayName().equals(semanticHint)) {
-
- final EObject domainElement = getSemanticElement(semanticAdapter);
- node = createComment_Shape(domainElement, containerView, index, persisted, preferencesHint);
- }
-
- return null != node ? node : super.createNode(semanticAdapter, containerView, semanticHint, index, persisted, preferencesHint);
- }
-
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.papyrus.sysml.diagram.requirement.provider.InheritedClassDiagramViewProvider#createEdge(org.eclipse.core.runtime.IAdaptable, org.eclipse.gmf.runtime.notation.View, java.lang.String, int, boolean,
- * org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint)
- */
- @Override
- public Edge createEdge(final IAdaptable semanticAdapter, final View containerView, final String semanticHint, final int index, final boolean persisted, final PreferencesHint preferencesHint) {
- Edge edge = null;
-
- if (SysMLElementTypes.COPY.getDisplayName().equals(semanticHint)
- || SysMLElementTypes.DERIVE_REQT.getDisplayName().equals(semanticHint)
- || SysMLElementTypes.SATISFY.getDisplayName().equals(semanticHint)
- || SysMLElementTypes.VERIFY.getDisplayName().equals(semanticHint)) {
- final EObject domainElement = getSemanticElement(semanticAdapter);
- edge = createAbstraction_Edge(domainElement, containerView, index, persisted, preferencesHint);
- }
-
- return null != edge ? edge : super.createEdge(semanticAdapter, containerView, semanticHint, index, persisted, preferencesHint);
- }
-
- /**
- * create a <code>Requirement Node</code>.
- *
- * @param IAdaptable
- * (for semantic element)
- * @param containerView
- * the container view that will contain the created view.
- * @param index
- * position in the container view's list of children views.
- * @param persisted
- * indicates if the created view will be persisted or not
- * @param preferencesHint
- * The preference hint that is to be used to find the appropriate
- * preference store from which to retrieve diagram preference
- * values. The preference hint is mapped to a preference store in
- * the preference registry <@link DiagramPreferencesRegistry>.
- * @return the created <code>Requirement Node</code>
- */
- protected Shape createRequirementNode(final IAdaptable semanticAdapter, final View containerView, final int index, final boolean persisted, final PreferencesHint preferencesHint) {
- Shape node;
- node = NotationFactory.eINSTANCE.createShape();
- node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
- node.setType(SysMLGraphicalTypes.SHAPE_SYSML_REQUIREMENT_AS_CLASSIFER_ID);
- ViewUtil.insertChildView(containerView, node, index, persisted);
- final EObject domainElement = getSemanticElement(semanticAdapter);
- node.setElement(domainElement);
- stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
- PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "Class");//$NON-NLS-1$
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Class");//$NON-NLS-1$
- PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "Class");//$NON-NLS-1$
-
- // createLabel(node, UMLVisualIDRegistry.getType(ClassNameEditPart.VISUAL_ID));
-
- createLabel(node, UMLVisualIDRegistry.getType(ClassNameEditPart.VISUAL_ID));
-
- createCompartment(node, UMLVisualIDRegistry.getType(ClassAttributeCompartmentEditPart.VISUAL_ID), true, true, true, true);
- createCompartment(node, UMLVisualIDRegistry.getType(ClassOperationCompartmentEditPart.VISUAL_ID), true, true, true, true);
- createCompartment(node, UMLVisualIDRegistry.getType(ClassNestedClassifierCompartmentEditPart.VISUAL_ID), true, true, true, true);
-
- /*
- * Addition of the information compartment, and the labels it contains.
- */
- Node compartment = createCompartment(node, SysMLGraphicalTypes.COMPARTMENT_SYSML_REQUIREMENT_IDINFO_AS_LIST_ID, true, true, true, true);
- createLabel(compartment, SysMLGraphicalTypes.LABEL_SYSML_REQUIREMENT_ID_ID);
- createLabel(compartment, SysMLGraphicalTypes.LABEL_SYSML_REQUIREMENT_TEXT_ID);
-
- PreferenceInitializerForElementHelper.initCompartmentsStatusFromPrefs(node, prefStore, "Class");//$NON-NLS-1$
- return node;
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/provider/CustomRequirementEditPartProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/provider/CustomRequirementEditPartProvider.java deleted file mode 100644 index 5b705edfdf1..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/provider/CustomRequirementEditPartProvider.java +++ /dev/null @@ -1,69 +0,0 @@ -/*****************************************************************************
- * Copyright (c) 2013 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:
- * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.requirement.provider;
-
-import org.eclipse.gmf.runtime.common.core.service.IOperation;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.services.editpart.CreateGraphicEditPartOperation;
-import org.eclipse.gmf.runtime.diagram.ui.services.editpart.IEditPartOperation;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
-import org.eclipse.papyrus.sysml.diagram.requirement.edit.part.CustomRequirementEditPart;
-import org.eclipse.papyrus.sysml.diagram.requirement.edit.part.CustomRequirementIdLabelEditPart;
-import org.eclipse.papyrus.sysml.diagram.requirement.edit.part.CustomRequirementInformationCompartmentEditPart;
-import org.eclipse.papyrus.sysml.diagram.requirement.edit.part.CustomRequirementTextLabelEditPart;
-import org.eclipse.papyrus.uml.diagram.clazz.part.UMLVisualIDRegistry;
-
-/**
- * Reuse the Custom EditPartProvider from the Class Diagram
- *
- * @author Nizar GUEDIDI
- */
-public class CustomRequirementEditPartProvider extends CUMLEditPartProvider {
-
- @Override
- public synchronized boolean provides(IOperation operation) {
- super.provides(operation);
- if (operation instanceof CreateGraphicEditPartOperation) {
- View view = ((IEditPartOperation) operation).getView();
- if (!ElementTypes.DIAGRAM_ID.equals(UMLVisualIDRegistry.getModelID(view))) {
- return false;
- }
- if (isAllowCaching() && getCachedPart(view) != null) {
- return true;
- }
- IGraphicalEditPart part = createEditPart(view);
- if (part != null) {
- return true;
- }
- }
- return false;
- }
-
- @Override
- protected IGraphicalEditPart createEditPart(View view) {
- if (view.getType().equals(SysMLGraphicalTypes.COMPARTMENT_SYSML_REQUIREMENT_IDINFO_AS_LIST_ID)) {
- return new CustomRequirementInformationCompartmentEditPart(view);
- }
- if (view.getType().equals(SysMLGraphicalTypes.SHAPE_SYSML_REQUIREMENT_AS_CLASSIFER_ID)) {
- return new CustomRequirementEditPart(view);
- }
- if (view.getType().equals(SysMLGraphicalTypes.LABEL_SYSML_REQUIREMENT_ID_ID)) {
- return new CustomRequirementIdLabelEditPart(view);
- }
- if (view.getType().equals(SysMLGraphicalTypes.LABEL_SYSML_REQUIREMENT_TEXT_ID)) {
- return new CustomRequirementTextLabelEditPart(view);
- }
-
- return super.createEditPart(view);
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/provider/RequirementVisualTypeProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/provider/RequirementVisualTypeProvider.java deleted file mode 100644 index 55025bfdc28..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/provider/RequirementVisualTypeProvider.java +++ /dev/null @@ -1,28 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * 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: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.sysml.diagram.requirement.provider; - -import org.eclipse.papyrus.gmf.diagram.common.provider.SysMLVisualTypeProvider; -import org.eclipse.papyrus.uml.diagram.clazz.providers.UMLVisualTypeProvider; - -/** - * Visual type provider for the SysML Requirement Diagram. - */ -public class RequirementVisualTypeProvider extends SysMLVisualTypeProvider { - - public RequirementVisualTypeProvider() { - super(new GraphicalTypeRegistry(), new UMLVisualTypeProvider()); - } - -} |