Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/FontPropertySetterImpl.java')
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/FontPropertySetterImpl.java31
1 files changed, 20 insertions, 11 deletions
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/FontPropertySetterImpl.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/FontPropertySetterImpl.java
index 10621cbbacc..1a2a2c63df3 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/FontPropertySetterImpl.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/FontPropertySetterImpl.java
@@ -13,7 +13,8 @@
package org.eclipse.papyrus.layers.stackmodel.layers.impl;
import org.eclipse.emf.ecore.EClass;
-import org.eclipse.gmf.runtime.notation.Shape;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.layers.stackmodel.layers.FontInstance;
import org.eclipse.papyrus.layers.stackmodel.layers.FontPropertySetter;
@@ -60,17 +61,25 @@ public class FontPropertySetterImpl extends PropertySetterImpl implements FontPr
@Override
public void setValue(View view, TypeInstance value) {
-
- FontInstance lineValue = (FontInstance)value;
+ // Try to get the FontStyle object to modify
+ FontStyle style;
+ if(view instanceof FontStyle) {
+ // Try directly (case of Shape ...)
+ style = (FontStyle)view;
+ }
+ else {
+ // Try as additionnal style
+ style = (FontStyle)view.getStyle(NotationPackage.eINSTANCE.getFontStyle() );
+ }
- if(view instanceof Shape) {
- Shape shape = (Shape)view;
-
-
- shape.setFontColor(lineValue.getFontColor());
- shape.setFontName(lineValue.getFontName());
- shape.setFontHeight(lineValue.getFontHeigh());
- shape.setBold(lineValue.isBold());
+ // Set values
+ if( style != null ) {
+ FontInstance lineValue = (FontInstance)value;
+
+ style.setFontColor(lineValue.getFontColor());
+ style.setFontName(lineValue.getFontName());
+ style.setFontHeight(lineValue.getFontHeigh());
+ style.setBold(lineValue.isBold());
}
}

Back to the top