Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Decoration.xpt')
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Decoration.xpt51
1 files changed, 51 insertions, 0 deletions
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Decoration.xpt b/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Decoration.xpt
new file mode 100644
index 000000000..4e9257c39
--- /dev/null
+++ b/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Decoration.xpt
@@ -0,0 +1,51 @@
+/*
+ * 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/2005/GraphicalDefinition"»
+«IMPORT "http://www.eclipse.org/emf/2002/Ecore"»
+«IMPORT "templates"»
+«EXTENSION Util»
+
+«DEFINE polylineAttrs(String figureVarName) FOR gmfgraph::PolylineDecoration-»
+«EXPAND attr::Shape::shapeAttrs(figureVarName)-»
+«EXPAND templatePoints(figureVarName)-»
+«EXPAND scale(figureVarName)-»
+«ENDDEFINE»
+
+«DEFINE polylineAttrs(String figureVarName) FOR gmfgraph::PolygonDecoration-»
+«EXPAND attr::Shape::shapeAttrs(figureVarName)-»
+«EXPAND templatePoints(figureVarName)-»
+«EXPAND scale(figureVarName)-»
+«ENDDEFINE»
+
+«DEFINE templatePoints(String figureVarName) FOR gmfgraph::Polyline-»
+«IF !template.isEmpty()-»
+org.eclipse.draw2d.geometry.PointList pl = new org.eclipse.draw2d.geometry.PointList();
+«EXPAND templatePoint("pl") FOREACH template-»
+«figureVarName».setTemplate(pl);
+«ENDIF-»
+«ENDDEFINE»
+
+«DEFINE templatePoint(String pointListVarName) FOR gmfgraph::Point-»
+«pointListVarName».addPoint(«EXPAND MapMode::map»);
+«ENDDEFINE»
+
+«DEFINE scale(String figureVarName) FOR gmfgraph::PolylineDecoration-»
+«IF !template.isEmpty()-»
+«figureVarName».setScale(«EXPAND MapMode::map FOR 7», «EXPAND MapMode::map FOR 3»);
+«ENDIF-»
+«ENDDEFINE»
+
+«DEFINE scale(String figureVarName) FOR gmfgraph::PolygonDecoration-»
+«IF !template.isEmpty()-»
+«figureVarName».setScale(«EXPAND MapMode::map FOR 7», «EXPAND MapMode::map FOR 3»);
+«ENDIF-»
+«ENDDEFINE» \ No newline at end of file

Back to the top