Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Redor2015-11-04 11:46:08 +0000
committerMaxime Porhel2015-11-13 14:41:37 +0000
commit16b692e9000fd09a7c8506ca0bc21cd6553a38e3 (patch)
tree1a38b87c44e32f397ffe07a2544bb9c18ddee092
parent17827bf5fa3165e168db755cb07d157f9ee713f3 (diff)
downloadorg.eclipse.sirius-16b692e9000fd09a7c8506ca0bc21cd6553a38e3.tar.gz
org.eclipse.sirius-16b692e9000fd09a7c8506ca0bc21cd6553a38e3.tar.xz
org.eclipse.sirius-16b692e9000fd09a7c8506ca0bc21cd6553a38e3.zip
[481730] Correctly manage changes between SVG and others image kinds
If the image path is changed from a SVG to another format (or inverse), a new figure is now created instead of refresh the existing one. The test SetStyleToWorkspaceImageTests has been completed to test the fix. The data of this test has been completed with some nodes with workspace image style. Bug: 481730 Change-Id: I634473b75fe555e3005aa16d866316767e0639fb Signed-off-by: Laurent Redor <laurent.redor@obeo.fr> (cherry picked from commit 03c6987a4c35ff2c1c034281283423e32920bdb0)
-rw-r--r--plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/internal/part/DiagramContainerEditPartOperation.java40
-rw-r--r--plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/WorkspaceImageEditPart.java16
-rw-r--r--plugins/org.eclipse.sirius.tests.swtbot/data/unit/style/image.svg73
-rw-r--r--plugins/org.eclipse.sirius.tests.swtbot/data/unit/style/tc2225.aird155
-rw-r--r--plugins/org.eclipse.sirius.tests.swtbot/data/unit/style/tc2225.ecore3
-rw-r--r--plugins/org.eclipse.sirius.tests.swtbot/data/unit/style/tc2225.odesign30
-rw-r--r--plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/SetStyleToWorkspaceImageTests.java241
7 files changed, 501 insertions, 57 deletions
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/internal/part/DiagramContainerEditPartOperation.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/internal/part/DiagramContainerEditPartOperation.java
index 6a7326b4b5..ae6551b64e 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/internal/part/DiagramContainerEditPartOperation.java
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/internal/part/DiagramContainerEditPartOperation.java
@@ -167,10 +167,22 @@ public final class DiagramContainerEditPartOperation {
* how the style has evolved.
*/
private static void refreshBackgroundFigure(final AbstractDiagramElementContainerEditPart self, final ContainerStyle style) {
-
// Update the background figure when the workspace image path changes.
if (self.getBackgroundFigure() instanceof IWorkspaceImageFigure && style != null) {
- ((IWorkspaceImageFigure) self.getBackgroundFigure()).refreshFigure(style);
+ IWorkspaceImageFigure figure = (IWorkspaceImageFigure) self.getBackgroundFigure();
+ // Check if the figure is the right one (SVGWorkspaceImageFigure for
+ // SVG format, WorkspaceImageFigure for others kinds).
+ boolean needFigureChange = false;
+ if (style instanceof WorkspaceImage) {
+ needFigureChange = DiagramContainerEditPartOperation.needFigureChange((WorkspaceImage) style, figure);
+ }
+ if (needFigureChange) {
+ // Replace the wrong IWorkspaceImageFigure kind by the new one.
+ self.reInitFigure();
+ } else {
+ // Refresh the right IWorkspaceImageFigure kind
+ ((IWorkspaceImageFigure) self.getBackgroundFigure()).refreshFigure(style);
+ }
}
// Update the background figure when the background gradient style
@@ -523,4 +535,28 @@ public final class DiagramContainerEditPartOperation {
}
}
}
+
+ /**
+ * Check if the current <code>figure</code> is the right one
+ * (SVGWorkspaceImageFigure for SVG format, WorkspaceImageFigure for others
+ * kinds) according to the {@link WorkspaceImage} style.
+ *
+ * @param bundledImage
+ * the {@link WorkspaceImage} style
+ * @param figure
+ * The figure to check.
+ * @return true if a new figure must be create according to style
+ * <code>bundledImage</code>, false if the current figure can be
+ * used.
+ */
+ public static boolean needFigureChange(final WorkspaceImage bundledImage, IWorkspaceImageFigure figure) {
+ boolean result = false;
+ String workspacePath = bundledImage.getWorkspacePath();
+ if (!StringUtil.isEmpty(workspacePath) && WorkspaceImageFigure.isSvgImage(workspacePath)) {
+ result = !(figure instanceof SVGWorkspaceImageFigure);
+ } else {
+ result = !(figure instanceof WorkspaceImageFigure);
+ }
+ return result;
+ }
}
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/WorkspaceImageEditPart.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/WorkspaceImageEditPart.java
index 4ca8bf9790..fbefb6021b 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/WorkspaceImageEditPart.java
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/WorkspaceImageEditPart.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 THALES GLOBAL SERVICES.
+ * Copyright (c) 2007, 2015 THALES GLOBAL SERVICES.
* 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
@@ -31,6 +31,7 @@ import org.eclipse.sirius.diagram.ui.edit.api.part.AbstractNotSelectableShapeNod
import org.eclipse.sirius.diagram.ui.edit.api.part.IDiagramBorderNodeEditPart;
import org.eclipse.sirius.diagram.ui.edit.api.part.IStyleEditPart;
import org.eclipse.sirius.diagram.ui.edit.internal.part.DiagramBorderNodeEditPartOperation;
+import org.eclipse.sirius.diagram.ui.edit.internal.part.DiagramContainerEditPartOperation;
import org.eclipse.sirius.diagram.ui.edit.internal.part.DiagramElementEditPartOperation;
import org.eclipse.sirius.diagram.ui.edit.internal.part.DiagramNodeEditPartOperation;
import org.eclipse.sirius.diagram.ui.internal.edit.policies.FixedLayoutEditPolicy;
@@ -94,7 +95,18 @@ public class WorkspaceImageEditPart extends AbstractNotSelectableShapeNodeEditPa
EObject element = this.resolveSemanticElement();
if (element instanceof WorkspaceImage && figure != null) {
WorkspaceImage bundledImage = (WorkspaceImage) element;
- figure.refreshFigure(bundledImage);
+ // Check if the figure is the right one (SVGWorkspaceImageFigure for
+ // SVG format, WorkspaceImageFigure for others kinds).
+ if (DiagramContainerEditPartOperation.needFigureChange(bundledImage, figure)) {
+ // Replace the wrong IWorkspaceImageFigure kind by the new one.
+ getFigure().remove(figure);
+ IFigure shape = createNodeShape();
+ getFigure().add(shape);
+ contentPane = setupContentPane(shape);
+ } else {
+ // Refresh the right IWorkspaceImageFigure kind
+ figure.refreshFigure(bundledImage);
+ }
DiagramNodeEditPartOperation.refreshFigure(this);
DiagramElementEditPartOperation.refreshLabelAlignment(((GraphicalEditPart) getParent()).getContentPane(), bundledImage);
((GraphicalEditPart) this.getParent()).setLayoutConstraint(this, this.getFigure(), new Rectangle(0, 0, figure.getPreferredSize().width, figure.getPreferredSize().height));
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/data/unit/style/image.svg b/plugins/org.eclipse.sirius.tests.swtbot/data/unit/style/image.svg
new file mode 100644
index 0000000000..3c6537aaac
--- /dev/null
+++ b/plugins/org.eclipse.sirius.tests.swtbot/data/unit/style/image.svg
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="45.769531"
+ height="19.017822"
+ viewBox="0 0 45.769532 19.017822"
+ id="svg3515"
+ version="1.1"
+ inkscape:version="0.91 r13725"
+ sodipodi:docname="image.svg">
+ <defs
+ id="defs3517" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="11.2"
+ inkscape:cx="36.632601"
+ inkscape:cy="1.7365726"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ units="px"
+ inkscape:window-width="1871"
+ inkscape:window-height="1056"
+ inkscape:window-x="1969"
+ inkscape:window-y="24"
+ inkscape:window-maximized="1"
+ fit-margin-top="1"
+ fit-margin-left="1"
+ fit-margin-right="1"
+ fit-margin-bottom="1" />
+ <metadata
+ id="metadata3520">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Calque 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-0.84029734,-1032.788)">
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:22.5px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="0.35714304"
+ y="1050.4872"
+ id="text3523"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan3525"
+ x="0.35714304"
+ y="1050.4872">SVG</tspan></text>
+ </g>
+</svg>
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/data/unit/style/tc2225.aird b/plugins/org.eclipse.sirius.tests.swtbot/data/unit/style/tc2225.aird
index d01fc96f82..65b4ab0959 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/data/unit/style/tc2225.aird
+++ b/plugins/org.eclipse.sirius.tests.swtbot/data/unit/style/tc2225.aird
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
-<viewpoint:DAnalysis xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:description="http://www.eclipse.org/sirius/description/1.1.0" xmlns:description_1="http://www.eclipse.org/sirius/diagram/description/1.1.0" xmlns:diagram="http://www.eclipse.org/sirius/diagram/1.1.0" 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/sirius/diagram/description/style/1.1.0" xmlns:viewpoint="http://www.eclipse.org/sirius/1.1.0" xsi:schemaLocation="http://www.eclipse.org/sirius/description/1.1.0 http://www.eclipse.org/sirius/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/style/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description/style" xmi:id="_SZJdYJpZEd-PK6vZSn4rhA" selectedViews="_S1roYJpZEd-PK6vZSn4rhA" version="10.0.0.201412231738">
- <models xmi:type="ecore:EPackage" href="tc2225.ecore#/"/>
- <ownedViews xmi:type="viewpoint:DRepresentationContainer" xmi:id="_S1roYJpZEd-PK6vZSn4rhA" initialized="true">
+<viewpoint:DAnalysis xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:description="http://www.eclipse.org/sirius/description/1.1.0" xmlns:description_1="http://www.eclipse.org/sirius/diagram/description/1.1.0" xmlns:diagram="http://www.eclipse.org/sirius/diagram/1.1.0" 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/sirius/diagram/description/style/1.1.0" xmlns:viewpoint="http://www.eclipse.org/sirius/1.1.0" xsi:schemaLocation="http://www.eclipse.org/sirius/description/1.1.0 http://www.eclipse.org/sirius/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/style/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description/style" xmi:id="_SZJdYJpZEd-PK6vZSn4rhA" selectedViews="_S1roYJpZEd-PK6vZSn4rhA" version="10.1.0.201509162000">
+ <semanticResources>tc2225.ecore</semanticResources>
+ <ownedViews xmi:type="viewpoint:DRepresentationContainer" xmi:id="_S1roYJpZEd-PK6vZSn4rhA">
<ownedRepresentations xmi:type="diagram:DSemanticDiagram" xmi:id="_Tuh78JpZEd-PK6vZSn4rhA" name="2225 package entities">
<ownedAnnotationEntries xmi:type="description:AnnotationEntry" xmi:id="_TvLcMJpZEd-PK6vZSn4rhA" source="GMF_DIAGRAMS">
<data xmi:type="notation:Diagram" xmi:id="_TvLcMZpZEd-PK6vZSn4rhA" type="Sirius" element="_Tuh78JpZEd-PK6vZSn4rhA" measurementUnit="Pixel">
@@ -82,9 +82,67 @@
<styles xmi:type="notation:ShapeStyle" xmi:id="_Ty9wAZpZEd-PK6vZSn4rhA" fontName="Times New Roman" fontHeight="8"/>
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_Ty9wAppZEd-PK6vZSn4rhA" x="515" y="80"/>
</children>
+ <children xmi:type="notation:Node" xmi:id="_5jw2oIOgEeWepLXXty06hg" type="2001" element="_5jZqQIOgEeWepLXXty06hg">
+ <children xmi:type="notation:Node" xmi:id="_5j3kUIOgEeWepLXXty06hg" type="5002">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_5j3kUYOgEeWepLXXty06hg" y="-21"/>
+ </children>
+ <children xmi:type="notation:Node" xmi:id="_5kDxkIOgEeWepLXXty06hg" type="3001" element="_5jctkIOgEeWepLXXty06hg">
+ <children xmi:type="notation:Node" xmi:id="_5kDxk4OgEeWepLXXty06hg" type="5001">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_5kDxlIOgEeWepLXXty06hg" x="31" y="-5"/>
+ </children>
+ <children xmi:type="notation:Node" xmi:id="_OvwTQIOhEeWepLXXty06hg" type="3005" element="_Ovl7MIOhEeWepLXXty06hg">
+ <styles xmi:type="notation:ShapeStyle" xmi:id="_OvwTQYOhEeWepLXXty06hg" fontName="Ubuntu"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_OvwTQoOhEeWepLXXty06hg"/>
+ </children>
+ <styles xmi:type="notation:ShapeStyle" xmi:id="_5kDxkYOgEeWepLXXty06hg" fontName="Ubuntu" fontHeight="8"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_5kDxkoOgEeWepLXXty06hg" x="-22" width="30" height="30"/>
+ </children>
+ <children xmi:type="notation:Node" xmi:id="_-_bOEIOgEeWepLXXty06hg" type="3005" element="_-_MkkIOgEeWepLXXty06hg">
+ <styles xmi:type="notation:ShapeStyle" xmi:id="_-_bOEYOgEeWepLXXty06hg" fontName="Ubuntu"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_-_bOEoOgEeWepLXXty06hg"/>
+ </children>
+ <styles xmi:type="notation:ShapeStyle" xmi:id="_5jxdsIOgEeWepLXXty06hg" fontName="Ubuntu" fontHeight="8"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_5jxdsYOgEeWepLXXty06hg" x="90" y="275" width="100" height="70"/>
+ </children>
+ <children xmi:type="notation:Node" xmi:id="_5j_gIIOgEeWepLXXty06hg" type="2003" element="_5jgX8IOgEeWepLXXty06hg">
+ <children xmi:type="notation:Node" xmi:id="_5kAuQIOgEeWepLXXty06hg" type="5007"/>
+ <children xmi:type="notation:Node" xmi:id="_5kBVUIOgEeWepLXXty06hg" type="7004">
+ <children xmi:type="notation:Node" xmi:id="_5kG04IOgEeWepLXXty06hg" type="3010" element="_5jhmEIOgEeWepLXXty06hg">
+ <styles xmi:type="notation:FontStyle" xmi:id="_5kG04YOgEeWepLXXty06hg" fontName="Ubuntu" fontHeight="8"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_5kG04oOgEeWepLXXty06hg"/>
+ </children>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_5kBVUYOgEeWepLXXty06hg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_5kBVUoOgEeWepLXXty06hg"/>
+ </children>
+ <styles xmi:type="notation:ShapeStyle" xmi:id="_5j_gIYOgEeWepLXXty06hg" fontName="Ubuntu" fontHeight="8"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_5j_gIoOgEeWepLXXty06hg" x="300" y="275"/>
+ </children>
+ <children xmi:type="notation:Node" xmi:id="_5kB8YIOgEeWepLXXty06hg" type="2002" element="_5jiNIIOgEeWepLXXty06hg">
+ <children xmi:type="notation:Node" xmi:id="_5kCjcIOgEeWepLXXty06hg" type="5006"/>
+ <children xmi:type="notation:Node" xmi:id="_5kDKgIOgEeWepLXXty06hg" type="7001">
+ <children xmi:type="notation:Node" xmi:id="_5kIDAIOgEeWepLXXty06hg" type="3007" element="_5jjbQIOgEeWepLXXty06hg">
+ <children xmi:type="notation:Node" xmi:id="_5kIqEIOgEeWepLXXty06hg" type="5003">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_5kIqEYOgEeWepLXXty06hg" x="31"/>
+ </children>
+ <children xmi:type="notation:Node" xmi:id="_OvxhYIOhEeWepLXXty06hg" type="3005" element="_OvtP8IOhEeWepLXXty06hg">
+ <styles xmi:type="notation:ShapeStyle" xmi:id="_OvxhYYOhEeWepLXXty06hg" fontName="Ubuntu"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_OvxhYoOhEeWepLXXty06hg"/>
+ </children>
+ <styles xmi:type="notation:ShapeStyle" xmi:id="_5kIDAYOgEeWepLXXty06hg" fontName="Ubuntu" fontHeight="8"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_5kIDAoOgEeWepLXXty06hg" x="30" y="30" width="30" height="30"/>
+ </children>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_5kDKgYOgEeWepLXXty06hg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_5kDKgoOgEeWepLXXty06hg"/>
+ </children>
+ <styles xmi:type="notation:ShapeStyle" xmi:id="_5kB8YYOgEeWepLXXty06hg" fontName="Ubuntu" fontHeight="8"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_5kB8YoOgEeWepLXXty06hg" x="520" y="275"/>
+ </children>
<styles xmi:type="notation:DiagramStyle" xmi:id="_TvLcMppZEd-PK6vZSn4rhA"/>
</data>
</ownedAnnotationEntries>
+ <ownedAnnotationEntries xmi:type="description:AnnotationEntry" xmi:id="_dPdTgIOgEeWepLXXty06hg" source="DANNOTATION_CUSTOMIZATION_KEY">
+ <data xmi:type="diagram:ComputedStyleDescriptionRegistry" xmi:id="_dPdTgYOgEeWepLXXty06hg"/>
+ </ownedAnnotationEntries>
<ownedDiagramElements xmi:type="diagram:DNode" xmi:id="_O0poMJjLEeCGbO5oLE72PQ" name="c1Node" width="6" height="6" resizeKind="NSEW">
<target xmi:type="ecore:EClass" href="tc2225.ecore#//c1"/>
<semanticElements xmi:type="ecore:EClass" href="tc2225.ecore#//c1"/>
@@ -92,21 +150,15 @@
<target xmi:type="ecore:EAttribute" href="tc2225.ecore#//c1/a1"/>
<semanticElements xmi:type="ecore:EAttribute" href="tc2225.ecore#//c1/a1"/>
<ownedStyle xmi:type="diagram:BundledImage" xmi:id="_O0qPQZjLEeCGbO5oLE72PQ">
- <labelColor xmi:type="viewpoint:RGBValues" xmi:id="_O0qPQpjLEeCGbO5oLE72PQ"/>
<description xmi:type="style:BundledImageDescription" href="tc2225.odesign#//@ownedViewpoints[name='Design2225']/@ownedRepresentations[name='Entities2225']/@defaultLayer/@containerMappings[name='EC%20EClass%20']/@subNodeMappings[name='EC%20EAttribute']/@style"/>
- <borderColor xmi:type="viewpoint:RGBValues" xmi:id="_O0qPQ5jLEeCGbO5oLE72PQ"/>
- <color xmi:type="viewpoint:RGBValues" xmi:id="_Txbe8ppZEd-PK6vZSn4rhA"/>
</ownedStyle>
<actualMapping xmi:type="description_1:NodeMapping" href="tc2225.odesign#//@ownedViewpoints[name='Design2225']/@ownedRepresentations[name='Entities2225']/@defaultLayer/@containerMappings[name='EC%20EClass%20']/@subNodeMappings[name='EC%20EAttribute']"/>
</ownedBorderedNodes>
<arrangeConstraints>KEEP_LOCATION</arrangeConstraints>
<arrangeConstraints>KEEP_SIZE</arrangeConstraints>
<arrangeConstraints>KEEP_RATIO</arrangeConstraints>
- <ownedStyle xmi:type="diagram:BundledImage" xmi:id="_O0poMZjLEeCGbO5oLE72PQ">
- <labelColor xmi:type="viewpoint:RGBValues" xmi:id="_O0poMpjLEeCGbO5oLE72PQ"/>
+ <ownedStyle xmi:type="diagram:BundledImage" xmi:id="_O0poMZjLEeCGbO5oLE72PQ" borderColor="138,226,52" color="138,226,52">
<description xmi:type="style:BundledImageDescription" href="tc2225.odesign#//@ownedViewpoints[name='Design2225']/@ownedRepresentations[name='Entities2225']/@defaultLayer/@nodeMappings[name='EC%20Class%20Node']/@style"/>
- <borderColor xmi:type="viewpoint:RGBValues" xmi:id="_O0poM5jLEeCGbO5oLE72PQ" red="138" green="226" blue="52"/>
- <color xmi:type="viewpoint:RGBValues" xmi:id="_TxZCsZpZEd-PK6vZSn4rhA" red="138" green="226" blue="52"/>
</ownedStyle>
<actualMapping xmi:type="description_1:NodeMapping" href="tc2225.odesign#//@ownedViewpoints[name='Design2225']/@ownedRepresentations[name='Entities2225']/@defaultLayer/@nodeMappings[name='EC%20Class%20Node']"/>
</ownedDiagramElements>
@@ -117,21 +169,15 @@
<target xmi:type="ecore:EAttribute" href="tc2225.ecore#//c1/a1"/>
<semanticElements xmi:type="ecore:EAttribute" href="tc2225.ecore#//c1/a1"/>
<ownedStyle xmi:type="diagram:BundledImage" xmi:id="_O0rdYZjLEeCGbO5oLE72PQ">
- <labelColor xmi:type="viewpoint:RGBValues" xmi:id="_O0rdYpjLEeCGbO5oLE72PQ"/>
<description xmi:type="style:BundledImageDescription" href="tc2225.odesign#//@ownedViewpoints[name='Design2225']/@ownedRepresentations[name='Entities2225']/@defaultLayer/@containerMappings[name='EC%20EClass%20']/@subNodeMappings[name='EC%20EAttribute']/@style"/>
- <borderColor xmi:type="viewpoint:RGBValues" xmi:id="_O0rdY5jLEeCGbO5oLE72PQ"/>
- <color xmi:type="viewpoint:RGBValues" xmi:id="_TxdUIppZEd-PK6vZSn4rhA"/>
</ownedStyle>
<actualMapping xmi:type="description_1:NodeMapping" href="tc2225.odesign#//@ownedViewpoints[name='Design2225']/@ownedRepresentations[name='Entities2225']/@defaultLayer/@containerMappings[name='EC%20EClass%20']/@subNodeMappings[name='EC%20EAttribute']"/>
</ownedBorderedNodes>
<arrangeConstraints>KEEP_LOCATION</arrangeConstraints>
<arrangeConstraints>KEEP_SIZE</arrangeConstraints>
<arrangeConstraints>KEEP_RATIO</arrangeConstraints>
- <ownedStyle xmi:type="diagram:BundledImage" xmi:id="_O0q2UZjLEeCGbO5oLE72PQ">
- <labelColor xmi:type="viewpoint:RGBValues" xmi:id="_O0q2UpjLEeCGbO5oLE72PQ"/>
+ <ownedStyle xmi:type="diagram:BundledImage" xmi:id="_O0q2UZjLEeCGbO5oLE72PQ" borderColor="138,226,52" color="138,226,52">
<description xmi:type="style:BundledImageDescription" href="tc2225.odesign#//@ownedViewpoints[name='Design2225']/@ownedRepresentations[name='Entities2225']/@defaultLayer/@nodeMappings[name='EC%20Class%20Node%202']/@style"/>
- <borderColor xmi:type="viewpoint:RGBValues" xmi:id="_O0q2U5jLEeCGbO5oLE72PQ" red="138" green="226" blue="52"/>
- <color xmi:type="viewpoint:RGBValues" xmi:id="_TxctEppZEd-PK6vZSn4rhA" red="138" green="226" blue="52"/>
</ownedStyle>
<actualMapping xmi:type="description_1:NodeMapping" href="tc2225.odesign#//@ownedViewpoints[name='Design2225']/@ownedRepresentations[name='Entities2225']/@defaultLayer/@nodeMappings[name='EC%20Class%20Node%202']"/>
</ownedDiagramElements>
@@ -141,22 +187,15 @@
<arrangeConstraints>KEEP_LOCATION</arrangeConstraints>
<arrangeConstraints>KEEP_SIZE</arrangeConstraints>
<arrangeConstraints>KEEP_RATIO</arrangeConstraints>
- <ownedStyle xmi:type="diagram:FlatContainerStyle" xmi:id="_O0srgJjLEeCGbO5oLE72PQ" backgroundStyle="GradientTopToBottom">
- <labelColor xmi:type="viewpoint:RGBValues" xmi:id="_O0srgZjLEeCGbO5oLE72PQ"/>
+ <ownedStyle xmi:type="diagram:FlatContainerStyle" xmi:id="_O0srgJjLEeCGbO5oLE72PQ" borderSize="1" borderSizeComputationExpression="1" backgroundStyle="GradientTopToBottom">
<description xmi:type="style:FlatContainerStyleDescription" href="tc2225.odesign#//@ownedViewpoints[name='Design2225']/@ownedRepresentations[name='Entities2225']/@defaultLayer/@containerMappings[name='EC%20EClass%20Liste']/@style"/>
- <borderColor xmi:type="viewpoint:RGBValues" xmi:id="_O0srgpjLEeCGbO5oLE72PQ"/>
- <backgroundColor xmi:type="viewpoint:RGBValues" xmi:id="_O0srg5jLEeCGbO5oLE72PQ" red="255" green="255" blue="255"/>
- <foregroundColor xmi:type="viewpoint:RGBValues" xmi:id="_O0srhJjLEeCGbO5oLE72PQ" red="209" green="209" blue="209"/>
</ownedStyle>
<actualMapping xmi:type="description_1:ContainerMapping" href="tc2225.odesign#//@ownedViewpoints[name='Design2225']/@ownedRepresentations[name='Entities2225']/@defaultLayer/@containerMappings[name='EC%20EClass%20Liste']"/>
<ownedElements xmi:type="diagram:DNodeListElement" xmi:id="_O0srhZjLEeCGbO5oLE72PQ" name="a1c1List">
<target xmi:type="ecore:EAttribute" href="tc2225.ecore#//c1/a1"/>
<semanticElements xmi:type="ecore:EAttribute" href="tc2225.ecore#//c1/a1"/>
<ownedStyle xmi:type="diagram:BundledImage" xmi:id="_Fdv6kJvtEeSruqaqjt7oEg">
- <labelColor xmi:type="viewpoint:RGBValues" xmi:id="_Fdv6kZvtEeSruqaqjt7oEg"/>
<description xmi:type="style:BundledImageDescription" href="tc2225.odesign#//@ownedViewpoints[name='Design2225']/@ownedRepresentations[name='Entities2225']/@defaultLayer/@containerMappings[name='EC%20EClass%20']/@subNodeMappings[name='EC%20EAttribute']/@style"/>
- <borderColor xmi:type="viewpoint:RGBValues" xmi:id="_Fdv6kpvtEeSruqaqjt7oEg"/>
- <color xmi:type="viewpoint:RGBValues" xmi:id="_Fdv6k5vtEeSruqaqjt7oEg"/>
</ownedStyle>
<actualMapping xmi:type="description_1:NodeMapping" href="tc2225.odesign#//@ownedViewpoints[name='Design2225']/@ownedRepresentations[name='Entities2225']/@defaultLayer/@containerMappings[name='EC%20EClass%20']/@subNodeMappings[name='EC%20EAttribute']"/>
</ownedElements>
@@ -167,26 +206,76 @@
<arrangeConstraints>KEEP_LOCATION</arrangeConstraints>
<arrangeConstraints>KEEP_SIZE</arrangeConstraints>
<arrangeConstraints>KEEP_RATIO</arrangeConstraints>
- <ownedStyle xmi:type="diagram:FlatContainerStyle" xmi:id="_O0t5oJjLEeCGbO5oLE72PQ" backgroundStyle="GradientTopToBottom">
- <labelColor xmi:type="viewpoint:RGBValues" xmi:id="_O0t5oZjLEeCGbO5oLE72PQ"/>
+ <ownedStyle xmi:type="diagram:FlatContainerStyle" xmi:id="_O0t5oJjLEeCGbO5oLE72PQ" borderSize="1" borderSizeComputationExpression="1" backgroundStyle="GradientTopToBottom">
<description xmi:type="style:FlatContainerStyleDescription" href="tc2225.odesign#//@ownedViewpoints[name='Design2225']/@ownedRepresentations[name='Entities2225']/@defaultLayer/@containerMappings[name='EC%20EClass%20']/@style"/>
- <borderColor xmi:type="viewpoint:RGBValues" xmi:id="_O0t5opjLEeCGbO5oLE72PQ"/>
- <backgroundColor xmi:type="viewpoint:RGBValues" xmi:id="_O0t5o5jLEeCGbO5oLE72PQ" red="255" green="255" blue="255"/>
- <foregroundColor xmi:type="viewpoint:RGBValues" xmi:id="_O0t5pJjLEeCGbO5oLE72PQ" red="209" green="209" blue="209"/>
</ownedStyle>
<actualMapping xmi:type="description_1:ContainerMapping" href="tc2225.odesign#//@ownedViewpoints[name='Design2225']/@ownedRepresentations[name='Entities2225']/@defaultLayer/@containerMappings[name='EC%20EClass%20']"/>
<ownedDiagramElements xmi:type="diagram:DNode" xmi:id="_O0t5pZjLEeCGbO5oLE72PQ" name="a1c1Container" width="3" height="3" resizeKind="NSEW">
<target xmi:type="ecore:EAttribute" href="tc2225.ecore#//c1/a1"/>
<semanticElements xmi:type="ecore:EAttribute" href="tc2225.ecore#//c1/a1"/>
<ownedStyle xmi:type="diagram:BundledImage" xmi:id="_O0ugsJjLEeCGbO5oLE72PQ">
- <labelColor xmi:type="viewpoint:RGBValues" xmi:id="_O0ugsZjLEeCGbO5oLE72PQ"/>
<description xmi:type="style:BundledImageDescription" href="tc2225.odesign#//@ownedViewpoints[name='Design2225']/@ownedRepresentations[name='Entities2225']/@defaultLayer/@containerMappings[name='EC%20EClass%20']/@subNodeMappings[name='EC%20EAttribute']/@style"/>
- <borderColor xmi:type="viewpoint:RGBValues" xmi:id="_O0ugspjLEeCGbO5oLE72PQ"/>
- <color xmi:type="viewpoint:RGBValues" xmi:id="_TxhlkppZEd-PK6vZSn4rhA"/>
</ownedStyle>
<actualMapping xmi:type="description_1:NodeMapping" href="tc2225.odesign#//@ownedViewpoints[name='Design2225']/@ownedRepresentations[name='Entities2225']/@defaultLayer/@containerMappings[name='EC%20EClass%20']/@subNodeMappings[name='EC%20EAttribute']"/>
</ownedDiagramElements>
</ownedDiagramElements>
+ <ownedDiagramElements xmi:type="diagram:DNode" xmi:id="_5jZqQIOgEeWepLXXty06hg" name="c1Node_BI" width="3" height="3">
+ <target xmi:type="ecore:EClass" href="tc2225.ecore#//c1"/>
+ <semanticElements xmi:type="ecore:EClass" href="tc2225.ecore#//c1"/>
+ <ownedBorderedNodes xmi:type="diagram:DNode" xmi:id="_5jctkIOgEeWepLXXty06hg" name="a1c1Node_BI_BI" width="3" height="3">
+ <target xmi:type="ecore:EAttribute" href="tc2225.ecore#//c1/a1"/>
+ <semanticElements xmi:type="ecore:EAttribute" href="tc2225.ecore#//c1/a1"/>
+ <ownedStyle xmi:type="diagram:WorkspaceImage" xmi:id="_Ovl7MIOhEeWepLXXty06hg" workspacePath="/DesignerTestProject/missingImage.jpg">
+ <description xmi:type="style:WorkspaceImageDescription" href="tc2225.odesign#//@ownedViewpoints[name='Design2225']/@ownedRepresentations[name='Entities2225']/@defaultLayer/@containerMappings[name='EC%20Class%20WithBundleImage']/@subNodeMappings[name='EC%20EAttribute']/@style"/>
+ </ownedStyle>
+ <actualMapping xmi:type="description_1:NodeMapping" href="tc2225.odesign#//@ownedViewpoints[name='Design2225']/@ownedRepresentations[name='Entities2225']/@defaultLayer/@containerMappings[name='EC%20Class%20WithBundleImage']/@subNodeMappings[name='EC%20EAttribute']"/>
+ </ownedBorderedNodes>
+ <arrangeConstraints>KEEP_LOCATION</arrangeConstraints>
+ <arrangeConstraints>KEEP_SIZE</arrangeConstraints>
+ <arrangeConstraints>KEEP_RATIO</arrangeConstraints>
+ <ownedStyle xmi:type="diagram:WorkspaceImage" xmi:id="_-_MkkIOgEeWepLXXty06hg" workspacePath="/DesignerTestProject/missingImage.jpg">
+ <description xmi:type="style:WorkspaceImageDescription" href="tc2225.odesign#//@ownedViewpoints[name='Design2225']/@ownedRepresentations[name='Entities2225']/@defaultLayer/@nodeMappings[name='EC%20Class%20Node%20WithBundleImage']/@style"/>
+ </ownedStyle>
+ <actualMapping xmi:type="description_1:NodeMapping" href="tc2225.odesign#//@ownedViewpoints[name='Design2225']/@ownedRepresentations[name='Entities2225']/@defaultLayer/@nodeMappings[name='EC%20Class%20Node%20WithBundleImage']"/>
+ </ownedDiagramElements>
+ <ownedDiagramElements xmi:type="diagram:DNodeList" xmi:id="_5jgX8IOgEeWepLXXty06hg" name="c1List_BI">
+ <target xmi:type="ecore:EClass" href="tc2225.ecore#//c1"/>
+ <semanticElements xmi:type="ecore:EClass" href="tc2225.ecore#//c1"/>
+ <arrangeConstraints>KEEP_LOCATION</arrangeConstraints>
+ <arrangeConstraints>KEEP_SIZE</arrangeConstraints>
+ <arrangeConstraints>KEEP_RATIO</arrangeConstraints>
+ <ownedStyle xmi:type="diagram:WorkspaceImage" xmi:id="_5jg_AIOgEeWepLXXty06hg" workspacePath="/DesignerTestProject/missingImage.jpg">
+ <description xmi:type="style:WorkspaceImageDescription" href="tc2225.odesign#//@ownedViewpoints[name='Design2225']/@ownedRepresentations[name='Entities2225']/@defaultLayer/@containerMappings[name='EC%20EClass%20Liste%20WithBundleImage']/@style"/>
+ </ownedStyle>
+ <actualMapping xmi:type="description_1:ContainerMapping" href="tc2225.odesign#//@ownedViewpoints[name='Design2225']/@ownedRepresentations[name='Entities2225']/@defaultLayer/@containerMappings[name='EC%20EClass%20Liste%20WithBundleImage']"/>
+ <ownedElements xmi:type="diagram:DNodeListElement" xmi:id="_5jhmEIOgEeWepLXXty06hg" name="a1c1List_BI_BI">
+ <target xmi:type="ecore:EAttribute" href="tc2225.ecore#//c1/a1"/>
+ <semanticElements xmi:type="ecore:EAttribute" href="tc2225.ecore#//c1/a1"/>
+ <ownedStyle xmi:type="diagram:WorkspaceImage" xmi:id="_OvqzsIOhEeWepLXXty06hg" workspacePath="/DesignerTestProject/missingImage.jpg">
+ <description xmi:type="style:WorkspaceImageDescription" href="tc2225.odesign#//@ownedViewpoints[name='Design2225']/@ownedRepresentations[name='Entities2225']/@defaultLayer/@containerMappings[name='EC%20Class%20WithBundleImage']/@subNodeMappings[name='EC%20EAttribute']/@style"/>
+ </ownedStyle>
+ <actualMapping xmi:type="description_1:NodeMapping" href="tc2225.odesign#//@ownedViewpoints[name='Design2225']/@ownedRepresentations[name='Entities2225']/@defaultLayer/@containerMappings[name='EC%20Class%20WithBundleImage']/@subNodeMappings[name='EC%20EAttribute']"/>
+ </ownedElements>
+ </ownedDiagramElements>
+ <ownedDiagramElements xmi:type="diagram:DNodeContainer" xmi:id="_5jiNIIOgEeWepLXXty06hg" name="c1Container_BI" tooltipText="2225.c1">
+ <target xmi:type="ecore:EClass" href="tc2225.ecore#//c1"/>
+ <semanticElements xmi:type="ecore:EClass" href="tc2225.ecore#//c1"/>
+ <arrangeConstraints>KEEP_LOCATION</arrangeConstraints>
+ <arrangeConstraints>KEEP_SIZE</arrangeConstraints>
+ <arrangeConstraints>KEEP_RATIO</arrangeConstraints>
+ <ownedStyle xmi:type="diagram:WorkspaceImage" xmi:id="_Ovso4IOhEeWepLXXty06hg" workspacePath="/DesignerTestProject/missingImage.jpg">
+ <description xmi:type="style:WorkspaceImageDescription" href="tc2225.odesign#//@ownedViewpoints[name='Design2225']/@ownedRepresentations[name='Entities2225']/@defaultLayer/@containerMappings[name='EC%20Class%20WithBundleImage']/@style"/>
+ </ownedStyle>
+ <actualMapping xmi:type="description_1:ContainerMapping" href="tc2225.odesign#//@ownedViewpoints[name='Design2225']/@ownedRepresentations[name='Entities2225']/@defaultLayer/@containerMappings[name='EC%20Class%20WithBundleImage']"/>
+ <ownedDiagramElements xmi:type="diagram:DNode" xmi:id="_5jjbQIOgEeWepLXXty06hg" name="a1c1Container_BI_BI" width="3" height="3">
+ <target xmi:type="ecore:EAttribute" href="tc2225.ecore#//c1/a1"/>
+ <semanticElements xmi:type="ecore:EAttribute" href="tc2225.ecore#//c1/a1"/>
+ <ownedStyle xmi:type="diagram:WorkspaceImage" xmi:id="_OvtP8IOhEeWepLXXty06hg" workspacePath="/DesignerTestProject/missingImage.jpg">
+ <description xmi:type="style:WorkspaceImageDescription" href="tc2225.odesign#//@ownedViewpoints[name='Design2225']/@ownedRepresentations[name='Entities2225']/@defaultLayer/@containerMappings[name='EC%20Class%20WithBundleImage']/@subNodeMappings[name='EC%20EAttribute']/@style"/>
+ </ownedStyle>
+ <actualMapping xmi:type="description_1:NodeMapping" href="tc2225.odesign#//@ownedViewpoints[name='Design2225']/@ownedRepresentations[name='Entities2225']/@defaultLayer/@containerMappings[name='EC%20Class%20WithBundleImage']/@subNodeMappings[name='EC%20EAttribute']"/>
+ </ownedDiagramElements>
+ </ownedDiagramElements>
<description xmi:type="description_1:DiagramDescription" href="tc2225.odesign#//@ownedViewpoints[name='Design2225']/@ownedRepresentations[name='Entities2225']"/>
<filterVariableHistory xmi:type="diagram:FilterVariableHistory" xmi:id="_Tuh78ZpZEd-PK6vZSn4rhA"/>
<activatedLayers xmi:type="description_1:Layer" href="tc2225.odesign#//@ownedViewpoints[name='Design2225']/@ownedRepresentations[name='Entities2225']/@defaultLayer"/>
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/data/unit/style/tc2225.ecore b/plugins/org.eclipse.sirius.tests.swtbot/data/unit/style/tc2225.ecore
index 3926a6bd7b..ae853a83b0 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/data/unit/style/tc2225.ecore
+++ b/plugins/org.eclipse.sirius.tests.swtbot/data/unit/style/tc2225.ecore
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<ecore:EPackage xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<ecore:EPackage 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" name="2225">
<eClassifiers xsi:type="ecore:EClass" name="c1" abstract="true">
<eStructuralFeatures xsi:type="ecore:EReference" name="r1">
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/data/unit/style/tc2225.odesign b/plugins/org.eclipse.sirius.tests.swtbot/data/unit/style/tc2225.odesign
index 8033ceb9b5..c6687680a1 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/data/unit/style/tc2225.odesign
+++ b/plugins/org.eclipse.sirius.tests.swtbot/data/unit/style/tc2225.odesign
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="ASCII"?>
-<description:Group xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:description="http://www.eclipse.org/sirius/description/1.1.0" xmlns:description_1="http://www.eclipse.org/sirius/diagram/description/1.1.0" xmlns:style="http://www.eclipse.org/sirius/diagram/description/style/1.1.0" name="tc2225" version="8.0.0">
+<description:Group xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:description="http://www.eclipse.org/sirius/description/1.1.0" xmlns:description_1="http://www.eclipse.org/sirius/diagram/description/1.1.0" xmlns:style="http://www.eclipse.org/sirius/diagram/description/style/1.1.0" name="tc2225" version="10.1.0.201507271600">
<ownedViewpoints name="Design2225" modelFileExtension="ecore">
<ownedRepresentations xsi:type="description_1:DiagramDescription" name="Entities2225" titleExpression="&lt;%name%> package entities" domainClass="EPackage" enablePopupBars="true">
<defaultLayer name="Default">
@@ -17,8 +17,14 @@
<color xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='green']"/>
</style>
</nodeMappings>
+ <nodeMappings name="EC Class Node WithBundleImage" semanticCandidatesExpression="&lt;%eContents.filter(&quot;EClass&quot;)%>" synchronizationLock="true" domainClass="EClass" reusedBorderedNodeMappings="//@ownedViewpoints[name='Design2225']/@ownedRepresentations[name='Entities2225']/@defaultLayer/@containerMappings[name='EC%20Class%20WithBundleImage']/@subNodeMappings[name='EC%20EAttribute']">
+ <style xsi:type="style:WorkspaceImageDescription" labelExpression="&lt;%name%>Node_BI" workspacePath="/DesignerTestProject/missingImage.jpg">
+ <borderColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
+ <labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
+ </style>
+ </nodeMappings>
<containerMappings name="EC EClass Liste" semanticCandidatesExpression="&lt;%eContents.filter(&quot;EClass&quot;)%>" domainClass="EClass" reusedNodeMappings="//@ownedViewpoints[name='Design2225']/@ownedRepresentations[name='Entities2225']/@defaultLayer/@containerMappings[name='EC%20EClass%20']/@subNodeMappings[name='EC%20EAttribute']" childrenPresentation="List">
- <style xsi:type="style:FlatContainerStyleDescription" labelExpression="&lt;%name%>List" tooltipExpression="&lt;%eContainer.name%>.&lt;%name%>" backgroundStyle="GradientTopToBottom">
+ <style xsi:type="style:FlatContainerStyleDescription" arcWidth="1" arcHeight="1" borderSizeComputationExpression="1" labelExpression="&lt;%name%>List" tooltipExpression="&lt;%eContainer.name%>.&lt;%name%>" backgroundStyle="GradientTopToBottom">
<borderColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
<labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
<backgroundColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='white']"/>
@@ -33,13 +39,31 @@
<color xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
</style>
</subNodeMappings>
- <style xsi:type="style:FlatContainerStyleDescription" labelExpression="&lt;%name%>Container" tooltipExpression="&lt;%eContainer.name%>.&lt;%name%>" backgroundStyle="GradientTopToBottom">
+ <style xsi:type="style:FlatContainerStyleDescription" arcWidth="1" arcHeight="1" borderSizeComputationExpression="1" labelExpression="&lt;%name%>Container" tooltipExpression="&lt;%eContainer.name%>.&lt;%name%>" backgroundStyle="GradientTopToBottom">
<borderColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
<labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
<backgroundColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='white']"/>
<foregroundColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='light_gray']"/>
</style>
</containerMappings>
+ <containerMappings name="EC EClass Liste WithBundleImage" semanticCandidatesExpression="&lt;%eContents.filter(&quot;EClass&quot;)%>" domainClass="EClass" reusedNodeMappings="//@ownedViewpoints[name='Design2225']/@ownedRepresentations[name='Entities2225']/@defaultLayer/@containerMappings[name='EC%20Class%20WithBundleImage']/@subNodeMappings[name='EC%20EAttribute']" childrenPresentation="List">
+ <style xsi:type="style:WorkspaceImageDescription" labelExpression="&lt;%name%>List_BI" workspacePath="/DesignerTestProject/missingImage.jpg">
+ <borderColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
+ <labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
+ </style>
+ </containerMappings>
+ <containerMappings name="EC Class WithBundleImage" semanticCandidatesExpression="&lt;%eContents.filter(&quot;EClass&quot;)%>" domainClass="EClass">
+ <subNodeMappings name="EC EAttribute" semanticCandidatesExpression="feature:eAllContents" domainClass="EAttribute">
+ <style xsi:type="style:WorkspaceImageDescription" labelExpression="&lt;%name%>&lt;%$view.eContainer.name%>" workspacePath="/DesignerTestProject/missingImage.jpg">
+ <borderColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
+ <labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
+ </style>
+ </subNodeMappings>
+ <style xsi:type="style:WorkspaceImageDescription" labelExpression="&lt;%name%>Container_BI" workspacePath="/DesignerTestProject/missingImage.jpg">
+ <borderColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
+ <labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
+ </style>
+ </containerMappings>
</defaultLayer>
</ownedRepresentations>
</ownedViewpoints>
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/SetStyleToWorkspaceImageTests.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/SetStyleToWorkspaceImageTests.java
index 5332a3f86d..2aaf9f85d2 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/SetStyleToWorkspaceImageTests.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/SetStyleToWorkspaceImageTests.java
@@ -72,6 +72,8 @@ public class SetStyleToWorkspaceImageTests extends AbstractSiriusSwtBotGefTestCa
private static final String IMG_FILE1 = "aircraft1.JPG";
+ private static final String IMG_SVG_FILE = "image.svg";
+
private static final String DATA_UNIT_DIR = "data/unit/style/";
private static final String FILE_DIR = "/";
@@ -94,6 +96,8 @@ public class SetStyleToWorkspaceImageTests extends AbstractSiriusSwtBotGefTestCa
private static final String A1C1_NODE = A1 + C1_NODE;
+ private static final String BUNDLE_IMAGE_SUFFIX = "_BI";
+
private static final String A1C1_CONTAINER = A1 + C1_CONTAINER;
private static final String A1C1_LIST = A1 + C1_LIST;
@@ -113,7 +117,7 @@ public class SetStyleToWorkspaceImageTests extends AbstractSiriusSwtBotGefTestCa
// "Reset style properties to default values" button works.
oldDefaultFontName = changeDefaultFontName("Times New Roman");
- copyFileToTestProject(Activator.PLUGIN_ID, DATA_UNIT_DIR, MODEL, SESSION_FILE, DESIGN_FILE, IMG_FILE, IMG_FILE1);
+ copyFileToTestProject(Activator.PLUGIN_ID, DATA_UNIT_DIR, MODEL, SESSION_FILE, DESIGN_FILE, IMG_FILE, IMG_FILE1, IMG_SVG_FILE);
}
/**
@@ -170,8 +174,8 @@ public class SetStyleToWorkspaceImageTests extends AbstractSiriusSwtBotGefTestCa
* tests.swtbot.support.api.AbstractSiriusSwtBotGefTestCase
* .getSetStyleToWorkspaceImageButton
* (AbstractSiriusSwtBotGefTestCase.java:1126) at
- * org.eclipse.sirius.
- * tests.swtbot.SetStyleToWorkspaceImageTests.testSetWkpImageStyleCancel
+ * org.eclipse.sirius. tests.swtbot.SetStyleToWorkspaceImageTests.
+ * testSetWkpImageStyleCancel
* (SetStyleToWorkspaceImageTests.java:404) at
* org.eclipse.sirius.tests.swtbot.SetStyleToWorkspaceImageTests.
* testSetWkpImageStyleCancelFromAppearanceSection
@@ -246,7 +250,7 @@ public class SetStyleToWorkspaceImageTests extends AbstractSiriusSwtBotGefTestCa
return;
}
- testSetWkpImageStyleApplicationAndCancel(C1_NODE, AbstractDiagramNodeEditPart.class, true, getImagePath());
+ testSetWkpImageStyleApplicationAndCancel(C1_NODE, AbstractDiagramNodeEditPart.class, true, getJpgImagePath());
}
/**
@@ -260,7 +264,7 @@ public class SetStyleToWorkspaceImageTests extends AbstractSiriusSwtBotGefTestCa
if (!TestsUtil.isDynamicTabbar()) {
return;
}
- testSetWkpImageStyleApplicationAndCancel(C1_LIST, AbstractDiagramListEditPart.class, true, getImagePath());
+ testSetWkpImageStyleApplicationAndCancel(C1_LIST, AbstractDiagramListEditPart.class, true, getJpgImagePath());
}
/**
@@ -274,7 +278,7 @@ public class SetStyleToWorkspaceImageTests extends AbstractSiriusSwtBotGefTestCa
if (!TestsUtil.isDynamicTabbar()) {
return;
}
- testSetWkpImageStyleApplicationAndCancel(C1_CONTAINER, AbstractDiagramContainerEditPart.class, true, getImagePath());
+ testSetWkpImageStyleApplicationAndCancel(C1_CONTAINER, AbstractDiagramContainerEditPart.class, true, getJpgImagePath());
}
/**
@@ -289,7 +293,7 @@ public class SetStyleToWorkspaceImageTests extends AbstractSiriusSwtBotGefTestCa
return;
}
- testSetWkpImageStyleApplicationAndCancel(A1C1_NODE, AbstractDiagramBorderNodeEditPart.class, true, getImagePath());
+ testSetWkpImageStyleApplicationAndCancel(A1C1_NODE, AbstractDiagramBorderNodeEditPart.class, true, getJpgImagePath());
}
/**
@@ -304,7 +308,187 @@ public class SetStyleToWorkspaceImageTests extends AbstractSiriusSwtBotGefTestCa
return;
}
- testSetWkpImageStyleApplicationAndCancel(A1C1_CONTAINER, AbstractDiagramNodeEditPart.class, true, getImagePath());
+ testSetWkpImageStyleApplicationAndCancel(A1C1_CONTAINER, AbstractDiagramNodeEditPart.class, true, getJpgImagePath());
+ }
+
+ /**
+ * Test method.
+ *
+ * @throws Exception
+ * Test error.
+ */
+ public void testChangeWkpImageStyleFromJpgToSvgOnNodeFromTabbar() throws Exception {
+ // Not available in fixed tabbar
+ if (!TestsUtil.isDynamicTabbar()) {
+ return;
+ }
+ testChangeWkpImageStyle(C1_NODE, AbstractDiagramNodeEditPart.class, true, getJpgImagePath());
+ testChangeWkpImageStyle(C1_NODE, AbstractDiagramNodeEditPart.class, true, getSvgImagePath());
+
+ testChangeWkpImageStyle(C1_NODE + BUNDLE_IMAGE_SUFFIX, AbstractDiagramNodeEditPart.class, true, getJpgImagePath());
+ testChangeWkpImageStyle(C1_NODE + BUNDLE_IMAGE_SUFFIX, AbstractDiagramNodeEditPart.class, true, getSvgImagePath());
+ }
+
+ /**
+ * Test method.
+ *
+ * @throws Exception
+ * Test error.
+ */
+ public void testChangeWkpImageStyleFromJpgToSvgOnListFromTabbar() throws Exception {
+ // Not available in fixed tabbar
+ if (!TestsUtil.isDynamicTabbar()) {
+ return;
+ }
+ testChangeWkpImageStyle(C1_LIST, AbstractDiagramListEditPart.class, true, getJpgImagePath());
+ testChangeWkpImageStyle(C1_LIST, AbstractDiagramListEditPart.class, true, getSvgImagePath());
+
+ testChangeWkpImageStyle(C1_LIST + BUNDLE_IMAGE_SUFFIX, AbstractDiagramListEditPart.class, true, getJpgImagePath());
+ testChangeWkpImageStyle(C1_LIST + BUNDLE_IMAGE_SUFFIX, AbstractDiagramListEditPart.class, true, getSvgImagePath());
+ }
+
+ /**
+ * Test method.
+ *
+ * @throws Exception
+ * Test error.
+ */
+ public void testChangeWkpImageStyleFromJpgToSvgOnContainerFromTabbar() throws Exception {
+ // Not available in fixed tabbar
+ if (!TestsUtil.isDynamicTabbar()) {
+ return;
+ }
+ testChangeWkpImageStyle(C1_CONTAINER, AbstractDiagramContainerEditPart.class, true, getJpgImagePath());
+ testChangeWkpImageStyle(C1_CONTAINER, AbstractDiagramContainerEditPart.class, true, getSvgImagePath());
+
+ testChangeWkpImageStyle(C1_CONTAINER + BUNDLE_IMAGE_SUFFIX, AbstractDiagramContainerEditPart.class, true, getJpgImagePath());
+ testChangeWkpImageStyle(C1_CONTAINER + BUNDLE_IMAGE_SUFFIX, AbstractDiagramContainerEditPart.class, true, getSvgImagePath());
+ }
+
+ /**
+ * Test method.
+ *
+ * @throws Exception
+ * Test error.
+ */
+ public void testChangeWkpImageStyleFromJpgToSvgOnBorderedNodeFromTabbar() throws Exception {
+ // Not available in fixed tabbar
+ if (!TestsUtil.isDynamicTabbar()) {
+ return;
+ }
+ testChangeWkpImageStyle(A1C1_NODE, AbstractDiagramBorderNodeEditPart.class, true, getJpgImagePath());
+ testChangeWkpImageStyle(A1C1_NODE, AbstractDiagramBorderNodeEditPart.class, true, getSvgImagePath());
+
+ testChangeWkpImageStyle(A1C1_NODE + BUNDLE_IMAGE_SUFFIX, AbstractDiagramBorderNodeEditPart.class, true, getJpgImagePath());
+ testChangeWkpImageStyle(A1C1_NODE + BUNDLE_IMAGE_SUFFIX, AbstractDiagramBorderNodeEditPart.class, true, getSvgImagePath());
+ }
+
+ /**
+ * Test method.
+ *
+ * @throws Exception
+ * Test error.
+ */
+ public void testChangeWkpImageStyleFromJpgToSvgOnContainedNodeFromTabbar() throws Exception {
+ // Not available in fixed tabbar
+ if (!TestsUtil.isDynamicTabbar()) {
+ return;
+ }
+ testChangeWkpImageStyle(A1C1_CONTAINER, AbstractDiagramNodeEditPart.class, true, getJpgImagePath());
+ testChangeWkpImageStyle(A1C1_CONTAINER, AbstractDiagramNodeEditPart.class, true, getSvgImagePath());
+
+ testChangeWkpImageStyle(A1C1_CONTAINER + BUNDLE_IMAGE_SUFFIX, AbstractDiagramNodeEditPart.class, true, getJpgImagePath());
+ testChangeWkpImageStyle(A1C1_CONTAINER + BUNDLE_IMAGE_SUFFIX, AbstractDiagramNodeEditPart.class, true, getSvgImagePath());
+ }
+
+ /**
+ * Test method.
+ *
+ * @throws Exception
+ * Test error.
+ */
+ public void testChangeWkpImageStyleFromSvgToJpgOnNodeFromTabbar() throws Exception {
+ // Not available in fixed tabbar
+ if (!TestsUtil.isDynamicTabbar()) {
+ return;
+ }
+ testChangeWkpImageStyle(C1_NODE, AbstractDiagramNodeEditPart.class, true, getSvgImagePath());
+ testChangeWkpImageStyle(C1_NODE, AbstractDiagramNodeEditPart.class, true, getJpgImagePath());
+
+ testChangeWkpImageStyle(C1_NODE + BUNDLE_IMAGE_SUFFIX, AbstractDiagramNodeEditPart.class, true, getSvgImagePath());
+ testChangeWkpImageStyle(C1_NODE + BUNDLE_IMAGE_SUFFIX, AbstractDiagramNodeEditPart.class, true, getJpgImagePath());
+ }
+
+ /**
+ * Test method.
+ *
+ * @throws Exception
+ * Test error.
+ */
+ public void testChangeWkpImageStyleFromSvgToJpgOnListFromTabbar() throws Exception {
+ // Not available in fixed tabbar
+ if (!TestsUtil.isDynamicTabbar()) {
+ return;
+ }
+ testChangeWkpImageStyle(C1_LIST, AbstractDiagramListEditPart.class, true, getSvgImagePath());
+ testChangeWkpImageStyle(C1_LIST, AbstractDiagramListEditPart.class, true, getJpgImagePath());
+
+ testChangeWkpImageStyle(C1_LIST + BUNDLE_IMAGE_SUFFIX, AbstractDiagramListEditPart.class, true, getSvgImagePath());
+ testChangeWkpImageStyle(C1_LIST + BUNDLE_IMAGE_SUFFIX, AbstractDiagramListEditPart.class, true, getJpgImagePath());
+ }
+
+ /**
+ * Test method.
+ *
+ * @throws Exception
+ * Test error.
+ */
+ public void testChangeWkpImageStyleFromSvgToJpgOnContainerFromTabbar() throws Exception {
+ // Not available in fixed tabbar
+ if (!TestsUtil.isDynamicTabbar()) {
+ return;
+ }
+ testChangeWkpImageStyle(C1_CONTAINER, AbstractDiagramContainerEditPart.class, true, getSvgImagePath());
+ testChangeWkpImageStyle(C1_CONTAINER, AbstractDiagramContainerEditPart.class, true, getJpgImagePath());
+
+ testChangeWkpImageStyle(C1_CONTAINER + BUNDLE_IMAGE_SUFFIX, AbstractDiagramContainerEditPart.class, true, getSvgImagePath());
+ testChangeWkpImageStyle(C1_CONTAINER + BUNDLE_IMAGE_SUFFIX, AbstractDiagramContainerEditPart.class, true, getJpgImagePath());
+ }
+
+ /**
+ * Test method.
+ *
+ * @throws Exception
+ * Test error.
+ */
+ public void testChangeWkpImageStyleFromSvgToJpgOnBorderedNodeFromTabbar() throws Exception {
+ // Not available in fixed tabbar
+ if (!TestsUtil.isDynamicTabbar()) {
+ return;
+ }
+ testChangeWkpImageStyle(A1C1_NODE, AbstractDiagramBorderNodeEditPart.class, true, getSvgImagePath());
+ testChangeWkpImageStyle(A1C1_NODE, AbstractDiagramBorderNodeEditPart.class, true, getJpgImagePath());
+
+ testChangeWkpImageStyle(A1C1_NODE + BUNDLE_IMAGE_SUFFIX, AbstractDiagramBorderNodeEditPart.class, true, getSvgImagePath());
+ testChangeWkpImageStyle(A1C1_NODE + BUNDLE_IMAGE_SUFFIX, AbstractDiagramBorderNodeEditPart.class, true, getJpgImagePath());
+ }
+
+ /**
+ * Test method.
+ *
+ * @throws Exception
+ * Test error.
+ */
+ public void testChangeWkpImageStyleFromSvgToJpgOnContainedNodeFromTabbar() throws Exception {
+ // Not available in fixed tabbar
+ if (!TestsUtil.isDynamicTabbar()) {
+ return;
+ }
+ testChangeWkpImageStyle(A1C1_CONTAINER, AbstractDiagramNodeEditPart.class, true, getSvgImagePath());
+ testChangeWkpImageStyle(A1C1_CONTAINER, AbstractDiagramNodeEditPart.class, true, getJpgImagePath());
+
+ testChangeWkpImageStyle(A1C1_CONTAINER + BUNDLE_IMAGE_SUFFIX, AbstractDiagramNodeEditPart.class, true, getSvgImagePath());
+ testChangeWkpImageStyle(A1C1_CONTAINER + BUNDLE_IMAGE_SUFFIX, AbstractDiagramNodeEditPart.class, true, getJpgImagePath());
}
/**
@@ -314,7 +498,7 @@ public class SetStyleToWorkspaceImageTests extends AbstractSiriusSwtBotGefTestCa
* Test error.
*/
public void testSetWkpImageStyleOnNodeFromAppearanceSection() throws Exception {
- testSetWkpImageStyleApplicationAndCancel(C1_NODE, AbstractDiagramNodeEditPart.class, false, getImagePath());
+ testSetWkpImageStyleApplicationAndCancel(C1_NODE, AbstractDiagramNodeEditPart.class, false, getJpgImagePath());
}
/**
@@ -324,7 +508,7 @@ public class SetStyleToWorkspaceImageTests extends AbstractSiriusSwtBotGefTestCa
* Test error.
*/
public void testSetWkpImageStyleOnListFromAppearanceSection() throws Exception {
- testSetWkpImageStyleApplicationAndCancel(C1_LIST, AbstractDiagramListEditPart.class, false, getImagePath());
+ testSetWkpImageStyleApplicationAndCancel(C1_LIST, AbstractDiagramListEditPart.class, false, getJpgImagePath());
}
/**
@@ -334,7 +518,7 @@ public class SetStyleToWorkspaceImageTests extends AbstractSiriusSwtBotGefTestCa
* Test error.
*/
public void testSetWkpImageStyleOnContainerFromAppearanceSection() throws Exception {
- testSetWkpImageStyleApplicationAndCancel(C1_CONTAINER, AbstractDiagramContainerEditPart.class, false, getImagePath());
+ testSetWkpImageStyleApplicationAndCancel(C1_CONTAINER, AbstractDiagramContainerEditPart.class, false, getJpgImagePath());
}
/**
@@ -344,7 +528,7 @@ public class SetStyleToWorkspaceImageTests extends AbstractSiriusSwtBotGefTestCa
* Test error.
*/
public void testSetWkpImageStyleOnBorderNodeFromAppearanceSection() throws Exception {
- testSetWkpImageStyleApplicationAndCancel(A1C1_NODE, AbstractDiagramBorderNodeEditPart.class, false, getImagePath());
+ testSetWkpImageStyleApplicationAndCancel(A1C1_NODE, AbstractDiagramBorderNodeEditPart.class, false, getJpgImagePath());
}
/**
@@ -354,7 +538,7 @@ public class SetStyleToWorkspaceImageTests extends AbstractSiriusSwtBotGefTestCa
* Test error.
*/
public void testSetWkpImageStyleOnContainedNodeFromAppearanceSection() throws Exception {
- testSetWkpImageStyleApplicationAndCancel(A1C1_CONTAINER, AbstractDiagramNodeEditPart.class, false, getImagePath());
+ testSetWkpImageStyleApplicationAndCancel(A1C1_CONTAINER, AbstractDiagramNodeEditPart.class, false, getJpgImagePath());
}
/**
@@ -414,7 +598,7 @@ public class SetStyleToWorkspaceImageTests extends AbstractSiriusSwtBotGefTestCa
// Check that nothing is filtered if there is no filter
expandIfNeeded(true);
bot.text().setText("");
- bot.waitUntil(new CheckNbVisibleElementsInTree(bot.tree(), 3, "The dialog should display a normal view if there is no filter."));
+ bot.waitUntil(new CheckNbVisibleElementsInTree(bot.tree(), 4, "The dialog should display a normal view if there is no filter."));
}
/**
@@ -564,6 +748,29 @@ public class SetStyleToWorkspaceImageTests extends AbstractSiriusSwtBotGefTestCa
}
}
+ private void testChangeWkpImageStyle(String name, Class<? extends IGraphicalEditPart> type, boolean tabbar, String imagePath) throws Exception {
+ SWTBotGefEditPart botPart = selectAndCheckEditPart(name, type);
+ IAbstractDiagramNodeEditPart part = (IAbstractDiagramNodeEditPart) botPart.part();
+
+ AbstractSWTBot<? extends Widget> wkpImageButton = getSetStyleToWorkspaceImageButton(tabbar, true);
+
+ click(wkpImageButton);
+
+ openSelectImageDialog();
+
+ setImage(imagePath);
+
+ if (tabbar) {
+ editor.click(editor.mainEditPart());
+
+ botPart = selectAndCheckEditPart(name, type);
+ wkpImageButton = getSetStyleToWorkspaceImageButton(tabbar, true);
+ }
+
+ assertFalse("No message should be log in error log after a change of image:" + getErrorLoggersMessage(), doesAnErrorOccurs());
+ checkCustom(part, true);
+ }
+
private Dimension getSize(Node gmfNode) {
Size size = (Size) gmfNode.getLayoutConstraint();
return new Dimension(size.getWidth(), size.getHeight());
@@ -583,10 +790,14 @@ public class SetStyleToWorkspaceImageTests extends AbstractSiriusSwtBotGefTestCa
bot.waitUntil(done);
}
- private String getImagePath() {
+ private String getJpgImagePath() {
return designerProject.getName() + "/" + IMG_FILE;
}
+ private String getSvgImagePath() {
+ return designerProject.getName() + "/" + IMG_SVG_FILE;
+ }
+
private void cancel(SWTBotGefEditPart botPart) {
bot.button("Cancel").click();
checkCustom((IAbstractDiagramNodeEditPart) botPart.part(), false);

Back to the top