Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.gmf.graphdef.codegen/templates/top')
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/templates/top/Figure.javajet24
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/templates/top/PolylineConnection.javajet52
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/templates/top/Shape.javajet61
3 files changed, 137 insertions, 0 deletions
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/templates/top/Figure.javajet b/plugins/org.eclipse.gmf.graphdef.codegen/templates/top/Figure.javajet
new file mode 100644
index 000000000..d633f069f
--- /dev/null
+++ b/plugins/org.eclipse.gmf.graphdef.codegen/templates/top/Figure.javajet
@@ -0,0 +1,24 @@
+<%@ jet package="org.eclipse.gmf.graphdef.codegen.templates" class="TopFigureGenerator"
+ imports="org.eclipse.gmf.gmfgraph.* org.eclipse.gmf.gmfgraph.util.* org.eclipse.gmf.common.codegen.* org.eclipse.gmf.graphdef.codegen.Dispatcher"%>
+<%
+Object[] args = (Object[]) argument;
+Figure figure = (Figure) 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))%>
+ <%=dispatcher.dispatch("Children", new Object[] {figure.getChildren(), importManager, fqnSwitch, dispatcher, "this"})%>
+ }
+}<%importManager.emitSortedImports();%>
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/templates/top/PolylineConnection.javajet b/plugins/org.eclipse.gmf.graphdef.codegen/templates/top/PolylineConnection.javajet
new file mode 100644
index 000000000..fdae4a8ab
--- /dev/null
+++ b/plugins/org.eclipse.gmf.graphdef.codegen/templates/top/PolylineConnection.javajet
@@ -0,0 +1,52 @@
+<%@ jet package="org.eclipse.gmf.graphdef.codegen.templates" class="TopConnectionGenerator"
+ imports="org.eclipse.gmf.gmfgraph.* org.eclipse.gmf.gmfgraph.util.* org.eclipse.gmf.common.codegen.* org.eclipse.gmf.graphdef.codegen.Dispatcher"%>
+<%
+Object[] args = (Object[]) argument;
+PolylineConnection figure = (PolylineConnection) 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("org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx")%> {
+
+ /**
+ * @generated
+ */
+ public <%=figure.getName()%>() {
+<%=dispatcher.dispatch("Shape", dispatcher.create(figure, "this", importManager, fqnSwitch))%>
+<%if (figure.getSourceDecoration() != null) {%>
+ setSourceDecoration(createSourceDecoration());
+<%}
+if (figure.getTargetDecoration() != null) {%>
+ setTargetDecoration(createTargetDecoration());
+<%}%>
+ }
+
+<%if (figure.getSourceDecoration() != null) {
+ final String className = importManager.getImportedName((String) fqnSwitch.doSwitch(figure.getSourceDecoration()));%>
+ /**
+ * @generated
+ */
+ private <%=className%> createSourceDecoration() {
+<%=dispatcher.dispatch("instantiate", dispatcher.create(figure.getSourceDecoration(), "df", importManager, fqnSwitch))%>
+ return df;
+ }
+<%} /*if sourceDecoration != null */ %>
+
+<%if (figure.getTargetDecoration() != null) {
+ final String className = importManager.getImportedName((String) fqnSwitch.doSwitch(figure.getTargetDecoration()));%>
+ /**
+ * @generated
+ */
+ private <%=className%> createTargetDecoration() {
+<%=dispatcher.dispatch("instantiate", dispatcher.create(figure.getTargetDecoration(), "df", importManager, fqnSwitch))%>
+ return df;
+ }
+<%}%>
+}<%importManager.emitSortedImports();%> \ No newline at end of file
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/templates/top/Shape.javajet b/plugins/org.eclipse.gmf.graphdef.codegen/templates/top/Shape.javajet
new file mode 100644
index 000000000..755205349
--- /dev/null
+++ b/plugins/org.eclipse.gmf.graphdef.codegen/templates/top/Shape.javajet
@@ -0,0 +1,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