Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoratikhomirov2006-03-07 19:04:35 +0000
committeratikhomirov2006-03-07 19:04:35 +0000
commitb221c21054a93d604942492a67e61fcf40960352 (patch)
tree035518e14be24aca858551f163137a071f7211c5 /plugins/org.eclipse.gmf.graphdef.codegen/templates
parent4cf5babcc33a221de5de08f56f58d9581f1cf39f (diff)
downloadorg.eclipse.gmf-tooling-b221c21054a93d604942492a67e61fcf40960352.tar.gz
org.eclipse.gmf-tooling-b221c21054a93d604942492a67e61fcf40960352.tar.xz
org.eclipse.gmf-tooling-b221c21054a93d604942492a67e61fcf40960352.zip
handle size and font attributes of figure
Diffstat (limited to 'plugins/org.eclipse.gmf.graphdef.codegen/templates')
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Figure.javajet7
1 files changed, 7 insertions, 0 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
index 6fa6315c8..68195f895 100644
--- a/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Figure.javajet
+++ b/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Figure.javajet
@@ -17,4 +17,11 @@ if (figureInstance.eIsSet(GMFGraphPackage.eINSTANCE.getFigure_ForegroundColor())
<%} 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_Font())) {
+ // XXX possible CCE when fonts other than Basic added to model
+ BasicFont font = (BasicFont) figureInstance.getFont();%>
+ <%=figureVarName%>.setFont(new <%=importManager.getImportedName("org.eclipse.swt.graphics.Font")%>(<%=importManager.getImportedName("org.eclipse.swt.widgets.Display")%>.getCurrent(), "<%=font.getFaceName()%>", <%=font.getHeight()%>, <%=importManager.getImportedName("org.eclipse.swt.SWT")%>.<%=font.getStyle().getLiteral()%>));
<%}%> \ No newline at end of file

Back to the top