Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoratikhomirov2006-02-24 15:11:33 +0000
committeratikhomirov2006-02-24 15:11:33 +0000
commitdf8fde41975e952f23f9d58b51075d2308f5d91e (patch)
treec4f7a7c0559e4d446af426529b07c1a21180033d /plugins/org.eclipse.gmf.graphdef.codegen/templates
parent5db300a6e2975b53d1b6f4e2ea23448b33b19be8 (diff)
downloadorg.eclipse.gmf-tooling-df8fde41975e952f23f9d58b51075d2308f5d91e.tar.gz
org.eclipse.gmf-tooling-df8fde41975e952f23f9d58b51075d2308f5d91e.tar.xz
org.eclipse.gmf-tooling-df8fde41975e952f23f9d58b51075d2308f5d91e.zip
[mgolubev] #129328 handle MapMode access in a variety of ways
Diffstat (limited to 'plugins/org.eclipse.gmf.graphdef.codegen/templates')
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Figure.javajet5
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/PolylineDecoration.javajet2
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/RoundedRectangle.javajet2
3 files changed, 5 insertions, 4 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 bf1bdab86..6fa6315c8 100644
--- a/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Figure.javajet
+++ b/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Figure.javajet
@@ -4,7 +4,8 @@
GraphDefDispatcher.Args args = (GraphDefDispatcher.Args) argument;
final Figure figureInstance = args.getFigure();
final String figureVarName = args.getVariableName();
-final ImportAssistant importManager = args.getDispatcher().getImportManager();
+final GraphDefDispatcher dispatcher = args.getDispatcher();
+final ImportAssistant importManager = dispatcher.getImportManager();
%>
<%Color colorVal;
if (figureInstance.eIsSet(GMFGraphPackage.eINSTANCE.getFigure_ForegroundColor())) {
@@ -15,5 +16,5 @@ if (figureInstance.eIsSet(GMFGraphPackage.eINSTANCE.getFigure_ForegroundColor())
<%=figureVarName%>.setBackgroundColor(<%@ include file="../Color.jetinc"%>);
<%} if (figureInstance.eIsSet(GMFGraphPackage.eINSTANCE.getFigure_PreferredSize())) {
Dimension d = figureInstance.getPreferredSize();%>
- <%=figureVarName%>.setPreferredSize(getMapMode().DPtoLP(<%=d.getDx()%>), getMapMode().DPtoLP(<%=d.getDy()%>));
+ <%=figureVarName%>.setPreferredSize(<%=dispatcher.DPtoLP(d.getDx())%>, <%=dispatcher.DPtoLP(d.getDy())%>);
<%}%> \ No newline at end of file
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/PolylineDecoration.javajet b/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/PolylineDecoration.javajet
index b4edce689..d7f485228 100644
--- a/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/PolylineDecoration.javajet
+++ b/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/PolylineDecoration.javajet
@@ -17,5 +17,5 @@ final ImportAssistant importManager = dispatcher.getImportManager();
pl.addPoint(<%=p.getX()%>, <%=p.getY()%>);
<% } /*for*/ %>
<%=figureVarName%>.setTemplate(pl);
- <%=figureVarName%>.setScale(getMapMode().DPtoLP(7), getMapMode().DPtoLP(3));
+ <%=figureVarName%>.setScale(<%=dispatcher.DPtoLP(7)%>, <%=dispatcher.DPtoLP(3)%>);
<% } /*!if getTemplate().isEmpty()*/ %>
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/RoundedRectangle.javajet b/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/RoundedRectangle.javajet
index 6f470f383..3267b4b51 100644
--- a/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/RoundedRectangle.javajet
+++ b/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/RoundedRectangle.javajet
@@ -8,4 +8,4 @@ final GraphDefDispatcher dispatcher = args.getDispatcher();
final ImportAssistant importManager = dispatcher.getImportManager();
%>
<%=dispatcher.dispatch("Shape", args)%>
-<%=figureVarName%>.setCornerDimensions(new <%=importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension")%>(getMapMode().DPtoLP(<%=figureInstance.getCornerWidth()%>), getMapMode().DPtoLP(<%=figureInstance.getCornerHeight()%>))); \ No newline at end of file
+<%=figureVarName%>.setCornerDimensions(new <%=importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension")%>(<%=dispatcher.DPtoLP(figureInstance.getCornerWidth())%>, <%=dispatcher.DPtoLP(figureInstance.getCornerHeight())%>));

Back to the top