Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/PolylineDecoration.javajet')
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/PolylineDecoration.javajet21
1 files changed, 21 insertions, 0 deletions
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/PolylineDecoration.javajet b/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/PolylineDecoration.javajet
new file mode 100644
index 000000000..0a4b53871
--- /dev/null
+++ b/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/PolylineDecoration.javajet
@@ -0,0 +1,21 @@
+<%@ jet package="org.eclipse.gmf.graphdef.codegen.templates" class="PolylineDecorationAttrGenerator"
+ imports="org.eclipse.gmf.gmfgraph.* org.eclipse.gmf.common.codegen.* org.eclipse.gmf.graphdef.codegen.Dispatcher java.util.*"%>
+<%
+Dispatcher.Args args = (Dispatcher.Args) argument;
+// not PolylineDecoration, as we use same template from PolygonDecoration
+final Polyline figureInstance = (Polyline) args.getFigure();
+final String figureVarName = args.getVariableName();
+final ImportAssistant importManager = args.getImportManager();
+final Dispatcher dispatcher = args.getDispatcher();
+%>
+// dispatchNext?
+<%=dispatcher.dispatch("Shape", args)%>
+<%if (!figureInstance.getTemplate().isEmpty()) {%>
+ <%=importManager.getImportedName("org.eclipse.draw2d.geometry.PointList")%> pl = new <%=importManager.getImportedName("org.eclipse.draw2d.geometry.PointList")%>();
+<% for (Iterator pointIt = figureInstance.getTemplate().iterator(); pointIt.hasNext(); ) {
+ Point p = (Point) pointIt.next();%>
+ pl.addPoint(<%=p.getX()%>, <%=p.getY()%>);
+<% } /*for*/ %>
+ <%=figureVarName%>.setTemplate(pl);
+ <%=figureVarName%>.setScale(getMapMode().DPtoLP(7), getMapMode().DPtoLP(3));
+<% } /*!if getTemplate().isEmpty()*/ %>

Back to the top