diff options
author | Fanch BONNABESSE | 2016-07-21 12:10:41 +0000 |
---|---|---|
committer | Patrick Tessier | 2016-09-20 07:56:29 +0000 |
commit | 0c7fb27a31bb876e54df6c2b8943415d384af027 (patch) | |
tree | ea5e41545170055ae034fabeb4740c4169384b4b | |
parent | 040fb7aeab8cf065ac93709f5f7d8e7a5d22d98c (diff) | |
download | org.eclipse.papyrus-0c7fb27a31bb876e54df6c2b8943415d384af027.tar.gz org.eclipse.papyrus-0c7fb27a31bb876e54df6c2b8943415d384af027.tar.xz org.eclipse.papyrus-0c7fb27a31bb876e54df6c2b8943415d384af027.zip |
Bug 486553: [Model Explorer] Profile specific icons do not show when
multiple stereotypes are applied
https://bugs.eclipse.org/bugs/show_bug.cgi?id=486553
Get the first available icons of each applied stereotypes.
Delete the "final". The API must be not modified.
Add JUnit Tests
Change-Id: Ief0c5ddc98c7f70c9df3e8fa66732366216958d4
Signed-off-by: Fanch BONNABESSE <fanch.bonnabesse@all4tec.net>
(cherry picked from commit 77d082d75cbece6927e03a124625b96709fc98ba)
9 files changed, 1063 insertions, 257 deletions
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/Activator.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/Activator.java index 36af2c03d5d..26b5d8d7420 100644 --- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/Activator.java +++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/Activator.java @@ -1,256 +1,266 @@ -/*****************************************************************************
- * Copyright (c) 2014, 2015 CEA LIST, 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:
- * Patrick Tessier (CEA LIST) - Initial API and implementation
- * Christian W. Damus (CEA) - bug 425270
- * Christian W. Damus - bug 469464
- *
- /*****************************************************************************/
-package org.eclipse.papyrus.uml.tools;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.papyrus.infra.core.log.LogHelper;
-import org.eclipse.papyrus.uml.tools.utils.ElementUtil;
-import org.eclipse.papyrus.uml.tools.utils.ImageUtil;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Stereotype;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
- /**
- * The plug-in ID
- */
- public static final String PLUGIN_ID = "org.eclipse.papyrus.uml.tools"; //$NON-NLS-1$
-
- public static final String TRACE_LANGUAGE_PROVIDERS = "providers/language"; //$NON-NLS-1$
-
- // The shared instance
- private static Activator plugin;
-
- /**
- * The plug-in's logger
- */
- public static LogHelper log;
-
- private ComposedAdapterFactory adapterFactory;
-
- /**
- * The constructor
- */
- public Activator() {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- log = new LogHelper(this);
- adapterFactory = createAdapterFactory();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- @Override
- public void stop(BundleContext context) throws Exception {
- adapterFactory.dispose();
- adapterFactory = null;
- log = null;
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
-
- protected ComposedAdapterFactory createAdapterFactory() {
- return new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
- }
-
- public AdapterFactory getItemProviderAdapterFactory() {
- return adapterFactory;
- }
-
-
-
-
- // /////////////////////////////////////////////////////////////////////////
- //
- // The following code has been extracted from oep.uml.diagram.common during the refactoring,
- // to avoid cyclic dependencies between this plug-in and oep.uml.diagram.common.
- // This is temporary code, as the Image service is not yet available.
- // This code should be removed as soon as the Image service is available.
- //
- // /////////////////////////////////////////////////////////////////////////
-
-
- private final static String UML_ICONS = "/org.eclipse.uml2.uml.edit/icons/full/obj16/";
-
-
- /**
- * Gets the Image for the given EClass
- *
- * @param eClass
- * @return
- *
- * @deprecated This class can be used during the refactoring phase, until
- * the Image service is written. There is currently no alternative.
- */
- @Deprecated
- // FIXME : To be refactored. Replace with the Image service when it is available
- public Image getImageForUMLMetaclass(EClass eClass) {
- return org.eclipse.papyrus.infra.widgets.Activator.getDefault().getImageFromPlugin(UML_ICONS + eClass.getName() + ".gif"); //$NON-NLS-1$
- }
-
- /**
- * this method returns the icon image that represents the first applied
- * stereotype.
- *
- * @param element
- * the stereotyped element
- * @return {@link image} of the icon
- */
- @Deprecated
- public Image getIconElement(Element element) {
-
- List<Stereotype> stereotypeList = element.getAppliedStereotypes();
- if (stereotypeList == null || stereotypeList.isEmpty()) {
- return null;
- }
- return getIconElement(element, stereotypeList.get(0));
- }
-
- /**
- * this method returns the collection of icon images that represents the
- * applied stereotypes.
- *
- * @param elt
- * the stereotyped element
- * @param stereotypes
- * the collection of stereotypes which icon has to be displayed
- * @param kind
- * the kind of display "icon" or "shape"
- * @return {@link image} of the icon
- */
- @Deprecated
- public Collection<Image> getIconElements(Element elt, Collection<Stereotype> stereotypes) {
- Collection<Image> images = new ArrayList<Image>();
-
- // look in each stereotype and get the image for each of them
- for (Stereotype stereotype : stereotypes) {
- // getStereotypeImage can return null
- org.eclipse.uml2.uml.Image icon = ElementUtil.getStereotypeImage(elt, stereotype, "icon");
- if (icon != null) {
- images.add(getImageInRegistry(icon));
- }
- }
- return images;
- }
-
- /**
- * this method returns the icon image that represents the first applied
- * stereotype.
- *
- * @param elt
- * the stereotyped element
- * @param stereotype
- * the stereotype which icon has to be displayed
- * @param kind
- * the kind of display "icon" or "shape"
- * @return {@link image} of the icon
- */
- @Deprecated
- public static Image getIconElement(Element elt, Stereotype stereotype) {
-
- // getStereotypeImage can return null
- org.eclipse.uml2.uml.Image icon = ElementUtil.getStereotypeImage(elt, stereotype, "icon");
- if (icon != null) {
- return getImageInRegistry(icon);
- } else {
- return null;
- }
- }
-
- /**
- * Find the image (SWT) in registry Store image in registry if it is not
- * found
- *
- * @param umlImage
- * to retrieve as SWT Image in registry
- * @return the stored SWT image
- */
- @Deprecated
- public static Image getImageInRegistry(org.eclipse.uml2.uml.Image umlImage) {
- // Retrieve registry
- ImageRegistry papyrusRegistry = getDefault().getImageRegistry();
-
- // Get image id for registry
- String image_id = ImageUtil.getImageId(umlImage);
-
- // Get SWT image for shape in the registry
- Image image = papyrusRegistry.get(image_id);
-
- // If image was not found in registry,
- // try to find an image and to update registry
- if (image == null) {
-
- try {
- // Try to retrieve image from UML Image content property
- image = ImageUtil.getContent(umlImage);
- } catch (Exception e) {
- // Activator.log.error(e);
- }
-
- // If no image was found in Content
- // Try to retrieve image from UML Image location property
- if (image == null) {
- image = ImageUtil.getImageFromLocation(umlImage);
- }
-
- if (image != null) {
- // Store image in registry
- ImageData imdata = image.getImageData();
- papyrusRegistry.put(image_id, ImageDescriptor.createFromImageData(imdata));
- image = papyrusRegistry.get(image_id);
- }
- }
-
- return image;
- }
-
-}
+/***************************************************************************** + * Copyright (c) 2014, 2015 CEA LIST, 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: + * Patrick Tessier (CEA LIST) - Initial API and implementation + * Christian W. Damus (CEA) - bug 425270 + * Christian W. Damus - bug 469464 + * + /*****************************************************************************/ +package org.eclipse.papyrus.uml.tools; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.edit.provider.ComposedAdapterFactory; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.resource.ImageRegistry; +import org.eclipse.papyrus.infra.core.log.LogHelper; +import org.eclipse.papyrus.uml.tools.utils.ElementUtil; +import org.eclipse.papyrus.uml.tools.utils.ImageUtil; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.graphics.ImageData; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.Stereotype; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + /** + * The plug-in ID + */ + public static final String PLUGIN_ID = "org.eclipse.papyrus.uml.tools"; //$NON-NLS-1$ + + public static final String TRACE_LANGUAGE_PROVIDERS = "providers/language"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + /** + * The plug-in's logger + */ + public static LogHelper log; + + private ComposedAdapterFactory adapterFactory; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + log = new LogHelper(this); + adapterFactory = createAdapterFactory(); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + @Override + public void stop(BundleContext context) throws Exception { + adapterFactory.dispose(); + adapterFactory = null; + log = null; + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + + protected ComposedAdapterFactory createAdapterFactory() { + return new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE); + } + + public AdapterFactory getItemProviderAdapterFactory() { + return adapterFactory; + } + + + + + // ///////////////////////////////////////////////////////////////////////// + // + // The following code has been extracted from oep.uml.diagram.common during the refactoring, + // to avoid cyclic dependencies between this plug-in and oep.uml.diagram.common. + // This is temporary code, as the Image service is not yet available. + // This code should be removed as soon as the Image service is available. + // + // ///////////////////////////////////////////////////////////////////////// + + + private final static String UML_ICONS = "/org.eclipse.uml2.uml.edit/icons/full/obj16/"; + + + /** + * Gets the Image for the given EClass + * + * @param eClass + * @return + * + * @deprecated This class can be used during the refactoring phase, until + * the Image service is written. There is currently no alternative. + */ + @Deprecated + // FIXME : To be refactored. Replace with the Image service when it is available + public Image getImageForUMLMetaclass(EClass eClass) { + return org.eclipse.papyrus.infra.widgets.Activator.getDefault().getImageFromPlugin(UML_ICONS + eClass.getName() + ".gif"); //$NON-NLS-1$ + } + + /** + * this method returns the icon image that represents the first available icon of each applied + * stereotypes. + * + * @param element + * the stereotyped element + * @return {@link image} of the icon + */ + @Deprecated + public Image getIconElement(Element element) { + List<Stereotype> stereotypeList = element.getAppliedStereotypes(); + if (null == stereotypeList || stereotypeList.isEmpty()) { + return null; + } + + // Retrieve the first available icon of each stereotype. Return null, if no icon are found. + int i = 0; + while (i < stereotypeList.size()) { + Image iconElement = getIconElement(element, stereotypeList.get(i)); + if (null != iconElement) { + return iconElement; + } + i++; + } + + return null; + } + + /** + * this method returns the collection of icon images that represents the + * applied stereotypes. + * + * @param elt + * the stereotyped element + * @param stereotypes + * the collection of stereotypes which icon has to be displayed + * @param kind + * the kind of display "icon" or "shape" + * @return {@link image} of the icon + */ + @Deprecated + public Collection<Image> getIconElements(Element elt, Collection<Stereotype> stereotypes) { + Collection<Image> images = new ArrayList<Image>(); + + // look in each stereotype and get the image for each of them + for (Stereotype stereotype : stereotypes) { + // getStereotypeImage can return null + org.eclipse.uml2.uml.Image icon = ElementUtil.getStereotypeImage(elt, stereotype, "icon"); + if (icon != null) { + images.add(getImageInRegistry(icon)); + } + } + return images; + } + + /** + * this method returns the icon image that represents the first applied + * stereotype. + * + * @param elt + * the stereotyped element + * @param stereotype + * the stereotype which icon has to be displayed + * @param kind + * the kind of display "icon" or "shape" + * @return {@link image} of the icon + */ + @Deprecated + public static Image getIconElement(Element elt, Stereotype stereotype) { + + // getStereotypeImage can return null + org.eclipse.uml2.uml.Image icon = ElementUtil.getStereotypeImage(elt, stereotype, "icon"); + if (icon != null) { + return getImageInRegistry(icon); + } else { + return null; + } + } + + /** + * Find the image (SWT) in registry Store image in registry if it is not + * found + * + * @param umlImage + * to retrieve as SWT Image in registry + * @return the stored SWT image + */ + @Deprecated + public static Image getImageInRegistry(org.eclipse.uml2.uml.Image umlImage) { + // Retrieve registry + ImageRegistry papyrusRegistry = getDefault().getImageRegistry(); + + // Get image id for registry + String image_id = ImageUtil.getImageId(umlImage); + + // Get SWT image for shape in the registry + Image image = papyrusRegistry.get(image_id); + + // If image was not found in registry, + // try to find an image and to update registry + if (image == null) { + + try { + // Try to retrieve image from UML Image content property + image = ImageUtil.getContent(umlImage); + } catch (Exception e) { + // Activator.log.error(e); + } + + // If no image was found in Content + // Try to retrieve image from UML Image location property + if (image == null) { + image = ImageUtil.getImageFromLocation(umlImage); + } + + if (image != null) { + // Store image in registry + ImageData imdata = image.getImageData(); + papyrusRegistry.put(image_id, ImageDescriptor.createFromImageData(imdata)); + image = papyrusRegistry.get(image_id); + } + } + + return image; + } + +} diff --git a/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/resources/IconsAppliedStereotypes/model.di b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/resources/IconsAppliedStereotypes/model.di new file mode 100644 index 00000000000..bf9abab340f --- /dev/null +++ b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/resources/IconsAppliedStereotypes/model.di @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/> diff --git a/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/resources/IconsAppliedStereotypes/model.notation b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/resources/IconsAppliedStereotypes/model.notation new file mode 100644 index 00000000000..ead7901e5af --- /dev/null +++ b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/resources/IconsAppliedStereotypes/model.notation @@ -0,0 +1,185 @@ +<?xml version="1.0" encoding="UTF-8"?> +<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/papyrus/infra/viewpoints/policy/style" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_nb_IsF44EeaaapfdY6krmg" type="PapyrusUMLClassDiagram" name="ClassDiagram" measurementUnit="Pixel"> + <children xmi:type="notation:Shape" xmi:id="_u0xUIF44EeaaapfdY6krmg" type="StereotypeComment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_u0xUIV44EeaaapfdY6krmg"/> + <styles xmi:type="notation:EObjectValueStyle" xmi:id="_u0xUI144EeaaapfdY6krmg" name="BASE_ELEMENT"> + <eObjectValue xmi:type="uml:Class" href="model.uml#_n3jqYF44EeaaapfdY6krmg"/> + </styles> + <element xsi:nil="true"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_u0xUIl44EeaaapfdY6krmg" x="732" y="134"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_D6G9oF7SEeaPkdSwTkaxow" type="StereotypeComment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_D6G9oV7SEeaPkdSwTkaxow"/> + <styles xmi:type="notation:EObjectValueStyle" xmi:id="_D6G9o17SEeaPkdSwTkaxow" name="BASE_ELEMENT"> + <eObjectValue xmi:type="uml:Class" href="model.uml#_BmNBUF7SEeaPkdSwTkaxow"/> + </styles> + <element xsi:nil="true"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_D6G9ol7SEeaPkdSwTkaxow" x="560" y="117"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_n3lfkF44EeaaapfdY6krmg" type="Class_Shape"> + <children xmi:type="notation:DecorationNode" xmi:id="_n3mGoF44EeaaapfdY6krmg" type="Class_NameLabel"/> + <children xmi:type="notation:DecorationNode" xmi:id="_n3mGoV44EeaaapfdY6krmg" type="Class_FloatingNameLabel"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_n3mGol44EeaaapfdY6krmg" y="5"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_n3mGo144EeaaapfdY6krmg" type="Class_AttributeCompartment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_n3mGpF44EeaaapfdY6krmg"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_n3mGpV44EeaaapfdY6krmg"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_n3mGpl44EeaaapfdY6krmg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_n3mGp144EeaaapfdY6krmg"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_n3mGqF44EeaaapfdY6krmg" type="Class_OperationCompartment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_n3mGqV44EeaaapfdY6krmg"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_n3mGql44EeaaapfdY6krmg"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_n3mGq144EeaaapfdY6krmg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_n3mGrF44EeaaapfdY6krmg"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_n3mGrV44EeaaapfdY6krmg" type="Class_NestedClassifierCompartment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_n3mGrl44EeaaapfdY6krmg"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_n3mGr144EeaaapfdY6krmg"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_n3mGsF44EeaaapfdY6krmg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_n3mGsV44EeaaapfdY6krmg"/> + </children> + <element xmi:type="uml:Class" href="model.uml#_n3jqYF44EeaaapfdY6krmg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_n3lfkV44EeaaapfdY6krmg" x="61" y="36" width="125" height="117"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_BmZ1oF7SEeaPkdSwTkaxow" type="Class_Shape"> + <children xmi:type="notation:DecorationNode" xmi:id="_BmcR4F7SEeaPkdSwTkaxow" type="Class_NameLabel"/> + <children xmi:type="notation:DecorationNode" xmi:id="_BmcR4V7SEeaPkdSwTkaxow" type="Class_FloatingNameLabel"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_BmcR4l7SEeaPkdSwTkaxow" y="5"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_BmcR417SEeaPkdSwTkaxow" type="Class_AttributeCompartment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_BmcR5F7SEeaPkdSwTkaxow"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_BmcR5V7SEeaPkdSwTkaxow"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_BmcR5l7SEeaPkdSwTkaxow"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_BmcR517SEeaPkdSwTkaxow"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_BmcR6F7SEeaPkdSwTkaxow" type="Class_OperationCompartment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_BmcR6V7SEeaPkdSwTkaxow"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_BmcR6l7SEeaPkdSwTkaxow"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_BmcR617SEeaPkdSwTkaxow"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_BmcR7F7SEeaPkdSwTkaxow"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_Bmc48F7SEeaPkdSwTkaxow" type="Class_NestedClassifierCompartment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_Bmc48V7SEeaPkdSwTkaxow"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_Bmc48l7SEeaPkdSwTkaxow"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_Bmc4817SEeaPkdSwTkaxow"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Bmc49F7SEeaPkdSwTkaxow"/> + </children> + <element xmi:type="uml:Class" href="model.uml#_BmNBUF7SEeaPkdSwTkaxow"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_BmZ1oV7SEeaPkdSwTkaxow" x="315" y="43" width="126" height="120"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_6sZAUF8SEeanR5YAO7M9Zg" type="Class_Shape"> + <children xmi:type="notation:DecorationNode" xmi:id="_6sZAUl8SEeanR5YAO7M9Zg" type="Class_NameLabel"/> + <children xmi:type="notation:DecorationNode" xmi:id="_6sZAU18SEeanR5YAO7M9Zg" type="Class_FloatingNameLabel"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_6sZAVF8SEeanR5YAO7M9Zg" y="5"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_6sZnYF8SEeanR5YAO7M9Zg" type="Class_AttributeCompartment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_6sZnYV8SEeanR5YAO7M9Zg"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_6sZnYl8SEeanR5YAO7M9Zg"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_6sZnY18SEeanR5YAO7M9Zg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_6sZnZF8SEeanR5YAO7M9Zg"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_6sZnZV8SEeanR5YAO7M9Zg" type="Class_OperationCompartment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_6sZnZl8SEeanR5YAO7M9Zg"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_6sZnZ18SEeanR5YAO7M9Zg"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_6sZnaF8SEeanR5YAO7M9Zg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_6sZnaV8SEeanR5YAO7M9Zg"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_6sZnal8SEeanR5YAO7M9Zg" type="Class_NestedClassifierCompartment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_6sZna18SEeanR5YAO7M9Zg"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_6sZnbF8SEeanR5YAO7M9Zg"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_6sZnbV8SEeanR5YAO7M9Zg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_6sZnbl8SEeanR5YAO7M9Zg"/> + </children> + <element xmi:type="uml:Class" href="model.uml#_6sXLIF8SEeanR5YAO7M9Zg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_6sZAUV8SEeanR5YAO7M9Zg" x="62" y="222" width="128" height="112"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_68KhsF8SEeanR5YAO7M9Zg" type="Class_Shape"> + <children xmi:type="notation:DecorationNode" xmi:id="_68Khsl8SEeanR5YAO7M9Zg" type="Class_NameLabel"/> + <children xmi:type="notation:DecorationNode" xmi:id="_68Khs18SEeanR5YAO7M9Zg" type="Class_FloatingNameLabel"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_68KhtF8SEeanR5YAO7M9Zg" y="5"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_68KhtV8SEeanR5YAO7M9Zg" type="Class_AttributeCompartment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_68Khtl8SEeanR5YAO7M9Zg"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_68Kht18SEeanR5YAO7M9Zg"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_68KhuF8SEeanR5YAO7M9Zg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_68KhuV8SEeanR5YAO7M9Zg"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_68LIwF8SEeanR5YAO7M9Zg" type="Class_OperationCompartment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_68LIwV8SEeanR5YAO7M9Zg"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_68LIwl8SEeanR5YAO7M9Zg"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_68LIw18SEeanR5YAO7M9Zg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_68LIxF8SEeanR5YAO7M9Zg"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_68LIxV8SEeanR5YAO7M9Zg" type="Class_NestedClassifierCompartment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_68LIxl8SEeanR5YAO7M9Zg"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_68LIx18SEeanR5YAO7M9Zg"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_68LIyF8SEeanR5YAO7M9Zg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_68LIyV8SEeanR5YAO7M9Zg"/> + </children> + <element xmi:type="uml:Class" href="model.uml#_68J6oF8SEeanR5YAO7M9Zg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_68KhsV8SEeanR5YAO7M9Zg" x="309" y="224" width="127" height="118"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_fd6K4F8UEeanR5YAO7M9Zg" type="StereotypeComment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_fd6K4V8UEeanR5YAO7M9Zg"/> + <styles xmi:type="notation:EObjectValueStyle" xmi:id="_fd6K418UEeanR5YAO7M9Zg" name="BASE_ELEMENT"> + <eObjectValue xmi:type="uml:Class" href="model.uml#_6sXLIF8SEeanR5YAO7M9Zg"/> + </styles> + <element xsi:nil="true"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_fd6K4l8UEeanR5YAO7M9Zg" x="262" y="222"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_gf2wF18UEeanR5YAO7M9Zg" type="StereotypeComment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_gf2wGF8UEeanR5YAO7M9Zg"/> + <styles xmi:type="notation:EObjectValueStyle" xmi:id="_gf2wGl8UEeanR5YAO7M9Zg" name="BASE_ELEMENT"> + <eObjectValue xmi:type="uml:Class" href="model.uml#_68J6oF8SEeanR5YAO7M9Zg"/> + </styles> + <element xsi:nil="true"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_gf2wGV8UEeanR5YAO7M9Zg" x="509" y="224"/> + </children> + <styles xmi:type="notation:StringValueStyle" xmi:id="_nb_IsV44EeaaapfdY6krmg" name="diagram_compatibility_version" stringValue="1.2.0"/> + <styles xmi:type="notation:DiagramStyle" xmi:id="_nb_Isl44EeaaapfdY6krmg"/> + <styles xmi:type="style:PapyrusViewStyle" xmi:id="_nb_Is144EeaaapfdY6krmg"> + <owner xmi:type="uml:Model" href="model.uml#_myp30F44EeaaapfdY6krmg"/> + </styles> + <element xmi:type="uml:Model" href="model.uml#_myp30F44EeaaapfdY6krmg"/> + <edges xmi:type="notation:Connector" xmi:id="_u0xUJF44EeaaapfdY6krmg" type="StereotypeCommentLink" source="_n3lfkF44EeaaapfdY6krmg" target="_u0xUIF44EeaaapfdY6krmg"> + <styles xmi:type="notation:FontStyle" xmi:id="_u0xUJV44EeaaapfdY6krmg"/> + <styles xmi:type="notation:EObjectValueStyle" xmi:id="_u0xUKV44EeaaapfdY6krmg" name="BASE_ELEMENT"> + <eObjectValue xmi:type="uml:Class" href="model.uml#_n3jqYF44EeaaapfdY6krmg"/> + </styles> + <element xsi:nil="true"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_u0xUJl44EeaaapfdY6krmg" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_u0xUJ144EeaaapfdY6krmg"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_u0xUKF44EeaaapfdY6krmg"/> + </edges> + <edges xmi:type="notation:Connector" xmi:id="_D6HksF7SEeaPkdSwTkaxow" type="StereotypeCommentLink" source="_BmZ1oF7SEeaPkdSwTkaxow" target="_D6G9oF7SEeaPkdSwTkaxow"> + <styles xmi:type="notation:FontStyle" xmi:id="_D6HksV7SEeaPkdSwTkaxow"/> + <styles xmi:type="notation:EObjectValueStyle" xmi:id="_D6HktV7SEeaPkdSwTkaxow" name="BASE_ELEMENT"> + <eObjectValue xmi:type="uml:Class" href="model.uml#_BmNBUF7SEeaPkdSwTkaxow"/> + </styles> + <element xsi:nil="true"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_D6Hksl7SEeaPkdSwTkaxow" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_D6Hks17SEeaPkdSwTkaxow"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_D6HktF7SEeaPkdSwTkaxow"/> + </edges> + <edges xmi:type="notation:Connector" xmi:id="_fd6K5F8UEeanR5YAO7M9Zg" type="StereotypeCommentLink" source="_6sZAUF8SEeanR5YAO7M9Zg" target="_fd6K4F8UEeanR5YAO7M9Zg"> + <styles xmi:type="notation:FontStyle" xmi:id="_fd6K5V8UEeanR5YAO7M9Zg"/> + <styles xmi:type="notation:EObjectValueStyle" xmi:id="_fd6x8l8UEeanR5YAO7M9Zg" name="BASE_ELEMENT"> + <eObjectValue xmi:type="uml:Class" href="model.uml#_6sXLIF8SEeanR5YAO7M9Zg"/> + </styles> + <element xsi:nil="true"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_fd6K5l8UEeanR5YAO7M9Zg" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_fd6x8F8UEeanR5YAO7M9Zg"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_fd6x8V8UEeanR5YAO7M9Zg"/> + </edges> + <edges xmi:type="notation:Connector" xmi:id="_gf3XIF8UEeanR5YAO7M9Zg" type="StereotypeCommentLink" source="_68KhsF8SEeanR5YAO7M9Zg" target="_gf2wF18UEeanR5YAO7M9Zg"> + <styles xmi:type="notation:FontStyle" xmi:id="_gf3XIV8UEeanR5YAO7M9Zg"/> + <styles xmi:type="notation:EObjectValueStyle" xmi:id="_gf3XJV8UEeanR5YAO7M9Zg" name="BASE_ELEMENT"> + <eObjectValue xmi:type="uml:Class" href="model.uml#_68J6oF8SEeanR5YAO7M9Zg"/> + </styles> + <element xsi:nil="true"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_gf3XIl8UEeanR5YAO7M9Zg" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_gf3XI18UEeanR5YAO7M9Zg"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_gf3XJF8UEeanR5YAO7M9Zg"/> + </edges> +</notation:Diagram> diff --git a/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/resources/IconsAppliedStereotypes/model.uml b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/resources/IconsAppliedStereotypes/model.uml new file mode 100644 index 00000000000..ea3d1dc2098 --- /dev/null +++ b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/resources/IconsAppliedStereotypes/model.uml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xmi:XMI xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:RootElement="http:///schemas/RootElement/_abWP8F8UEeanR5YAO7M9Zg/3" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xsi:schemaLocation="http:///schemas/RootElement/_abWP8F8UEeanR5YAO7M9Zg/3 profile.profile.uml#_abW3AF8UEeanR5YAO7M9Zg"> + <uml:Model xmi:id="_myp30F44EeaaapfdY6krmg" name="RootElement"> + <packagedElement xmi:type="uml:Class" xmi:id="_n3jqYF44EeaaapfdY6krmg" name="Class1"/> + <packagedElement xmi:type="uml:Class" xmi:id="_BmNBUF7SEeaPkdSwTkaxow" name="Class2"/> + <packagedElement xmi:type="uml:Class" xmi:id="_6sXLIF8SEeanR5YAO7M9Zg" name="Class3"/> + <packagedElement xmi:type="uml:Class" xmi:id="_68J6oF8SEeanR5YAO7M9Zg" name="Class4"/> + <profileApplication xmi:type="uml:ProfileApplication" xmi:id="_r37IgF44EeaaapfdY6krmg"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_dyvpkF8UEeanR5YAO7M9Zg" source="PapyrusVersion"> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_dyvpkV8UEeanR5YAO7M9Zg" key="Version" value="0.0.4"/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_dyvpkl8UEeanR5YAO7M9Zg" key="Comment" value=""/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_dyvpk18UEeanR5YAO7M9Zg" key="Copyright" value=""/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_dyvplF8UEeanR5YAO7M9Zg" key="Date" value="2016-08-10"/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_dyvplV8UEeanR5YAO7M9Zg" key="Author" value=""/> + </eAnnotations> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_r389sF44EeaaapfdY6krmg" source="http://www.eclipse.org/uml2/2.0.0/UML"> + <references xmi:type="ecore:EPackage" href="profile.profile.uml#_abW3AF8UEeanR5YAO7M9Zg"/> + </eAnnotations> + <appliedProfile xmi:type="uml:Profile" href="profile.profile.uml#_-fvxgF4zEeaaapfdY6krmg"/> + </profileApplication> + </uml:Model> + <RootElement:Stereotype1 xmi:id="_u0lt8F44EeaaapfdY6krmg" base_Class="_n3jqYF44EeaaapfdY6krmg"/> + <RootElement:Stereotype2 xmi:id="_u07sMF44EeaaapfdY6krmg" base_Class="_n3jqYF44EeaaapfdY6krmg"/> + <RootElement:Stereotype2 xmi:id="_D6Z4kF7SEeaPkdSwTkaxow" base_Class="_BmNBUF7SEeaPkdSwTkaxow"/> + <RootElement:Stereotype1 xmi:id="_D5vxQF7SEeaPkdSwTkaxow" base_Class="_BmNBUF7SEeaPkdSwTkaxow"/> + <RootElement:Stereotype1 xmi:id="_fdpsMF8UEeanR5YAO7M9Zg" base_Class="_6sXLIF8SEeanR5YAO7M9Zg"/> + <RootElement:Stereotype3 xmi:id="_feINUF8UEeanR5YAO7M9Zg" base_Class="_6sXLIF8SEeanR5YAO7M9Zg"/> + <RootElement:Stereotype3 xmi:id="_ggDkYF8UEeanR5YAO7M9Zg" base_Class="_68J6oF8SEeanR5YAO7M9Zg"/> + <RootElement:Stereotype1 xmi:id="_gfpUsF8UEeanR5YAO7M9Zg" base_Class="_68J6oF8SEeanR5YAO7M9Zg"/> +</xmi:XMI> diff --git a/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/resources/IconsAppliedStereotypes/profile.profile.di b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/resources/IconsAppliedStereotypes/profile.profile.di new file mode 100644 index 00000000000..bf9abab340f --- /dev/null +++ b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/resources/IconsAppliedStereotypes/profile.profile.di @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/> diff --git a/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/resources/IconsAppliedStereotypes/profile.profile.notation b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/resources/IconsAppliedStereotypes/profile.profile.notation new file mode 100644 index 00000000000..592ac057b8f --- /dev/null +++ b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/resources/IconsAppliedStereotypes/profile.profile.notation @@ -0,0 +1,111 @@ +<?xml version="1.0" encoding="UTF-8"?> +<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/papyrus/infra/viewpoints/policy/style" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_AJZ28F40EeaaapfdY6krmg" type="PapyrusUMLProfileDiagram" name="ProfileDiagram" measurementUnit="Pixel"> + <children xmi:type="notation:Shape" xmi:id="_Bu4nAF40EeaaapfdY6krmg" type="Stereotype_Shape"> + <children xmi:type="notation:DecorationNode" xmi:id="_BvKT0F40EeaaapfdY6krmg" type="Stereotype_NameLabel"/> + <children xmi:type="notation:BasicCompartment" xmi:id="_BvNXIF40EeaaapfdY6krmg" type="Stereotype_AttributeCompartment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_BvNXIV40EeaaapfdY6krmg"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_BvNXIl40EeaaapfdY6krmg"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_BvNXI140EeaaapfdY6krmg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_BvNXJF40EeaaapfdY6krmg"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_BvNXJV40EeaaapfdY6krmg" type="Stereotype_OperationCompartment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_BvNXJl40EeaaapfdY6krmg"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_BvNXJ140EeaaapfdY6krmg"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_BvNXKF40EeaaapfdY6krmg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_BvNXKV40EeaaapfdY6krmg"/> + </children> + <element xmi:type="uml:Stereotype" href="profile.profile.uml#_BurLoF40EeaaapfdY6krmg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Bu4nAV40EeaaapfdY6krmg" x="64" y="245" width="119"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_CII0gF40EeaaapfdY6krmg" type="Stereotype_Shape"> + <children xmi:type="notation:DecorationNode" xmi:id="_CIJbkF40EeaaapfdY6krmg" type="Stereotype_NameLabel"/> + <children xmi:type="notation:BasicCompartment" xmi:id="_CIKCoF40EeaaapfdY6krmg" type="Stereotype_AttributeCompartment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_CIKCoV40EeaaapfdY6krmg"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_CIKCol40EeaaapfdY6krmg"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_CIKCo140EeaaapfdY6krmg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_CIKCpF40EeaaapfdY6krmg"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_CIKCpV40EeaaapfdY6krmg" type="Stereotype_OperationCompartment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_CIKCpl40EeaaapfdY6krmg"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_CIKCp140EeaaapfdY6krmg"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_CIKCqF40EeaaapfdY6krmg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_CIKCqV40EeaaapfdY6krmg"/> + </children> + <element xmi:type="uml:Stereotype" href="profile.profile.uml#_CIG_UF40EeaaapfdY6krmg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_CII0gV40EeaaapfdY6krmg" x="276" y="249" width="108"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_OnKhAF40EeaaapfdY6krmg" type="Class_MetaclassShape"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_OnOLYF40EeaaapfdY6krmg" source="Stereotype_Annotation"> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_OnOLYV40EeaaapfdY6krmg" key="StereotypeWithQualifiedNameList" value=""/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_OnOLYl40EeaaapfdY6krmg" key="StereotypeList" value="StandardProfile::Metaclass"/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_OnOLY140EeaaapfdY6krmg" key="Stereotype_Presentation_Kind" value="HorizontalStereo"/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_OnOLZF40EeaaapfdY6krmg" key="PropStereoDisplay" value=""/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_OnOLZV40EeaaapfdY6krmg" key="StereotypePropertyLocation" value="Compartment"/> + </eAnnotations> + <children xmi:type="notation:DecorationNode" xmi:id="_OnLIEF40EeaaapfdY6krmg" type="Class_MetaclassNameLabel"/> + <element xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Class"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_OnLIEV40EeaaapfdY6krmg" x="278" y="93"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_On7WAF40EeaaapfdY6krmg" type="StereotypeComment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_On7WAV40EeaaapfdY6krmg"/> + <styles xmi:type="notation:EObjectValueStyle" xmi:id="_On79EF40EeaaapfdY6krmg" name="BASE_ELEMENT"> + <eObjectValue xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Class"/> + </styles> + <element xsi:nil="true"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_On7WAl40EeaaapfdY6krmg" x="666" y="182"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_ysUycF8SEeanR5YAO7M9Zg" type="Stereotype_Shape"> + <children xmi:type="notation:DecorationNode" xmi:id="_ysWnoF8SEeanR5YAO7M9Zg" type="Stereotype_NameLabel"/> + <children xmi:type="notation:BasicCompartment" xmi:id="_ysXOsF8SEeanR5YAO7M9Zg" type="Stereotype_AttributeCompartment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_ysXOsV8SEeanR5YAO7M9Zg"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_ysXOsl8SEeanR5YAO7M9Zg"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_ysXOs18SEeanR5YAO7M9Zg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_ysXOtF8SEeanR5YAO7M9Zg"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_ysXOtV8SEeanR5YAO7M9Zg" type="Stereotype_OperationCompartment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_ysXOtl8SEeanR5YAO7M9Zg"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_ysXOt18SEeanR5YAO7M9Zg"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_ysXOuF8SEeanR5YAO7M9Zg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_ysXOuV8SEeanR5YAO7M9Zg"/> + </children> + <element xmi:type="uml:Stereotype" href="profile.profile.uml#_ysNdsF8SEeanR5YAO7M9Zg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_ysUycV8SEeanR5YAO7M9Zg" x="490" y="251"/> + </children> + <styles xmi:type="notation:StringValueStyle" xmi:id="_AJZ28V40EeaaapfdY6krmg" name="diagram_compatibility_version" stringValue="1.2.0"/> + <styles xmi:type="notation:DiagramStyle" xmi:id="_AJZ28l40EeaaapfdY6krmg"/> + <styles xmi:type="style:PapyrusViewStyle" xmi:id="_AJZ28140EeaaapfdY6krmg"> + <owner xmi:type="uml:Profile" href="profile.profile.uml#_-fvxgF4zEeaaapfdY6krmg"/> + </styles> + <element xmi:type="uml:Profile" href="profile.profile.uml#_-fvxgF4zEeaaapfdY6krmg"/> + <edges xmi:type="notation:Connector" xmi:id="_On_ncF40EeaaapfdY6krmg" type="StereotypeCommentLink" source="_OnKhAF40EeaaapfdY6krmg" target="_On7WAF40EeaaapfdY6krmg"> + <styles xmi:type="notation:FontStyle" xmi:id="_On_ncV40EeaaapfdY6krmg"/> + <styles xmi:type="notation:EObjectValueStyle" xmi:id="_OoA1kF40EeaaapfdY6krmg" name="BASE_ELEMENT"> + <eObjectValue xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Class"/> + </styles> + <element xsi:nil="true"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_On_ncl40EeaaapfdY6krmg" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_OoAOgF40EeaaapfdY6krmg"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_OoAOgV40EeaaapfdY6krmg"/> + </edges> + <edges xmi:type="notation:Connector" xmi:id="_Sr3skF40EeaaapfdY6krmg" type="Extension_Edge" source="_CII0gF40EeaaapfdY6krmg" target="_OnKhAF40EeaaapfdY6krmg"> + <styles xmi:type="notation:FontStyle" xmi:id="_Sr3skV40EeaaapfdY6krmg"/> + <element xmi:type="uml:Extension" href="profile.profile.uml#_SrsGYF40EeaaapfdY6krmg"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_Sr3skl40EeaaapfdY6krmg" points="[770, 286, -643984, -643984]$[677, 199, -643984, -643984]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_Ssia8F40EeaaapfdY6krmg" id="(0.5277777777777778,0.0)"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_Ssia8V40EeaaapfdY6krmg" id="(0.54,1.0)"/> + </edges> + <edges xmi:type="notation:Connector" xmi:id="_TBpvUF40EeaaapfdY6krmg" type="Extension_Edge" source="_Bu4nAF40EeaaapfdY6krmg" target="_OnKhAF40EeaaapfdY6krmg"> + <styles xmi:type="notation:FontStyle" xmi:id="_TBpvUV40EeaaapfdY6krmg"/> + <element xmi:type="uml:Extension" href="profile.profile.uml#_TBf-UF40EeaaapfdY6krmg"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_TBpvUl40EeaaapfdY6krmg" points="[506, 286, -643984, -643984]$[587, 199, -643984, -643984]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_TB3xwF40EeaaapfdY6krmg" id="(0.8571428571428571,0.0)"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_TB3xwV40EeaaapfdY6krmg" id="(0.06,1.0)"/> + </edges> + <edges xmi:type="notation:Connector" xmi:id="_y9xHwF8SEeanR5YAO7M9Zg" type="Extension_Edge" source="_ysUycF8SEeanR5YAO7M9Zg" target="_OnKhAF40EeaaapfdY6krmg"> + <styles xmi:type="notation:FontStyle" xmi:id="_y9xHwV8SEeanR5YAO7M9Zg"/> + <element xmi:type="uml:Extension" href="profile.profile.uml#_y9jsYF8SEeanR5YAO7M9Zg"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_y9xHwl8SEeanR5YAO7M9Zg" points="[551, 266, -643984, -643984]$[378, 139, -643984, -643984]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_y-AYUF8SEeanR5YAO7M9Zg" id="(0.15,0.0)"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_y-AYUV8SEeanR5YAO7M9Zg" id="(1.0,0.92)"/> + </edges> +</notation:Diagram> diff --git a/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/resources/IconsAppliedStereotypes/profile.profile.uml b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/resources/IconsAppliedStereotypes/profile.profile.uml new file mode 100644 index 00000000000..6cba9f6f1dc --- /dev/null +++ b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/resources/IconsAppliedStereotypes/profile.profile.uml @@ -0,0 +1,140 @@ +<?xml version="1.0" encoding="UTF-8"?> +<uml:Profile xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_-fvxgF4zEeaaapfdY6krmg" name="RootElement" metaclassReference="_OnHdsF40EeaaapfdY6krmg"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_Uv6EEF44EeaaapfdY6krmg" source="http://www.eclipse.org/uml2/2.0.0/UML"> + <contents xmi:type="ecore:EPackage" xmi:id="_abW3AF8UEeanR5YAO7M9Zg" name="RootElement" nsURI="http:///schemas/RootElement/_abWP8F8UEeanR5YAO7M9Zg/3" nsPrefix="RootElement"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_abXeE18UEeanR5YAO7M9Zg" source="PapyrusVersion"> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_abXeFF8UEeanR5YAO7M9Zg" key="Version" value="0.0.4"/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_abXeFV8UEeanR5YAO7M9Zg" key="Comment" value=""/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_abXeFl8UEeanR5YAO7M9Zg" key="Copyright" value=""/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_abXeF18UEeanR5YAO7M9Zg" key="Date" value="2016-08-10"/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_abXeGF8UEeanR5YAO7M9Zg" key="Author" value=""/> + </eAnnotations> + <eClassifiers xmi:type="ecore:EClass" xmi:id="_abW3AV8UEeanR5YAO7M9Zg" name="Stereotype1"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_abW3Al8UEeanR5YAO7M9Zg" source="http://www.eclipse.org/uml2/2.0.0/UML" references="_BurLoF40EeaaapfdY6krmg"/> + <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_abW3A18UEeanR5YAO7M9Zg" name="base_Class" ordered="false" lowerBound="1"> + <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Class"/> + </eStructuralFeatures> + </eClassifiers> + <eClassifiers xmi:type="ecore:EClass" xmi:id="_abW3BV8UEeanR5YAO7M9Zg" name="Stereotype2"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_abW3Bl8UEeanR5YAO7M9Zg" source="http://www.eclipse.org/uml2/2.0.0/UML" references="_CIG_UF40EeaaapfdY6krmg"/> + <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_abW3B18UEeanR5YAO7M9Zg" name="base_Class" ordered="false" lowerBound="1"> + <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Class"/> + </eStructuralFeatures> + </eClassifiers> + <eClassifiers xmi:type="ecore:EClass" xmi:id="_abW3CV8UEeanR5YAO7M9Zg" name="Stereotype3"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_abW3Cl8UEeanR5YAO7M9Zg" source="http://www.eclipse.org/uml2/2.0.0/UML" references="_ysNdsF8SEeanR5YAO7M9Zg"/> + <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_abW3C18UEeanR5YAO7M9Zg" name="base_Class" ordered="false" lowerBound="1"> + <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Class"/> + </eStructuralFeatures> + </eClassifiers> + </contents> + <contents xmi:type="ecore:EPackage" xmi:id="_4x4bcV8SEeanR5YAO7M9Zg" name="RootElement" nsURI="http:///schemas/RootElement/_4x4bcF8SEeanR5YAO7M9Zg/2" nsPrefix="RootElement"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_4x5Cgl8SEeanR5YAO7M9Zg" source="PapyrusVersion"> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_4x5Cg18SEeanR5YAO7M9Zg" key="Version" value="0.0.3"/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_4x5ChF8SEeanR5YAO7M9Zg" key="Comment" value=""/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_4x5ChV8SEeanR5YAO7M9Zg" key="Copyright" value=""/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_4x5Chl8SEeanR5YAO7M9Zg" key="Date" value="2016-08-10"/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_4x5Ch18SEeanR5YAO7M9Zg" key="Author" value=""/> + </eAnnotations> + <eClassifiers xmi:type="ecore:EClass" xmi:id="_4x4bcl8SEeanR5YAO7M9Zg" name="Stereotype1"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_4x4bc18SEeanR5YAO7M9Zg" source="http://www.eclipse.org/uml2/2.0.0/UML" references="_BurLoF40EeaaapfdY6krmg"/> + <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_4x4bdF8SEeanR5YAO7M9Zg" name="base_Class" ordered="false" lowerBound="1"> + <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Class"/> + </eStructuralFeatures> + </eClassifiers> + <eClassifiers xmi:type="ecore:EClass" xmi:id="_4x4bdl8SEeanR5YAO7M9Zg" name="Stereotype2"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_4x4bd18SEeanR5YAO7M9Zg" source="http://www.eclipse.org/uml2/2.0.0/UML" references="_CIG_UF40EeaaapfdY6krmg"/> + <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_4x4beF8SEeanR5YAO7M9Zg" name="base_Class" ordered="false" lowerBound="1"> + <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Class"/> + </eStructuralFeatures> + </eClassifiers> + <eClassifiers xmi:type="ecore:EClass" xmi:id="_4x4bel8SEeanR5YAO7M9Zg" name="Stereotype3"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_4x4be18SEeanR5YAO7M9Zg" source="http://www.eclipse.org/uml2/2.0.0/UML" references="_ysNdsF8SEeanR5YAO7M9Zg"/> + <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_4x4bfF8SEeanR5YAO7M9Zg" name="base_Class" ordered="false" lowerBound="1"> + <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Class"/> + </eStructuralFeatures> + </eClassifiers> + </contents> + <contents xmi:type="ecore:EPackage" xmi:id="_6VfOIF8QEeanR5YAO7M9Zg" name="RootElement" nsURI="http:///schemas/RootElement/_6VeAAF8QEeanR5YAO7M9Zg/1" nsPrefix="RootElement"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_6VhDUl8QEeanR5YAO7M9Zg" source="PapyrusVersion"> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_6VhDU18QEeanR5YAO7M9Zg" key="Version" value="0.0.2"/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_6VhDVF8QEeanR5YAO7M9Zg" key="Comment" value=""/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_6VhDVV8QEeanR5YAO7M9Zg" key="Copyright" value=""/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_6VhDVl8QEeanR5YAO7M9Zg" key="Date" value="2016-08-10"/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_6VhDV18QEeanR5YAO7M9Zg" key="Author" value=""/> + </eAnnotations> + <eClassifiers xmi:type="ecore:EClass" xmi:id="_6VfOIV8QEeanR5YAO7M9Zg" name="Stereotype1"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_6VfOIl8QEeanR5YAO7M9Zg" source="http://www.eclipse.org/uml2/2.0.0/UML" references="_BurLoF40EeaaapfdY6krmg"/> + <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_6VfOI18QEeanR5YAO7M9Zg" name="base_Class" ordered="false" lowerBound="1"> + <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Class"/> + </eStructuralFeatures> + </eClassifiers> + <eClassifiers xmi:type="ecore:EClass" xmi:id="_6VfOJV8QEeanR5YAO7M9Zg" name="Stereotype2"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_6VfOJl8QEeanR5YAO7M9Zg" source="http://www.eclipse.org/uml2/2.0.0/UML" references="_CIG_UF40EeaaapfdY6krmg"/> + <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_6VfOJ18QEeanR5YAO7M9Zg" name="base_Class" ordered="false" lowerBound="1"> + <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Class"/> + </eStructuralFeatures> + </eClassifiers> + </contents> + <contents xmi:type="ecore:EPackage" xmi:id="_Uv6rIF44EeaaapfdY6krmg" name="RootElement" nsURI="http:///schemas/RootElement/_Uv418F44EeaaapfdY6krmg/0" nsPrefix="RootElement"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_Uv75Ql44EeaaapfdY6krmg" source="PapyrusVersion"> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_Uv75Q144EeaaapfdY6krmg" key="Version" value="0.0.1"/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_Uv75RF44EeaaapfdY6krmg" key="Comment" value=""/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_Uv75RV44EeaaapfdY6krmg" key="Copyright" value=""/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_Uv75Rl44EeaaapfdY6krmg" key="Date" value="2016-08-09"/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_Uv75R144EeaaapfdY6krmg" key="Author" value=""/> + </eAnnotations> + <eClassifiers xmi:type="ecore:EClass" xmi:id="_Uv6rIV44EeaaapfdY6krmg" name="Stereotype1"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_Uv6rIl44EeaaapfdY6krmg" source="http://www.eclipse.org/uml2/2.0.0/UML" references="_BurLoF40EeaaapfdY6krmg"/> + <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_Uv6rI144EeaaapfdY6krmg" name="base_Class" ordered="false" lowerBound="1"> + <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Class"/> + </eStructuralFeatures> + </eClassifiers> + <eClassifiers xmi:type="ecore:EClass" xmi:id="_Uv6rJV44EeaaapfdY6krmg" name="Stereotype2"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_Uv6rJl44EeaaapfdY6krmg" source="http://www.eclipse.org/uml2/2.0.0/UML" references="_CIG_UF40EeaaapfdY6krmg"/> + <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_Uv6rJ144EeaaapfdY6krmg" name="base_Class" ordered="false" lowerBound="1"> + <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Class"/> + </eStructuralFeatures> + </eClassifiers> + </contents> + </eAnnotations> + <elementImport xmi:type="uml:ElementImport" xmi:id="_OnHdsF40EeaaapfdY6krmg" alias="Class"> + <importedElement xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Class"/> + </elementImport> + <packagedElement xmi:type="uml:Stereotype" xmi:id="_BurLoF40EeaaapfdY6krmg" name="Stereotype1"> + <ownedAttribute xmi:type="uml:Property" xmi:id="_TBglYF40EeaaapfdY6krmg" name="base_Class" association="_TBf-UF40EeaaapfdY6krmg"> + <type xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Class"/> + </ownedAttribute> + <icon xmi:type="uml:Image" xmi:id="_Jo1m8F8SEeanR5YAO7M9Zg" content="-119%80%78%71%13%10%26%10%0%0%0%13%73%72%68%82%0%0%0%16%0%0%0%16%8%6%0%0%0%31%-13%-1%97%0%0%0%4%103%65%77%65%0%0%-81%-56%55%5%-118%-23%0%0%0%25%116%69%88%116%83%111%102%116%119%97%114%101%0%65%100%111%98%101%32%73%109%97%103%101%82%101%97%100%121%113%-55%101%60%0%0%2%32%73%68%65%84%120%-38%-92%83%-67%107%20%65%20%127%55%-101%-69%-36%-27%22%-55%69%-82%-16%84%36%-107%17%99%-93%72%48%106%101%-95%-123%-96%96%35%4%-82%17%82%8%22%-121%-123%-123%-123%-107%72%-70%-8%15%68%17%27%-117%20%87%-120%-112%63%32%23%2%-110%66%77%-64%-62%-29%8%-71%92%-116%30%-71%-67%-20%-18%124%-19%-116%111%102%-77%75%68%78%-63%60%120%-20%99%103%127%31%-17%-51%-37%-116%-42%26%6%68%6%115%-32%97%18%-28%47%103%-1%4%-101%24%58%84%59%-83%-91%-115%-5%74%-86%-57%-108%-55%-77%30%-41%-123%-75%-81%93%-8%-55%34%-51%-71%20%66%-56%53%47%-92%-17%2%-54%23%23%94%-49%108%-90%54%-109%22%-102%31%-66%-52%-25%-57%-118%-77%-47%-112%83%104%-19%-8%-80%-34%-12%-96%-35%-10%-128%115%1%-116%115%8%-103%-64%100%16%-122%-76%30%-124%108%-82%94%127%-40%72%90%-56%-84%-65%93%-67%77%28%-14%-128%-116%100%11%-22%-40%8%-120%-31%28%-28%-117%89%4%-58%96%-54%76%26%-80%-51%59%72%-14%-28%-38%-11%23%-89%83%2%66%-56%83%17%112%119%-73%75%-95%-3%-35%7%74%81%45%96%41%56%-92%-36%40%-37%12%40%-110%80%36%-95%-12%94%74%0%14%76%6%63%124%104%109%-11%-95%-45%-23%-61%-10%-74%-79%-65%-121%96%17%-125%17%20%-40%60%32%9%45%-55%-51%100%-120%17%16%82%-36%-71%48%14%57%-13%2%71%-110%59%81%-126%-14%68%5%100%-92%32%82%58%126%70%26%19%108%45%-107%-126%-3%94%-1%86%122%11%102%-116%-18%-14%6%44%117%24%-12%-47%-66%-23%-41%90%13%-115%122%-84%24%-48%68%-103%90%87%-40%-38%110%-83%122%49%38%-120%-124%-14%-9%-89%-49%-71%-45%88%-93%-96%85%85%-119%-14%96%7%-27%-44%1%126%-12%-87%-12%-71%121%-27%-29%-73%46%-84%110%-19%-95%26%63%-24%53%30%-102%85%-58%-38%56%51%115%49%-125%-59%-59%-88%-43%-86%-81%-30%77%68%-58%-25%36%-97%-19%-99%41%23%-31%-8%48%73%7%-107%-126%-115%109%115%27%-104%12%9%112%-87%-22%66%70%-117%-23%42%87%38%43%-17%69%-92%94%-106%-54%110%-17%-22%-7%-109%48%113%-86%-124%45%72%-21%-32%80%-49%8%-106%-128%75%-119%96%57%-57%-68%55%-101%-65%-3%11%83%-43%-87%103%66%-88%-103%-79%-47%124%-29%-58%-91%113%127%-10%-18%101%93%25%117%53%-47%90%33%27%-53%58%-103%21%99%27%-43%31%33%-72%-15%-57%42%-1%111%16%56%98%-4%18%96%0%75%-56%-86%38%92%78%-85%-12%0%0%0%0%73%69%78%68%-82%66%96%-126%" format="Papyrus" location=""> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_Jo1m8V8SEeanR5YAO7M9Zg" source="image_papyrus"> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_Jo1m8l8SEeanR5YAO7M9Zg" key="image_kind_key" value="icon"/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_Jo1m818SEeanR5YAO7M9Zg" key="image_name_key" value="eclipse_icon"/> + </eAnnotations> + </icon> + </packagedElement> + <packagedElement xmi:type="uml:Stereotype" xmi:id="_CIG_UF40EeaaapfdY6krmg" name="Stereotype2"> + <ownedAttribute xmi:type="uml:Property" xmi:id="_SruioF40EeaaapfdY6krmg" name="base_Class" association="_SrsGYF40EeaaapfdY6krmg"> + <type xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Class"/> + </ownedAttribute> + </packagedElement> + <packagedElement xmi:type="uml:Extension" xmi:id="_SrsGYF40EeaaapfdY6krmg" name="E_Stereotype2_Class1" memberEnd="_Srt7kF40EeaaapfdY6krmg _SruioF40EeaaapfdY6krmg"> + <ownedEnd xmi:type="uml:ExtensionEnd" xmi:id="_Srt7kF40EeaaapfdY6krmg" name="extension_Stereotype2" type="_CIG_UF40EeaaapfdY6krmg" aggregation="composite" association="_SrsGYF40EeaaapfdY6krmg"/> + </packagedElement> + <packagedElement xmi:type="uml:Extension" xmi:id="_TBf-UF40EeaaapfdY6krmg" name="E_Stereotype1_Class1" memberEnd="_TBf-UV40EeaaapfdY6krmg _TBglYF40EeaaapfdY6krmg"> + <ownedEnd xmi:type="uml:ExtensionEnd" xmi:id="_TBf-UV40EeaaapfdY6krmg" name="extension_Stereotype1" type="_BurLoF40EeaaapfdY6krmg" aggregation="composite" association="_TBf-UF40EeaaapfdY6krmg"/> + </packagedElement> + <packagedElement xmi:type="uml:Stereotype" xmi:id="_ysNdsF8SEeanR5YAO7M9Zg" name="Stereotype3"> + <ownedAttribute xmi:type="uml:Property" xmi:id="_y9mIoF8SEeanR5YAO7M9Zg" name="base_Class" association="_y9jsYF8SEeanR5YAO7M9Zg"> + <type xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Class"/> + </ownedAttribute> + <icon xmi:type="uml:Image" xmi:id="_2zFMcF8SEeanR5YAO7M9Zg" content="71%73%70%56%57%97%16%0%16%0%-11%51%0%27%24%27%51%48%51%93%91%93%71%69%70%121%119%121%120%-107%14%125%-99%44%96%-101%121%-120%-86%12%-116%-79%10%-106%-67%11%-103%-65%16%-127%-97%51%-113%-86%46%-102%-64%19%-86%-55%57%-95%-60%36%-119%-90%76%-77%-49%80%-65%-41%107%0%-111%-81%0%-102%-71%19%-119%-94%61%-113%-95%33%-116%-94%22%-93%-65%53%-92%-70%110%-93%-121%76%-103%-86%77%-94%-96%104%-89%-86%117%-87%-76%40%-88%-62%-118%-119%-117%-104%-106%-104%-116%-93%-125%-73%-73%-72%-82%-83%-82%-58%-43%-114%-49%-31%-112%-45%-29%-104%-43%-36%-69%-30%-20%-67%-66%-52%-48%-51%-48%-64%-55%-48%-46%-30%-28%-37%-22%-15%-45%-36%-30%-28%-23%-22%-22%-13%-8%-27%-1%-1%-1%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%33%-7%4%1%10%0%51%0%44%0%0%0%0%16%0%16%0%0%6%121%-64%-103%112%72%44%26%-117%46%-106%-21%72%124%53%18%10%-60%40%86%-116%-119%4%-125%-121%-94%80%80%48%62%-60%16%96%28%-112%40%-50%-118%-122%-90%37%20%-116%5%34%-110%11%53%57%71%50%96%49%-127%74%-108%57%20%27%21%28%49%1%36%71%102%6%32%-126%37%-122%70%40%81%29%21%21%31%44%71%50%16%10%7%-110%20%43%76%39%94%-118%21%23%76%51%90%-127%21%22%48%76%50%11%10%30%21%24%-86%76%42%10%9%30%96%-92%51%47%38%41%-71%-66%51%65%0%59%" format="Papyrus"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_2zFMcV8SEeanR5YAO7M9Zg" source="image_papyrus"> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_2zFMcl8SEeanR5YAO7M9Zg" key="image_kind_key" value="icon"/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_2zFMc18SEeanR5YAO7M9Zg" key="image_name_key" value="papyrus_icon"/> + </eAnnotations> + </icon> + </packagedElement> + <packagedElement xmi:type="uml:Extension" xmi:id="_y9jsYF8SEeanR5YAO7M9Zg" name="E_Stereotype3_Class1" memberEnd="_y9lhkF8SEeanR5YAO7M9Zg _y9mIoF8SEeanR5YAO7M9Zg"> + <ownedEnd xmi:type="uml:ExtensionEnd" xmi:id="_y9lhkF8SEeanR5YAO7M9Zg" name="extension_Stereotype3" type="_ysNdsF8SEeanR5YAO7M9Zg" aggregation="composite" association="_y9jsYF8SEeanR5YAO7M9Zg"/> + </packagedElement> +</uml:Profile> diff --git a/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/src/org/eclipse/papyrus/uml/tools/tests/tests/AllTests.java b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/src/org/eclipse/papyrus/uml/tools/tests/tests/AllTests.java index 2d3cdfeda08..2b6d10dcccd 100644 --- a/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/src/org/eclipse/papyrus/uml/tools/tests/tests/AllTests.java +++ b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/src/org/eclipse/papyrus/uml/tools/tests/tests/AllTests.java @@ -24,7 +24,7 @@ import org.junit.runners.Suite.SuiteClasses; @RunWith(ClassificationSuite.class) @SuiteClasses({ ContentProviderTest.class, UMLStereotypePropertyContentProviderTest.class, DependencyManagementTest.class, NamedElementValidatorTest.class, StereotypeElementListenerTest.class, ProfileApplicationListenerTest.class, UMLReferenceConverterTest.class, UMLReferenceConverterCompletionTest.class, - UMLLanguageProvidersTest.class, + UMLLanguageProvidersTest.class, IconsStereotypesTest.class, }) public class AllTests { diff --git a/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/src/org/eclipse/papyrus/uml/tools/tests/tests/IconsStereotypesTest.java b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/src/org/eclipse/papyrus/uml/tools/tests/tests/IconsStereotypesTest.java new file mode 100644 index 00000000000..dcdbb3269ea --- /dev/null +++ b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/src/org/eclipse/papyrus/uml/tools/tests/tests/IconsStereotypesTest.java @@ -0,0 +1,326 @@ +/***************************************************************************** + * Copyright (c) 2016 CEA LIST 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: + * Fanch BONNABESSE (ALL4TEC) fanch.bonnabesse@all4tec.net - Initial API and implementation, Bug 486553 + * + *****************************************************************************/ + +package org.eclipse.papyrus.uml.tools.tests.tests; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.jface.resource.ImageRegistry; +import org.eclipse.jface.viewers.ILabelProvider; +import org.eclipse.papyrus.infra.core.services.ServiceException; +import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForEObject; +import org.eclipse.papyrus.infra.services.labelprovider.service.LabelProviderService; +import org.eclipse.papyrus.junit.utils.rules.PapyrusEditorFixture; +import org.eclipse.papyrus.junit.utils.rules.PluginResource; +import org.eclipse.papyrus.uml.tools.Activator; +import org.eclipse.papyrus.uml.tools.utils.ImageUtil; +import org.eclipse.swt.graphics.Image; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.Profile; +import org.eclipse.uml2.uml.Stereotype; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; + +/** + * This class validate that the icon displayed for classes with applied stereotypes is well than expected. + */ +@PluginResource("/resources/IconsAppliedStereotypes/model.di") +public class IconsStereotypesTest { + + /** Model set rule to have an editing domain. */ + @Rule + public final PapyrusEditorFixture editorFixture = new PapyrusEditorFixture(); + + /** Profile Name. */ + private static final String PROFILE_NAME = "RootElement"; //$NON-NLS-1$ + + /** Class1 name. */ + private static final String CLASS_1_NAME = "Class1"; //$NON-NLS-1$ + + /** Class2 name. */ + private static final String CLASS_2_NAME = "Class2"; //$NON-NLS-1$ + + /** Class3 name. */ + private static final String CLASS_3_NAME = "Class3"; //$NON-NLS-1$ + + /** Class4 name. */ + private static final String CLASS_4_NAME = "Class4"; //$NON-NLS-1$ + + /** Stereotype1 Name. */ + private static final String STEREOTYPE_1_NAME = "Stereotype1"; //$NON-NLS-1$ + + /** Stereotype2 Name. */ + private static final String STEREOTYPE_2_NAME = "Stereotype2"; //$NON-NLS-1$ + + /** Stereotype3 Name. */ + private static final String STEREOTYPE_3_NAME = "Stereotype3"; //$NON-NLS-1$ + + /** Stereotype1 element. This stereotype contains an icon. */ + private Stereotype stereotype1 = null; + + /** Stereotype2 element. This stereotype does not contain icon. */ + private Stereotype stereotype2 = null; + + /** Stereotype3 element. This stereotype contains an icon. */ + private Stereotype stereotype3 = null; + + /** UML NamedElement of the Class1. This class contains 2 applied stereotypes (Stereotype1, Stereotype2). */ + private NamedElement class1 = null; + + /** UML NamedElement of the Class2. This class contains 2 applied stereotypes (Stereotype2, Stereotype1). */ + private NamedElement class2 = null; + + /** UML NamedElement of the Class3. This class contains 2 applied stereotypes (Stereotype1, Stereotype3). */ + private NamedElement class3 = null; + + /** UML NamedElement of the Class4. This class contains 2 applied stereotypes (Stereotype3, Stereotype1). */ + private NamedElement class4 = null; + + /** Profile that has been applied. */ + private Profile profile = null; + + /** The Image Registry. */ + private ImageRegistry imageRegistry = null; + + /** The Label Provider Service. */ + // private LabelProviderService labelProviderService = null; + + /** The Label Provider. */ + private ILabelProvider labelProvider = null; + + /** + * Initialization of the test cases. + */ + @Before + public void init() { + // Verify if profile is correctly imported + Package model = editorFixture.getModel(); + assertNotNull("The model cannot be null", model); //$NON-NLS-1$ + assertFalse("The model must contain ProfileApplications references.", model.getProfileApplications().isEmpty()); //$NON-NLS-1$ + + // Retrieve registry + imageRegistry = Activator.getDefault().getImageRegistry(); + assertNotNull("The Image registry should not be null.", imageRegistry); //$NON-NLS-1$ + + // Initialize data (classes, profile, stereotypes ...) + profile = model.getAppliedProfile(PROFILE_NAME); + assertEquals("Profile is not the one Expected", PROFILE_NAME, profile.getName()); //$NON-NLS-1$ + + class1 = model.getMember(CLASS_1_NAME); + assertTrue("The element is a Class", class1 instanceof Class); //$NON-NLS-1$ + assertEquals("Element is not the one expected", CLASS_1_NAME, class1.getName()); //$NON-NLS-1$ + + class2 = model.getMember(CLASS_2_NAME); + assertTrue("The element is a Class", class2 instanceof Class); //$NON-NLS-1$ + assertEquals("Element is not the one expected", CLASS_2_NAME, class2.getName()); //$NON-NLS-1$ + + class3 = model.getMember(CLASS_3_NAME); + assertTrue("The element is a Class", class3 instanceof Class); //$NON-NLS-1$ + assertEquals("Element is not the one expected", CLASS_3_NAME, class3.getName()); //$NON-NLS-1$ + + class4 = model.getMember(CLASS_4_NAME); + assertTrue("The element is a Class", class4 instanceof Class); //$NON-NLS-1$ + assertEquals("Element is not the one expected", CLASS_4_NAME, class4.getName()); //$NON-NLS-1$ + + stereotype1 = profile.getOwnedStereotype(STEREOTYPE_1_NAME); + assertEquals("Stereotype is not the one expected", STEREOTYPE_1_NAME, stereotype1.getName()); //$NON-NLS-1$ + + stereotype2 = profile.getOwnedStereotype(STEREOTYPE_2_NAME); + assertEquals("Stereotype is not the one expected", STEREOTYPE_2_NAME, stereotype2.getName()); //$NON-NLS-1$ + + stereotype3 = profile.getOwnedStereotype(STEREOTYPE_3_NAME); + assertEquals("Stereotype is not the one expected", STEREOTYPE_3_NAME, stereotype3.getName()); //$NON-NLS-1$ + } + + /** + * Validation of the applied stereotypes of the Class1. + */ + @Test + public void ValidationStereotypesListClass1Test() { + EList<Stereotype> appliedStereotypes = class1.getAppliedStereotypes(); + + // This class must contain 2 stereotypes: Stereotype1, Stereotype2 + List<Stereotype> expectedStereotypes = new ArrayList<Stereotype>(); + expectedStereotypes.add(stereotype1); + expectedStereotypes.add(stereotype2); + + assertEquals("The stereotypes applied on the class must be the same as the expected stereotypes.", appliedStereotypes, expectedStereotypes); //$NON-NLS-1$ + } + + /** + * Validation of the icon of Class1 via the LabelProvider. + * + * @throws ServiceException + */ + @Test + public void ValidationImageClass1Test() throws ServiceException { + NamedElement checkedClass = class1; + + LabelProviderService labelProviderService = ServiceUtilsForEObject.getInstance().getService(LabelProviderService.class, checkedClass); + assertNotNull("The service should not be null.", labelProviderService); //$NON-NLS-1$ + + labelProvider = labelProviderService.getLabelProvider(checkedClass); + assertNotNull("The Label Provider should not be null.", labelProvider); //$NON-NLS-1$ + + // The expected image is the icon of the Stereotype1. + checkExpectedImage(checkedClass, stereotype1); + } + + /** + * Validation of the applied stereotypes of the Class2. + */ + @Test + public void ValidationStereotypesListClass2Test() { + EList<Stereotype> appliedStereotypes = class2.getAppliedStereotypes(); + + // This class must contain 2 stereotypes: Stereotype2, Stereotype1 + List<Stereotype> expectedStereotypes = new ArrayList<Stereotype>(); + expectedStereotypes.add(stereotype2); + expectedStereotypes.add(stereotype1); + + assertEquals("The stereotypes applied on the class must be the same as the expected stereotypes.", appliedStereotypes, expectedStereotypes); //$NON-NLS-1$ + } + + /** + * Validation of the icon of Class2 via the LabelProvider. + * + * @throws ServiceException + */ + @Test + public void ValidationImageClass2Test() throws ServiceException { + NamedElement checkedClass = class2; + + LabelProviderService labelProviderService = ServiceUtilsForEObject.getInstance().getService(LabelProviderService.class, checkedClass); + assertNotNull("The service should not be null.", labelProviderService); //$NON-NLS-1$ + + labelProvider = labelProviderService.getLabelProvider(checkedClass); + assertNotNull("The Label Provider should not be null.", labelProvider); //$NON-NLS-1$ + + // The expected image is the icon of the Stereotype1. + checkExpectedImage(checkedClass, stereotype1); + } + + /** + * Validation of the applied stereotypes of the Class3. + */ + @Test + public void ValidationStereotypesListClass3Test() { + EList<Stereotype> appliedStereotypes = class3.getAppliedStereotypes(); + + // This class must contain 2 stereotypes: Stereotype1, Stereotype3 + List<Stereotype> expectedStereotypes = new ArrayList<Stereotype>(); + expectedStereotypes.add(stereotype1); + expectedStereotypes.add(stereotype3); + + assertEquals("The stereotypes applied on the class must be the same as the expected stereotypes.", appliedStereotypes, expectedStereotypes); //$NON-NLS-1$ + } + + /** + * Validation of the icon of Class3 via the LabelProvider. + * + * @throws ServiceException + */ + @Test + public void ValidationImageClass3Test() throws ServiceException { + NamedElement checkedClass = class3; + + LabelProviderService labelProviderService = ServiceUtilsForEObject.getInstance().getService(LabelProviderService.class, checkedClass); + assertNotNull("The service should not be null.", labelProviderService); //$NON-NLS-1$ + + labelProvider = labelProviderService.getLabelProvider(checkedClass); + assertNotNull("The Label Provider should not be null.", labelProvider); //$NON-NLS-1$ + + // The expected image is the icon of the Stereotype1. + checkExpectedImage(checkedClass, stereotype1); + } + + /** + * Validation of the applied stereotypes of the Class4. + */ + @Test + public void ValidationStereotypesListClass4Test() { + EList<Stereotype> appliedStereotypes = class4.getAppliedStereotypes(); + + // This class must contain 2 stereotypes: Stereotype3, Stereotype1 + List<Stereotype> expectedStereotypes = new ArrayList<Stereotype>(); + expectedStereotypes.add(stereotype3); + expectedStereotypes.add(stereotype1); + + assertEquals("The stereotypes applied on the class must be the same as the expected stereotypes.", appliedStereotypes, expectedStereotypes); //$NON-NLS-1$ + } + + /** + * Validation of the icon of Class4 via the LabelProvider. + * + * @throws ServiceException + */ + @Test + public void ValidationImageClass4Test() throws ServiceException { + NamedElement checkedClass = class4; + + LabelProviderService labelProviderService = ServiceUtilsForEObject.getInstance().getService(LabelProviderService.class, checkedClass); + assertNotNull("The service should not be null.", labelProviderService); //$NON-NLS-1$ + + labelProvider = labelProviderService.getLabelProvider(checkedClass); + assertNotNull("The Label Provider should not be null.", labelProvider); //$NON-NLS-1$ + + // The expected image is the icon of the Stereotype3. + checkExpectedImage(checkedClass, stereotype3); + } + + /** + * Comparison of the displayed icon and the expected icon for an specific element. + * + * @param namedElement + * The NameElement to compare. + * @param stereotype + * The Stereotype which contains the expected icon. + */ + private void checkExpectedImage(final NamedElement namedElement, final Stereotype stereotype) { + Image image = labelProvider.getImage(namedElement); + assertNotNull("The image must not be null.", image); //$NON-NLS-1$ + + Image expectedImage = getStereotypeIcon(stereotype); + assertNotNull("The Stereotype must contain an icon.", expectedImage); //$NON-NLS-1$ + + assertEquals("The icon of the Element must be the same as the expected icon.", expectedImage, image); //$NON-NLS-1$ + } + + /** + * Getting of the image according to the stereotype. + * + * @param stereotype + * The Stereotype. + * @return The expected image. + */ + private Image getStereotypeIcon(final Stereotype stereotype) { + org.eclipse.uml2.uml.Image expectedImageUML = stereotype.getIcons().get(0); + assertNotNull("The Stereotype must contains an icon.", expectedImageUML); //$NON-NLS-1$ + + // Get image id for registry + String expectedImageId = ImageUtil.getImageId(expectedImageUML); + assertFalse("The String ID of the expected image must not be empty.", expectedImageId.isEmpty()); //$NON-NLS-1$ + + return imageRegistry.get(expectedImageId); + } +} |