Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordstadnik2008-08-07 13:29:48 +0000
committerdstadnik2008-08-07 13:29:48 +0000
commitec38e6282371df139af16d4c3e07df53fe85a245 (patch)
tree6b7faca232f1a4b6bd545a75bc07ffc9d850d1b0 /plugins/org.eclipse.gmf.graphdef.codegen
parent0bee310ee4dee336e5ffdf9b58817115b80d4412 (diff)
downloadorg.eclipse.gmf-tooling-ec38e6282371df139af16d4c3e07df53fe85a245.tar.gz
org.eclipse.gmf-tooling-ec38e6282371df139af16d4c3e07df53fe85a245.tar.xz
org.eclipse.gmf-tooling-ec38e6282371df139af16d4c3e07df53fe85a245.zip
[243403] support float properties
Diffstat (limited to 'plugins/org.eclipse.gmf.graphdef.codegen')
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/templates/Attrs.xpt2
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/templates/Extras.xpt9
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/templates/Util.ext1
3 files changed, 11 insertions, 1 deletions
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/templates/Attrs.xpt b/plugins/org.eclipse.gmf.graphdef.codegen/templates/Attrs.xpt
index b285c99da..d5587300b 100644
--- a/plugins/org.eclipse.gmf.graphdef.codegen/templates/Attrs.xpt
+++ b/plugins/org.eclipse.gmf.graphdef.codegen/templates/Attrs.xpt
@@ -61,5 +61,5 @@
«ENDDEFINE»
«DEFINE Instance FOR gmfgraph::Rectangle2D-»
-new java.awt.geom.Rectangle2D.Double(«x», «y», «width», «height»)
+new java.awt.geom.Rectangle2D.Float(«x»f, «y»f, «width»f, «height»f)
«ENDDEFINE»
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/templates/Extras.xpt b/plugins/org.eclipse.gmf.graphdef.codegen/templates/Extras.xpt
index 5b60e08e9..a7487e057 100644
--- a/plugins/org.eclipse.gmf.graphdef.codegen/templates/Extras.xpt
+++ b/plugins/org.eclipse.gmf.graphdef.codegen/templates/Extras.xpt
@@ -73,11 +73,18 @@
org.w3c.dom.Element element = (org.w3c.dom.Element) nodes.item(0);
«IF type == gmfgraph::SVGPropertyType::COLOR-»
return getColor(element, "«attribute»"); //$NON-NLS-1$
+ «ELSEIF type == gmfgraph::SVGPropertyType::FLOAT-»
+ String value = element.getAttributeNS(null, "«attribute»"); //$NON-NLS-1$
+ return Float.parseFloat(value);
«ELSE-»
return element.getAttributeNS(null, "«attribute»"); //$NON-NLS-1$
«ENDIF-»
}
+ «IF type == gmfgraph::SVGPropertyType::FLOAT-»
+ return 0;
+ «ELSE-»
return null;
+ «ENDIF-»
}
«ENDDEFINE»
@@ -89,6 +96,8 @@
public void «setter»(«svgPropertyType()» value) {
«IF type == gmfgraph::SVGPropertyType::COLOR-»
String svalue = org.eclipse.gmf.runtime.lite.svg.SVGUtils.toSVGColor(getDocument(), value);
+ «ELSEIF type == gmfgraph::SVGPropertyType::FLOAT-»
+ String svalue = Float.toString(value);
«ENDIF-»
org.w3c.dom.NodeList nodes = getNodes("«query»"); //$NON-NLS-1$
for (int i = 0; i < nodes.getLength(); i++) {
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/templates/Util.ext b/plugins/org.eclipse.gmf.graphdef.codegen/templates/Util.ext
index 12e2b2957..4af939f1a 100644
--- a/plugins/org.eclipse.gmf.graphdef.codegen/templates/Util.ext
+++ b/plugins/org.eclipse.gmf.graphdef.codegen/templates/Util.ext
@@ -111,6 +111,7 @@ EString messageFormat(EString pattern, List[Object] argument) :
String svgPropertyType(gmfgraph::SVGProperty p) :
switch (p.type) {
case SVGPropertyType::COLOR : "org.eclipse.swt.graphics.Color"
+ case SVGPropertyType::FLOAT : "float"
default : "String"
}
;

Back to the top