Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Figure.javajet')
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Figure.javajet56
1 files changed, 0 insertions, 56 deletions
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Figure.javajet b/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Figure.javajet
deleted file mode 100644
index d15a4f8a5..000000000
--- a/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Figure.javajet
+++ /dev/null
@@ -1,56 +0,0 @@
-<%@ jet package="org.eclipse.gmf.graphdef.codegen.templates" class="FigureAttrGenerator"
- imports="org.eclipse.gmf.gmfgraph.* org.eclipse.gmf.common.codegen.* org.eclipse.gmf.graphdef.codegen.GraphDefDispatcher"%>
-<%
-GraphDefDispatcher.Args args = (GraphDefDispatcher.Args) argument;
-final Figure figureInstance = args.getFigure();
-final String figureVarName = args.getVariableName();
-final GraphDefDispatcher dispatcher = args.getDispatcher();
-final ImportAssistant importManager = dispatcher.getImportManager();
-%>
-<%
-Color colorVal;
-String colorName;
-if (figureInstance.eIsSet(GMFGraphPackage.eINSTANCE.getFigure_ForegroundColor())) {
- colorVal = figureInstance.getForegroundColor();
- colorName = figureInstance.getName().toUpperCase() + "_FORE";%>
- <%=figureVarName%>.setForegroundColor(<%@ include file="../Color.jetinc"%>);
-<%} if (figureInstance.eIsSet(GMFGraphPackage.eINSTANCE.getFigure_BackgroundColor())) {
- colorVal = figureInstance.getBackgroundColor();
- colorName = figureInstance.getName().toUpperCase() + "_BACK";%>
- <%=figureVarName%>.setBackgroundColor(<%@ include file="../Color.jetinc"%>);
-<%} if (figureInstance.eIsSet(GMFGraphPackage.eINSTANCE.getFigure_PreferredSize())) {
- Dimension d = figureInstance.getPreferredSize();%>
- <%=figureVarName%>.setPreferredSize(<%=dispatcher.DPtoLP(d.getDx())%>, <%=dispatcher.DPtoLP(d.getDy())%>);
-<%} if (figureInstance.eIsSet(GMFGraphPackage.eINSTANCE.getFigure_Size())) {
- Point p = figureInstance.getSize();%>
- <%=figureVarName%>.setSize(<%=dispatcher.DPtoLP(p.getX())%>, <%=dispatcher.DPtoLP(p.getY())%>);
-<%} if (figureInstance.eIsSet(GMFGraphPackage.eINSTANCE.getFigure_MaximumSize())) {
- Dimension d = figureInstance.getMaximumSize();%>
- <%=figureVarName%>.setMaximumSize(new <%=importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension")%>(<%=dispatcher.DPtoLP(d.getDx())%>, <%=dispatcher.DPtoLP(d.getDy())%>));
-<%} if (figureInstance.eIsSet(GMFGraphPackage.eINSTANCE.getFigure_MinimumSize())) {
- Dimension d = figureInstance.getMinimumSize();%>
- <%=figureVarName%>.setMinimumSize(new <%=importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension")%>(<%=dispatcher.DPtoLP(d.getDx())%>, <%=dispatcher.DPtoLP(d.getDy())%>));
-<%} if (figureInstance.eIsSet(GMFGraphPackage.eINSTANCE.getFigure_Font())) {
- // XXX possible CCE when fonts other than Basic added to model
- BasicFont font = (BasicFont) figureInstance.getFont();
- String fontName = font.getFaceName();
- if (fontName == null || fontName.trim().length() == 0){
- org.eclipse.swt.graphics.Font system = org.eclipse.swt.widgets.Display.getDefault().getSystemFont();
- if (system != null && system.getFontData().length > 0){
- fontName = system.getFontData()[0].getName();
- }
- }
- %>
- <%=figureVarName%>.setFont(
- <%=dispatcher.getStaticFieldsManager().addStaticField(
- importManager.getImportedName("org.eclipse.swt.graphics.Font"),
- figureInstance.getName().toUpperCase() + "_FONT",
- "new " + importManager.getImportedName("org.eclipse.swt.graphics.Font") + "(" + importManager.getImportedName("org.eclipse.swt.widgets.Display") + ".getCurrent(), \"" + fontName + "\", " + font.getHeight() + ", " + importManager.getImportedName("org.eclipse.swt.SWT") + "." + font.getStyle().getLiteral() + ")"
- )%>);
-<%} if (figureInstance.eIsSet(GMFGraphPackage.eINSTANCE.getFigure_Insets())) {
- Insets insets = figureInstance.getInsets();%>
- <%=figureVarName%>.setBorder(new <%=importManager.getImportedName("org.eclipse.draw2d.MarginBorder")%>(<%=dispatcher.DPtoLP(insets.getTop())%>, <%=dispatcher.DPtoLP(insets.getLeft())%>, <%=dispatcher.DPtoLP(insets.getBottom())%>, <%=dispatcher.DPtoLP(insets.getRight())%>));
-<%} if (figureInstance.eIsSet(GMFGraphPackage.eINSTANCE.getFigure_Border())) {
- Border border = figureInstance.getBorder();%>
- <%=figureVarName%>.setBorder(<%=dispatcher.dispatch(border, new Object[] {border, dispatcher})%>);
-<%}%> \ No newline at end of file

Back to the top