Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Shape.xpt')
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Shape.xpt56
1 files changed, 56 insertions, 0 deletions
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Shape.xpt b/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Shape.xpt
new file mode 100644
index 000000000..3129577c7
--- /dev/null
+++ b/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Shape.xpt
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2006 Borland Software Corporation
+ *
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Artem Tikhomirov (Borland) - initial API and implementation
+ */
+«IMPORT 'http://www.eclipse.org/gmf/2006/GraphicalDefinition'»
+«IMPORT 'http://www.eclipse.org/emf/2002/Ecore'»
+
+«REM»
+org.eclipse.draw2d.Shape
+ private boolean fill = true, outline = true, xorFill, xorOutline;
+«ENDREM»
+«DEFINE shapeAttrs(figureVarName : String) FOR gmfgraph::Shape-»
+«EXPAND fill(figureVarName)-»
+«IF xorFill»«EXPAND xorFill(figureVarName)»«ENDIF-»
+«IF not outline»«EXPAND outline(figureVarName)»«ENDIF-»
+«IF xorOutline»«EXPAND xorOutline(figureVarName)»«ENDIF-»
+«REM» UNCONDITIONALLY generate setLineWidth, see bug 262383 IF lineWidth <> 1 «ENDREM»«EXPAND lineWidth(figureVarName)»«REM» ENDIF «ENDREM-»
+«IF lineKind <> gmfgraph::LineKind::LINE_SOLID»«EXPAND lineKind(figureVarName)»«ENDIF-»
+«ENDDEFINE»
+
+«DEFINE fill(figureVarName : String) FOR gmfgraph::Shape-»
+«IF not fill»«figureVarName».setFill(«fill»);
+«ENDIF-»
+«ENDDEFINE»
+
+«DEFINE fill(figureVarName : String) FOR gmfgraph::Polygon-»
+«IF fill»«figureVarName».setFill(«fill»);
+«ENDIF-»
+«ENDDEFINE»
+
+«DEFINE xorFill(figureVarName : String) FOR gmfgraph::Shape-»
+«figureVarName».setFillXOR(«xorFill»);
+«ENDDEFINE»
+
+«DEFINE outline(figureVarName : String) FOR gmfgraph::Shape-»
+«figureVarName».setOutline(«outline»);
+«ENDDEFINE»
+
+«DEFINE xorOutline(figureVarName : String) FOR gmfgraph::Shape-»
+«figureVarName».setOutlineXOR(«xorOutline»);
+«ENDDEFINE»
+
+«DEFINE lineWidth(figureVarName : String) FOR gmfgraph::Shape-»
+«figureVarName».setLineWidth(«lineWidth»);
+«ENDDEFINE»
+
+«DEFINE lineKind(figureVarName : String) FOR gmfgraph::Shape-»
+«figureVarName».setLineStyle(org.eclipse.draw2d.Graphics.«lineKind»);
+«ENDDEFINE»

Back to the top