[Schmitzm-commits] r997 - in trunk/src/schmitzm: data/resource/locales lang/tree

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Sun Sep 12 16:05:14 CEST 2010


Author: mojays
Date: 2010-09-12 16:05:13 +0200 (Sun, 12 Sep 2010)
New Revision: 997

Modified:
   trunk/src/schmitzm/data/resource/locales/DataResourceBundle_it.properties
   trunk/src/schmitzm/lang/tree/OperationTreeParser.java
Log:
OperationTreeParser: parse exponential format (1.2345E-1) of double values

Modified: trunk/src/schmitzm/data/resource/locales/DataResourceBundle_it.properties
===================================================================
--- trunk/src/schmitzm/data/resource/locales/DataResourceBundle_it.properties	2010-09-09 07:44:41 UTC (rev 996)
+++ trunk/src/schmitzm/data/resource/locales/DataResourceBundle_it.properties	2010-09-12 14:05:13 UTC (rev 997)
@@ -1,57 +1,57 @@
-##########
-#Copyright (c) 2009 Martin O. J. Schmitz.
-#
-#This file is part of the SCHMITZM library - a collection of utility 
-#classes based on Java 1.6, focusing (not only) on Java Swing 
-#and the Geotools library.
-#
-#The SCHMITZM project is hosted at:
-#http://wald.intevation.org/projects/schmitzm/
-#
-#This program is free software; you can redistribute it and/or
-#modify it under the terms of the GNU Lesser General Public License
-#as published by the Free Software Foundation; either version 3
-#of the License, or (at your option) any later version.
-#
-#This program is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#GNU General Public License for more details.
-#
-#You should have received a copy of the GNU Lesser General Public License (license.txt)
-#along with this program; if not, write to the Free Software
-#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-#or try this link: http://www.gnu.org/licenses/lgpl.html
-#
-#Contributors:
-#    Annica Sahlin
-##########
-
-# -------------------------------------------------
-# ------ Italian Translations for components ------
-# ------ in Package schmitzm.data            ------
-# -------------------------------------------------
-DistanceUnit.FEET=feet
-DistanceUnit.FEET.Abb=ft
-DistanceUnit.KM=Chilometri
-DistanceUnit.KM.Abb=km
-DistanceUnit.METERS=metri
-DistanceUnit.METERS.Abb=m
-DistanceUnit.MILES=miles
-DistanceUnit.MILES.Abb=mi
-DistanceUnit.YARDS=yards
-DistanceUnit.YARDS.Abb=yt
-RasterDim.CellHeight=Altezza cella
-RasterDim.CellWidth=Larghezza cella
-RasterDim.ErrorMess=${0} di '${1}' \u00e8 incompatibile a '${2}'...
-RasterDim.GridHeight=Altezza griglia
-RasterDim.GridWidth=Larghezza griglia
-RasterDim.SampleType=Grid sample type
-
-# --- Translations for RasterOperationTree / RasterOperationTreeParser
-RasterOperationTree.AllowedIdx=accettato: 0 a ${0}
-RasterOperationTree.NoneAllowed=nessuno accettato
-RasterOperationTree.err.FilterReferenceNotAllowed=Filto pu\u00f2 solo essere applicato a raster reference
-RasterOperationTree.err.InvalidFilterReference=Riferimento filtro di input non valido'F${0}' (${1})
-RasterOperationTree.err.InvalidRasterReference=Riferimento raster di input non valido '#${0}' (${1})
-RasterOperationTree.err.NonNumericResult=RasterCalculator pu\u00f2 solo supportare risultati numerici: ${0}
+##########
+#Copyright (c) 2009 Martin O. J. Schmitz.
+#
+#This file is part of the SCHMITZM library - a collection of utility 
+#classes based on Java 1.6, focusing (not only) on Java Swing 
+#and the Geotools library.
+#
+#The SCHMITZM project is hosted at:
+#http://wald.intevation.org/projects/schmitzm/
+#
+#This program is free software; you can redistribute it and/or
+#modify it under the terms of the GNU Lesser General Public License
+#as published by the Free Software Foundation; either version 3
+#of the License, or (at your option) any later version.
+#
+#This program is distributed in the hope that it will be useful,
+#but WITHOUT ANY WARRANTY; without even the implied warranty of
+#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#GNU General Public License for more details.
+#
+#You should have received a copy of the GNU Lesser General Public License (license.txt)
+#along with this program; if not, write to the Free Software
+#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+#or try this link: http://www.gnu.org/licenses/lgpl.html
+#
+#Contributors:
+#    Annica Sahlin
+##########
+
+# -------------------------------------------------
+# ------ Italian Translations for components ------
+# ------ in Package schmitzm.data            ------
+# -------------------------------------------------
+DistanceUnit.FEET=feet
+DistanceUnit.FEET.Abb=ft
+DistanceUnit.KM=Chilometri
+DistanceUnit.KM.Abb=km
+DistanceUnit.METERS=metri
+DistanceUnit.METERS.Abb=m
+DistanceUnit.MILES=miles
+DistanceUnit.MILES.Abb=mi
+DistanceUnit.YARDS=yards
+DistanceUnit.YARDS.Abb=yt
+RasterDim.CellHeight=Altezza cella
+RasterDim.CellWidth=Larghezza cella
+RasterDim.ErrorMess=${0} di '${1}' \u00e8 incompatibile a '${2}'...
+RasterDim.GridHeight=Altezza griglia
+RasterDim.GridWidth=Larghezza griglia
+RasterDim.SampleType=Grid sample type
+
+# --- Translations for RasterOperationTree / RasterOperationTreeParser
+RasterOperationTree.AllowedIdx=accettato: 0 a ${0}
+RasterOperationTree.NoneAllowed=nessuno accettato
+RasterOperationTree.err.FilterReferenceNotAllowed=Filto pu\u00f2 solo essere applicato a raster reference
+RasterOperationTree.err.InvalidFilterReference=Riferimento filtro di input non valido'F${0}' (${1})
+RasterOperationTree.err.InvalidRasterReference=Riferimento raster di input non valido '#${0}' (${1})
+RasterOperationTree.err.NonNumericResult=RasterCalculator pu\u00f2 solo supportare risultati numerici: ${0}

