Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Grouhan2015-04-09 08:59:51 +0000
committerPierre-Charles David2015-04-14 08:16:52 +0000
commitfa0bd28fdfa336264b6f8594d655888faa8ee417 (patch)
tree655930faec113a72d2214cfe962e1413ae2c77ec
parent81365a83b09b4de7932f66ef7f699efddabde406 (diff)
downloadorg.eclipse.sirius-fa0bd28fdfa336264b6f8594d655888faa8ee417.tar.gz
org.eclipse.sirius-fa0bd28fdfa336264b6f8594d655888faa8ee417.tar.xz
org.eclipse.sirius-fa0bd28fdfa336264b6f8594d655888faa8ee417.zip
[463562] Change default values of ArcHeight and ArcWidth of rounded
corners Change the default values from 1 to 10. Also add a migration participant so that previous VSM's values does not change. Bug: 463562 Change-Id: I9179ce2b34e41042bdd2274cd96a12630284af4d Signed-off-by: Benjamin Grouhan <benjamin.grouhan@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius.diagram.ui/plugin.xml4
-rw-r--r--plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/migration/description/RoundedCornerDefaultValuesMigrationParticipant.java50
-rw-r--r--plugins/org.eclipse.sirius.diagram/model/diagram.ecore4
-rw-r--r--plugins/org.eclipse.sirius.diagram/src-gen/org/eclipse/sirius/diagram/description/style/impl/RoundedCornerStyleDescriptionImpl.java4
-rw-r--r--plugins/org.eclipse.sirius.diagram/src-gen/org/eclipse/sirius/diagram/description/style/impl/StylePackageImpl.java8
-rw-r--r--plugins/org.eclipse.sirius.diagram/src-gen/org/eclipse/sirius/diagram/description/style/impl/WorkspaceImageDescriptionImpl.java4
6 files changed, 64 insertions, 10 deletions
diff --git a/plugins/org.eclipse.sirius.diagram.ui/plugin.xml b/plugins/org.eclipse.sirius.diagram.ui/plugin.xml
index ead75447ff..5c604a9d85 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/plugin.xml
+++ b/plugins/org.eclipse.sirius.diagram.ui/plugin.xml
@@ -1857,6 +1857,10 @@
class="org.eclipse.sirius.diagram.ui.business.internal.migration.DiagramSplitMigrationParticipant"
kind="VSM">
</participant>
+ <participant
+ class="org.eclipse.sirius.diagram.ui.business.internal.migration.description.RoundedCornerDefaultValuesMigrationParticipant"
+ kind="VSM">
+ </participant>
</extension>
<extension point="org.eclipse.emf.edit.itemProviderAdapterFactories">
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/migration/description/RoundedCornerDefaultValuesMigrationParticipant.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/migration/description/RoundedCornerDefaultValuesMigrationParticipant.java
new file mode 100644
index 0000000000..bdc779720e
--- /dev/null
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/migration/description/RoundedCornerDefaultValuesMigrationParticipant.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Obeo.
+ * 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:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.sirius.diagram.ui.business.internal.migration.description;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.sirius.business.api.migration.AbstractVSMMigrationParticipant;
+import org.eclipse.sirius.diagram.description.style.ContainerStyleDescription;
+import org.osgi.framework.Version;
+
+/**
+ * Default values of ArcHeight and ArcWidth of rounded corners have been
+ * modified to 10 in Sirius metamodels. This migration goal is to replace each
+ * default value of ArcHeight and ArcWidth by 1, the previous default value.
+ *
+ * @author bgrouhan
+ *
+ */
+public class RoundedCornerDefaultValuesMigrationParticipant extends AbstractVSMMigrationParticipant {
+
+ private static final int OLD_DEFAULT_VALUE = 1;
+
+ /**
+ * The Sirius version for which this migration is added.
+ */
+ private static final Version MIGRATION_VERSION = new Version("10.0.0.201504091800");
+
+ @Override
+ public Version getMigrationVersion() {
+ return MIGRATION_VERSION;
+ }
+
+ @Override
+ public EObject updateCreatedObject(EObject newObject, String loadedVersion) {
+ if (Version.parseVersion(loadedVersion).compareTo(MIGRATION_VERSION) < 0) {
+ if (newObject instanceof ContainerStyleDescription) {
+ ((ContainerStyleDescription) newObject).setArcHeight(OLD_DEFAULT_VALUE);
+ ((ContainerStyleDescription) newObject).setArcWidth(OLD_DEFAULT_VALUE);
+ }
+ }
+ return newObject;
+ }
+}
diff --git a/plugins/org.eclipse.sirius.diagram/model/diagram.ecore b/plugins/org.eclipse.sirius.diagram/model/diagram.ecore
index 207e9c3bf8..896cebb2c1 100644
--- a/plugins/org.eclipse.sirius.diagram/model/diagram.ecore
+++ b/plugins/org.eclipse.sirius.diagram/model/diagram.ecore
@@ -2042,13 +2042,13 @@
<eClassifiers xsi:type="ecore:EClass" name="RoundedCornerStyleDescription" abstract="true"
eSuperTypes="../../org.eclipse.sirius/model/viewpoint.ecore#//description/style/StyleDescription">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="arcWidth" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EIntegerObject"
- defaultValueLiteral="1">
+ defaultValueLiteral="10">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="The width of the ellipse used to draw the corners."/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="arcHeight" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EIntegerObject"
- defaultValueLiteral="1">
+ defaultValueLiteral="10">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="The height of the ellipse used to draw the corners."/>
</eAnnotations>
diff --git a/plugins/org.eclipse.sirius.diagram/src-gen/org/eclipse/sirius/diagram/description/style/impl/RoundedCornerStyleDescriptionImpl.java b/plugins/org.eclipse.sirius.diagram/src-gen/org/eclipse/sirius/diagram/description/style/impl/RoundedCornerStyleDescriptionImpl.java
index 299c666905..71aa3ca127 100644
--- a/plugins/org.eclipse.sirius.diagram/src-gen/org/eclipse/sirius/diagram/description/style/impl/RoundedCornerStyleDescriptionImpl.java
+++ b/plugins/org.eclipse.sirius.diagram/src-gen/org/eclipse/sirius/diagram/description/style/impl/RoundedCornerStyleDescriptionImpl.java
@@ -44,7 +44,7 @@ public abstract class RoundedCornerStyleDescriptionImpl extends MinimalEObjectIm
* @generated
* @ordered
*/
- protected static final Integer ARC_WIDTH_EDEFAULT = new Integer(1);
+ protected static final Integer ARC_WIDTH_EDEFAULT = new Integer(10);
/**
* The cached value of the '{@link #getArcWidth() <em>Arc Width</em>}'
@@ -64,7 +64,7 @@ public abstract class RoundedCornerStyleDescriptionImpl extends MinimalEObjectIm
* @generated
* @ordered
*/
- protected static final Integer ARC_HEIGHT_EDEFAULT = new Integer(1);
+ protected static final Integer ARC_HEIGHT_EDEFAULT = new Integer(10);
/**
* The cached value of the '{@link #getArcHeight() <em>Arc Height</em>}'
diff --git a/plugins/org.eclipse.sirius.diagram/src-gen/org/eclipse/sirius/diagram/description/style/impl/StylePackageImpl.java b/plugins/org.eclipse.sirius.diagram/src-gen/org/eclipse/sirius/diagram/description/style/impl/StylePackageImpl.java
index 09a4094237..4c605d8969 100644
--- a/plugins/org.eclipse.sirius.diagram/src-gen/org/eclipse/sirius/diagram/description/style/impl/StylePackageImpl.java
+++ b/plugins/org.eclipse.sirius.diagram/src-gen/org/eclipse/sirius/diagram/description/style/impl/StylePackageImpl.java
@@ -1384,9 +1384,9 @@ public class StylePackageImpl extends EPackageImpl implements StylePackage {
initEClass(roundedCornerStyleDescriptionEClass, RoundedCornerStyleDescription.class, "RoundedCornerStyleDescription", EPackageImpl.IS_ABSTRACT, !EPackageImpl.IS_INTERFACE,
EPackageImpl.IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getRoundedCornerStyleDescription_ArcWidth(), theEcorePackage.getEIntegerObject(), "arcWidth", "1", 0, 1, RoundedCornerStyleDescription.class, !EPackageImpl.IS_TRANSIENT,
+ initEAttribute(getRoundedCornerStyleDescription_ArcWidth(), theEcorePackage.getEIntegerObject(), "arcWidth", "10", 0, 1, RoundedCornerStyleDescription.class, !EPackageImpl.IS_TRANSIENT,
!EPackageImpl.IS_VOLATILE, EPackageImpl.IS_CHANGEABLE, !EPackageImpl.IS_UNSETTABLE, !EPackageImpl.IS_ID, EPackageImpl.IS_UNIQUE, !EPackageImpl.IS_DERIVED, EPackageImpl.IS_ORDERED);
- initEAttribute(getRoundedCornerStyleDescription_ArcHeight(), theEcorePackage.getEIntegerObject(), "arcHeight", "1", 0, 1, RoundedCornerStyleDescription.class, !EPackageImpl.IS_TRANSIENT,
+ initEAttribute(getRoundedCornerStyleDescription_ArcHeight(), theEcorePackage.getEIntegerObject(), "arcHeight", "10", 0, 1, RoundedCornerStyleDescription.class, !EPackageImpl.IS_TRANSIENT,
!EPackageImpl.IS_VOLATILE, EPackageImpl.IS_CHANGEABLE, !EPackageImpl.IS_UNSETTABLE, !EPackageImpl.IS_ID, EPackageImpl.IS_UNIQUE, !EPackageImpl.IS_DERIVED, EPackageImpl.IS_ORDERED);
initEClass(containerStyleDescriptionEClass, ContainerStyleDescription.class, "ContainerStyleDescription", EPackageImpl.IS_ABSTRACT, !EPackageImpl.IS_INTERFACE,
@@ -1524,8 +1524,8 @@ public class StylePackageImpl extends EPackageImpl implements StylePackage {
addAnnotation(getSizeComputationContainerStyleDescription_WidthComputationExpression(), source, new String[] {});
addAnnotation(getSizeComputationContainerStyleDescription_HeightComputationExpression(), source, new String[] {});
addAnnotation(getEdgeStyleDescription_SizeComputationExpression(), source, new String[] { "diagram", "diagram.DDiagram | the current DSemanticDiagram.", "view",
- "diagram.DEdge | the current edge view for which the size is calculated.", "sourceView", "diagram.EdgeTarget | the source view of the current edge.", "targetView",
- "diagram.EdgeTarget | the target view of the current edge." });
+ "diagram.DEdge | the current edge view for which the size is calculated.", "sourceView", "diagram.EdgeTarget | the source view of the current edge.", "targetView",
+ "diagram.EdgeTarget | the target view of the current edge." });
}
/**
diff --git a/plugins/org.eclipse.sirius.diagram/src-gen/org/eclipse/sirius/diagram/description/style/impl/WorkspaceImageDescriptionImpl.java b/plugins/org.eclipse.sirius.diagram/src-gen/org/eclipse/sirius/diagram/description/style/impl/WorkspaceImageDescriptionImpl.java
index 87f5b311dd..fd635ecdc4 100644
--- a/plugins/org.eclipse.sirius.diagram/src-gen/org/eclipse/sirius/diagram/description/style/impl/WorkspaceImageDescriptionImpl.java
+++ b/plugins/org.eclipse.sirius.diagram/src-gen/org/eclipse/sirius/diagram/description/style/impl/WorkspaceImageDescriptionImpl.java
@@ -51,7 +51,7 @@ public class WorkspaceImageDescriptionImpl extends NodeStyleDescriptionImpl impl
* @generated
* @ordered
*/
- protected static final Integer ARC_WIDTH_EDEFAULT = new Integer(1);
+ protected static final Integer ARC_WIDTH_EDEFAULT = new Integer(10);
/**
* The cached value of the '{@link #getArcWidth() <em>Arc Width</em>}'
@@ -71,7 +71,7 @@ public class WorkspaceImageDescriptionImpl extends NodeStyleDescriptionImpl impl
* @generated
* @ordered
*/
- protected static final Integer ARC_HEIGHT_EDEFAULT = new Integer(1);
+ protected static final Integer ARC_HEIGHT_EDEFAULT = new Integer(10);
/**
* The cached value of the '{@link #getArcHeight() <em>Arc Height</em>}'

Back to the top