Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoratikhomirov2006-04-10 11:15:21 +0000
committeratikhomirov2006-04-10 11:15:21 +0000
commitdc2456f75f65198eeac9c1fb0dbd87c89b47bf04 (patch)
tree3a2aff77e6e241cb19e3ce989581fece5e6a0dbd /plugins/org.eclipse.gmf.graphdef.codegen/templates
parent0c271e4649b798b9d200887f9fe9199ddae886b2 (diff)
downloadorg.eclipse.gmf-tooling-dc2456f75f65198eeac9c1fb0dbd87c89b47bf04.tar.gz
org.eclipse.gmf-tooling-dc2456f75f65198eeac9c1fb0dbd87c89b47bf04.tar.xz
org.eclipse.gmf-tooling-dc2456f75f65198eeac9c1fb0dbd87c89b47bf04.zip
[mgolubev] #135016 Background colour is not used to fill polygons
Diffstat (limited to 'plugins/org.eclipse.gmf.graphdef.codegen/templates')
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Shape.javajet6
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Shape.javajet b/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Shape.javajet
index 0cca6aa6b..b9a70dd3a 100644
--- a/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Shape.javajet
+++ b/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Shape.javajet
@@ -8,8 +8,10 @@ final GraphDefDispatcher dispatcher = args.getDispatcher();
final ImportAssistant importManager = dispatcher.getImportManager();
%>
<%
-// PERHAPS, do this with reflection?
-%><%if (figureInstance.eIsSet(GMFGraphPackage.eINSTANCE.getShape_Fill())) {%>
+// Most of the properties are set only if corresponding eProperty isSet.
+// The difference is in the default values. If default value of eProperty matches d2d one, the setter may be omitted.
+// d2d.Shape#fill == true (matches default of gmfgraph.Shape#fill), while d2d.Polyline#fill == false, thus we need additional check
+%><%if (figureInstance instanceof Polyline ^ figureInstance.eIsSet(GMFGraphPackage.eINSTANCE.getShape_Fill())) {%>
<%=figureVarName%>.setFill(<%=figureInstance.isFill()%>);
<%} if (figureInstance.eIsSet(GMFGraphPackage.eINSTANCE.getShape_Outline())) {%>
<%=figureVarName%>.setOutline(<%=figureInstance.isOutline()%>);

Back to the top