Modified: trunk/src/schmitzm/lang/tree/OperationTreeParser.java
===================================================================
--- trunk/src/schmitzm/lang/tree/OperationTreeParser.java	2010-09-09 07:44:41 UTC (rev 996)
+++ trunk/src/schmitzm/lang/tree/OperationTreeParser.java	2010-09-12 14:05:13 UTC (rev 997)
@@ -798,7 +798,7 @@
       operand = parseRulePart();
     } else {
       // Sonderfall: Operand startet mit Minus-Zeichen (z.B. '-(1+2)' oder '-abs(-4)')
-      //             -> folgende
+      //             -> folgenden Operand mit -1 multiplizieren
       if ( token.equals("-") )
         operand = new OperationTree.OperatorNode("*", new OperationTree.ConstantNode(-1.0),  parseOperand(getOperatorConnectivity("*")));
       else {
@@ -1120,6 +1120,17 @@
     //             das Minus-Zeichen enthalten! Zahl-Token muss angehaengt werden.
     if ( token.equals("-") )
       token += nextNonWSToken();
+    // Sonderfall: Operand endet mit "E", dann handelt es sich um
+    //             die Exponential-Darstellung einer Konstanten, deren
+    //             Exponent mit einem Plus- oder Minus-Zeilen versehen ist
+    //             z.B. 1.234567E-1
+    //             -> folgendes Token anhaengen
+    if ( token.toUpperCase().endsWith("E") ) {
+      // + oder - anhaengen
+      token += nextNonWSToken();
+      // Exponenten anhaengen
+      token += nextNonWSToken();
+    }
 
     try {
       return Double.parseDouble(token);



More information about the Schmitzm-commits mailing list