Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 755205349471825ae3674ab56971047a8ae16928 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<%@ jet package="org.eclipse.gmf.graphdef.codegen.templates" class="TopShapeGenerator" 
	imports="org.eclipse.gmf.gmfgraph.* org.eclipse.gmf.gmfgraph.util.* org.eclipse.gmf.common.codegen.* org.eclipse.gmf.graphdef.codegen.Dispatcher java.util.*"%>
<%
Object[] args = (Object[]) argument;
Shape figure = (Shape) args[0];
final ImportAssistant importManager = (ImportAssistant) args[1];
final GMFGraphSwitch fqnSwitch = new FigureQualifiedNameSwitch();
final Dispatcher dispatcher = (Dispatcher) args[2];
%>

<%importManager.markImportLocation(stringBuffer);%>

/**
 * @generated
 */
public class <%=figure.getName()%> extends <%=importManager.getImportedName((String) fqnSwitch.doSwitch(figure))%> {
	/**
	 * @generated
	 */
	public <%=figure.getName()%>() {
		<%=dispatcher.dispatch(figure, dispatcher.create(figure, "this", importManager, fqnSwitch))%>
<%
for (Iterator it = figure.getResolvedChildren().iterator(); it.hasNext();) {
		Figure next = (Figure) it.next();%>
		setFigure<%=next.getName()%>(createFigure<%=next.getName()%>());
		add(getFigure<%=next.getName()%>());
<%}%>
	}

<%
int fc = 0;
for (Iterator it = figure.getResolvedChildren().iterator(); it.hasNext(); fc++) {
	Figure next = (Figure) it.next();%>

	private IFigure f<%=next.getName()%>; 

	/**
	 * @generated
	 */
	public IFigure getFigure<%=next.getName()%>() {
		return f<%=next.getName()%>;
	}

	/**
	 * @generated
	 */
	protected void setFigure<%=next.getName()%>(IFigure figure) {
		f<%=next.getName()%> = figure;
	}

	/**
	 * @generated
	 */
	private IFigure createFigure<%=next.getName()%>() {
<%=dispatcher.dispatch("instantiate", dispatcher.create(next, "rv", importManager, fqnSwitch))%>
<%=dispatcher.dispatch("Children", new Object[] {next.getChildren(), importManager, fqnSwitch, dispatcher, "rv"})%>
		return rv;
	}

<%}%>
}<%importManager.emitSortedImports();%>

Back to the top