Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoratikhomirov2006-02-06 18:10:22 +0000
committeratikhomirov2006-02-06 18:10:22 +0000
commitab3cbec7ac30ebc2acac1565d3a11e5de969c32b (patch)
tree6975082a424975a565a3ea20368f2279f968c1c2 /plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Polyline.javajet
parent6e7a0cab3de84e293361d07e3545872589e22f68 (diff)
downloadorg.eclipse.gmf-tooling-ab3cbec7ac30ebc2acac1565d3a11e5de969c32b.tar.gz
org.eclipse.gmf-tooling-ab3cbec7ac30ebc2acac1565d3a11e5de969c32b.tar.xz
org.eclipse.gmf-tooling-ab3cbec7ac30ebc2acac1565d3a11e5de969c32b.zip
major refactoring of gmfgraph codegen utilizing dispatcher infrastructure
Diffstat (limited to 'plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Polyline.javajet')
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Polyline.javajet16
1 files changed, 16 insertions, 0 deletions
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Polyline.javajet b/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Polyline.javajet
new file mode 100644
index 000000000..497789253
--- /dev/null
+++ b/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Polyline.javajet
@@ -0,0 +1,16 @@
+<%@ jet package="org.eclipse.gmf.graphdef.codegen.templates" class="PolylineAttrGenerator"
+ imports="org.eclipse.gmf.gmfgraph.* org.eclipse.gmf.common.codegen.* org.eclipse.gmf.graphdef.codegen.Dispatcher"%>
+<%
+Dispatcher.Args args = (Dispatcher.Args) argument;
+final Polyline figureInstance = (Polyline) args.getFigure();
+final String figureVarName = args.getVariableName();
+final ImportAssistant importManager = args.getImportManager();
+final Dispatcher dispatcher = args.getDispatcher();
+%>
+<%=dispatcher.dispatch("Shape", args)%>
+<%if (!figureInstance.getTemplate().isEmpty()) {
+ final String pointClassName = importManager.getImportedName("org.eclipse.draw2d.geometry.Point");
+ for (java.util.Iterator pointIt = figureInstance.getTemplate().iterator(); pointIt.hasNext(); ) {
+ Point p = (Point) pointIt.next();%>
+ <%=figureVarName%>.addPoint(new <%=pointClassName%>(<%=p.getX()%>, <%=p.getY()%>));
+<%}}%> \ No newline at end of file

Back to the top