Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'uml/org.eclipse.papyrus.diagram.clazz/src/org/eclipse/papyrus/diagram/clazz/edit/parts/RealizationEditPart.java')
-rw-r--r--uml/org.eclipse.papyrus.diagram.clazz/src/org/eclipse/papyrus/diagram/clazz/edit/parts/RealizationEditPart.java173
1 files changed, 173 insertions, 0 deletions
diff --git a/uml/org.eclipse.papyrus.diagram.clazz/src/org/eclipse/papyrus/diagram/clazz/edit/parts/RealizationEditPart.java b/uml/org.eclipse.papyrus.diagram.clazz/src/org/eclipse/papyrus/diagram/clazz/edit/parts/RealizationEditPart.java
new file mode 100644
index 00000000000..a92fb71427d
--- /dev/null
+++ b/uml/org.eclipse.papyrus.diagram.clazz/src/org/eclipse/papyrus/diagram/clazz/edit/parts/RealizationEditPart.java
@@ -0,0 +1,173 @@
+/*****************************************************************************
+ * Copyright (c) 2008 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.diagram.clazz.edit.parts;
+
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.Connection;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.clazz.edit.policies.RealizationItemSemanticEditPolicy;
+import org.eclipse.papyrus.diagram.common.figure.edge.CInterfaceRealizationFigure;
+
+/**
+ * @generated
+ */
+public class RealizationEditPart extends ConnectionNodeEditPart implements ITreeBranchEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 4005;
+
+ /**
+ * @generated
+ */
+ public RealizationEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new RealizationItemSemanticEditPolicy());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean addFixedChild(EditPart childEditPart) {
+ if (childEditPart instanceof RealizationNameEditPart) {
+ ((RealizationNameEditPart) childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
+ return true;
+ }
+ if (childEditPart instanceof RealizationName2EditPart) {
+ ((RealizationName2EditPart) childEditPart).setLabel(getPrimaryShape().getInterfaceRealizationNameLabel());
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ protected void addChildVisual(EditPart childEditPart, int index) {
+ if (addFixedChild(childEditPart)) {
+ return;
+ }
+ super.addChildVisual(childEditPart, -1);
+ }
+
+ /**
+ * 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
+ */
+
+ protected Connection createConnectionFigure() {
+ return new InterfaceRealizationDescriptor();
+ }
+
+ /**
+ * @generated
+ */
+ public InterfaceRealizationDescriptor getPrimaryShape() {
+ return (InterfaceRealizationDescriptor) getFigure();
+ }
+
+ /**
+ * @generated
+ */
+ public class InterfaceRealizationDescriptor extends CInterfaceRealizationFigure {
+
+ /**
+ * @generated
+ */
+ private WrappingLabel fInterfaceRealizationNameLabel;
+
+ /**
+ * @generated
+ */
+ private WrappingLabel fAppliedStereotypeLabel;
+
+ /**
+ * @generated
+ */
+ public InterfaceRealizationDescriptor() {
+
+ this.setForegroundColor(ColorConstants.black);
+ this.setBackgroundColor(ColorConstants.black);
+ createContents();
+ }
+
+ /**
+ * @generated
+ */
+ private void createContents() {
+
+ fInterfaceRealizationNameLabel = new WrappingLabel();
+ fInterfaceRealizationNameLabel.setText("");
+
+ this.add(fInterfaceRealizationNameLabel);
+
+ fAppliedStereotypeLabel = new WrappingLabel();
+ fAppliedStereotypeLabel.setText("");
+
+ this.add(fAppliedStereotypeLabel);
+
+ }
+
+ /**
+ * @generated
+ */
+ private boolean myUseLocalCoordinates = false;
+
+ /**
+ * @generated
+ */
+ protected boolean useLocalCoordinates() {
+ return myUseLocalCoordinates;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
+ myUseLocalCoordinates = useLocalCoordinates;
+ }
+
+ /**
+ * @generated
+ */
+ public WrappingLabel getInterfaceRealizationNameLabel() {
+ return fInterfaceRealizationNameLabel;
+ }
+
+ /**
+ * @generated
+ */
+ public WrappingLabel getAppliedStereotypeLabel() {
+ return fAppliedStereotypeLabel;
+ }
+
+ }
+
+}

Back to the top