Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: d7f4852284c6117820617c8ef629a04732ae0819 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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.GraphDefDispatcher java.util.*"%>
<%
GraphDefDispatcher.Args args = (GraphDefDispatcher.Args) argument;
// not PolylineDecoration, as we use same template from PolygonDecoration
final Polyline figureInstance = (Polyline) args.getFigure();
final String figureVarName = args.getVariableName();
final GraphDefDispatcher dispatcher = args.getDispatcher();
final ImportAssistant importManager = dispatcher.getImportManager();
%>
// 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(<%=dispatcher.DPtoLP(7)%>, <%=dispatcher.DPtoLP(3)%>);
<%	} /*!if getTemplate().isEmpty()*/ %>

Back to the top