fix, same style was serialized multiple times
diff --git a/examples/org.eclipse.graphiti.examples.tutorial/src/org/eclipse/graphiti/examples/tutorial/StyleUtil.java b/examples/org.eclipse.graphiti.examples.tutorial/src/org/eclipse/graphiti/examples/tutorial/StyleUtil.java
index 2e83e89..ac38586 100644
--- a/examples/org.eclipse.graphiti.examples.tutorial/src/org/eclipse/graphiti/examples/tutorial/StyleUtil.java
+++ b/examples/org.eclipse.graphiti.examples.tutorial/src/org/eclipse/graphiti/examples/tutorial/StyleUtil.java
@@ -32,6 +32,8 @@
private static final IColorConstant E_CLASS_FOREGROUND = new ColorConstant(255, 102, 0);
+ private static String DEFAULT_FONT = "Arial";
+
public static Style getStyleForEClass(Diagram diagram) {
final String styleId = "E-CLASS"; //$NON-NLS-1$
@@ -57,9 +59,10 @@
if (style == null) { // style not found - create new style
IGaService gaService = Graphiti.getGaService();
- style = gaService.createStyle(diagram, styleId);
+ style = gaService.createStyle(getStyleForEClass(diagram), styleId);
// "overwrites" values from parent style
style.setForeground(gaService.manageColor(diagram, E_CLASS_TEXT_FOREGROUND));
+ style.setFont(gaService.manageFont(diagram, DEFAULT_FONT, 8, false, true));
}
return style;
}