### Eclipse Workspace Patch 1.0
#P org.eclipse.gmf.graphdef.codegen
Index: templates/attr/Shape.javajet
===================================================================
RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Shape.javajet,v
retrieving revision 1.2
diff -u -r1.2 Shape.javajet
--- templates/attr/Shape.javajet 6 Feb 2006 22:21:41 -0000 1.2
+++ templates/attr/Shape.javajet 6 Apr 2006 05:16:26 -0000
@@ -8,8 +8,11 @@
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.
+// It is NOT the case for: Polyline#fill eProperty because its draw2d implementation effectively redefines default value as 'false' that differs from gmf default value.
+// (@see org.eclipse.draw2d.Polyline)
+%><%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()%>);
Index: src/org/eclipse/gmf/graphdef/codegen/templates/ShapeAttrGenerator.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/ShapeAttrGenerator.java,v
retrieving revision 1.2
diff -u -r1.2 ShapeAttrGenerator.java
--- src/org/eclipse/gmf/graphdef/codegen/templates/ShapeAttrGenerator.java 6 Feb 2006 22:21:42 -0000 1.2
+++ src/org/eclipse/gmf/graphdef/codegen/templates/ShapeAttrGenerator.java 6 Apr 2006 05:16:26 -0000
@@ -47,9 +47,12 @@
final ImportAssistant importManager = dispatcher.getImportManager();
-// PERHAPS, do this with reflection?
+// 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.
+// It is NOT the case for: Polyline#fill eProperty because its draw2d implementation effectively redefines default value as 'false' that differs from gmf default value.
+// (@see org.eclipse.draw2d.Polyline)
- if (figureInstance.eIsSet(GMFGraphPackage.eINSTANCE.getShape_Fill())) {
+ if (figureInstance instanceof Polyline || figureInstance.eIsSet(GMFGraphPackage.eINSTANCE.getShape_Fill())) {
stringBuffer.append(TEXT_1);
stringBuffer.append(figureVarName);
stringBuffer.append(TEXT_2);
#P org.eclipse.gmf.examples.taipan.gmf.editor
Index: src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/RouteEditPart.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.gmf/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/RouteEditPart.java,v
retrieving revision 1.7
diff -u -r1.7 RouteEditPart.java
--- src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/RouteEditPart.java 7 Mar 2006 15:45:00 -0000 1.7
+++ src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/RouteEditPart.java 6 Apr 2006 05:16:29 -0000
@@ -58,7 +58,7 @@
* @generated
*/
public RouteFigure() {
-
+ this.setFill(true);
}
}
Index: src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/DestinationEditPart.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.gmf/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/DestinationEditPart.java,v
retrieving revision 1.7
diff -u -r1.7 DestinationEditPart.java
--- src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/DestinationEditPart.java 7 Mar 2006 15:45:00 -0000 1.7
+++ src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/DestinationEditPart.java 6 Apr 2006 05:16:27 -0000
@@ -62,7 +62,7 @@
* @generated
*/
public ShipDestinationFigure() {
-
+ this.setFill(true);
setTargetDecoration(createTargetDecoration());
}
@@ -72,6 +72,7 @@
private org.eclipse.draw2d.PolylineDecoration createTargetDecoration() {
org.eclipse.draw2d.PolylineDecoration df = new org.eclipse.draw2d.PolylineDecoration();
// dispatchNext?
+ df.setFill(true);
return df;
}
Index: src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/PortEditPart.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.gmf/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/PortEditPart.java,v
retrieving revision 1.22
diff -u -r1.22 PortEditPart.java
--- src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/PortEditPart.java 5 Apr 2006 13:43:06 -0000 1.22
+++ src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/PortEditPart.java 6 Apr 2006 05:16:29 -0000
@@ -247,7 +247,7 @@
public PortFigure() {
org.eclipse.draw2d.XYLayout genLayoutManager = new org.eclipse.draw2d.XYLayout();
- // no suitable template found for 'org.eclipse.gmf.gmfgraph.impl.XYLayoutImpl@92d781'
+ // no suitable template found for 'org.eclipse.gmf.gmfgraph.impl.XYLayoutImpl@b535fe'
this.setLayoutManager(genLayoutManager);
this.setPreferredSize(getMapMode().DPtoLP(60), getMapMode().DPtoLP(50));
@@ -272,6 +272,7 @@
// FIXME instantiate - FigureRef - dispatch to 'instantiate' template?
org.eclipse.draw2d.Polygon fig_1 = new org.eclipse.draw2d.Polygon();
+ fig_1.setFill(true);
fig_1.setForegroundColor(org.eclipse.draw2d.ColorConstants.orange);
fig_1.setBackgroundColor(org.eclipse.draw2d.ColorConstants.orange);
fig_1.addPoint(new org.eclipse.draw2d.geometry.Point(30, 10));
@@ -283,6 +284,7 @@
// FIXME instantiate - FigureRef - dispatch to 'instantiate' template?
org.eclipse.draw2d.Polygon fig_2 = new org.eclipse.draw2d.Polygon();
+ fig_2.setFill(true);
fig_2.setForegroundColor(org.eclipse.draw2d.ColorConstants.orange);
fig_2.setBackgroundColor(org.eclipse.draw2d.ColorConstants.orange);
fig_2.addPoint(new org.eclipse.draw2d.geometry.Point(30, 0));
#P org.eclipse.gmf.examples.taipan
Index: models/taipan.gmfgen
===================================================================
RCS file: /cvsroot/technology/org.eclipse.gmf/examples/org.eclipse.gmf.examples.taipan/models/taipan.gmfgen,v
retrieving revision 1.25
diff -u -r1.25 taipan.gmfgen
--- models/taipan.gmfgen 5 Apr 2006 13:41:25 -0000 1.25
+++ models/taipan.gmfgen 6 Apr 2006 05:16:37 -0000
@@ -23,7 +23,7 @@
-
+
@@ -55,7 +55,7 @@
-
+
@@ -66,7 +66,7 @@
-
+