[Schmitzm-commits] r571 - in branches/1.0-gt2-2.6/src/schmitzm: data geotools/feature geotools/gui lang/tree swing swing/resource/locales

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Nov 24 19:16:19 CET 2009


Author: mojays
Date: 2009-11-24 19:16:18 +0100 (Tue, 24 Nov 2009)
New Revision: 571

Modified:
   branches/1.0-gt2-2.6/src/schmitzm/data/RasterCalculator.java
   branches/1.0-gt2-2.6/src/schmitzm/data/RasterOperationTreeParser.java
   branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/FeatureOperationTreeParser.java
   branches/1.0-gt2-2.6/src/schmitzm/geotools/gui/FeatureFilterPanel.java
   branches/1.0-gt2-2.6/src/schmitzm/lang/tree/OperationTreeParser.java
   branches/1.0-gt2-2.6/src/schmitzm/swing/OperationTreePanel.java
   branches/1.0-gt2-2.6/src/schmitzm/swing/resource/locales/SwingResourceBundle.properties
   branches/1.0-gt2-2.6/src/schmitzm/swing/resource/locales/SwingResourceBundle_de.properties
   branches/1.0-gt2-2.6/src/schmitzm/swing/resource/locales/SwingResourceBundle_fr.properties
Log:
Enhancements:
- OperationTreeParser, RasterOperationTreeParser implement ParserOperatorsHints
- OperationTreePanel uses ParserOperatorsHints for ComboBox
- RasterCalculator holds parser in global constant variable

Modified: branches/1.0-gt2-2.6/src/schmitzm/data/RasterCalculator.java
===================================================================
--- branches/1.0-gt2-2.6/src/schmitzm/data/RasterCalculator.java	2009-11-24 17:33:29 UTC (rev 570)
+++ branches/1.0-gt2-2.6/src/schmitzm/data/RasterCalculator.java	2009-11-24 18:16:18 UTC (rev 571)
@@ -38,6 +38,9 @@
  * @version 1.0
  */
 public class RasterCalculator {
+  /** Instanz des Parsers. */
+  public static final RasterOperationTreeParser RASTER_CALC_PARSER = new RasterOperationTreeParser();
+
   /////////////////////////////////////////////////////////////////////
   /////////////////////   FORMEL AUSFUEHREN   /////////////////////////
   /////////////////////////////////////////////////////////////////////
@@ -54,7 +57,7 @@
    * @see RasterOperationTreeParser
    */
   public static void calculate(String rule, ReadableGrid[] inRaster, RasterFilter[] inFilter, WritableGrid outRaster ) {
-    RasterOperationTree opTree = new RasterOperationTreeParser().parse(rule);
+    RasterOperationTree opTree = RASTER_CALC_PARSER.parse(rule);
     if ( opTree == null )
       return;
 
@@ -104,6 +107,6 @@
    * @exception IllegalArgumentException bei einem Fehler
    */
   public static void checkRuleAndError(String rule) {
-    new RasterOperationTreeParser().parse(rule);
+    RASTER_CALC_PARSER.parse(rule);
   }
 }

Modified: branches/1.0-gt2-2.6/src/schmitzm/data/RasterOperationTreeParser.java
===================================================================
--- branches/1.0-gt2-2.6/src/schmitzm/data/RasterOperationTreeParser.java	2009-11-24 17:33:29 UTC (rev 570)
+++ branches/1.0-gt2-2.6/src/schmitzm/data/RasterOperationTreeParser.java	2009-11-24 18:16:18 UTC (rev 571)
@@ -118,5 +118,42 @@
     pushbackWithWSToken();
     return super.parseLiteral();
   }
+  
+  ////////////////////////////////////////////////////////////////
+  /////////////////   ParserOperatorsHints   /////////////////////
+  ////////////////////////////////////////////////////////////////
+  /**
+   * Initialises the list of available operators.
+   * @see #getOperators()
+   * @see #avOperators
+   */
+  @Override
+  protected void initOperatorList() {
+    super.initOperatorList();
+    // Zur Verfuegung stehende Operatoren erweitern
+    avOperators.add("X");           
+    avOperators.add("Y");           
+    avOperators.add("NoData");   
+    avOperators.add("isNoData");   
+    
+    // Keys fuer Lokalisation neu aufbauen
+    initOperatorKeys();
+  }
+  
+  /**
+   * Liefert die Anzahl an geklammerten Parametern, die ein Operator hat.
+   * Erweitert die Methode der Oberklasse um den Operator {@code isNoData(.)}
+   * und die Filter-Referenz {@code F.}.
+   * @param op Operator
+   * @return 1 fuer {@code isNoData} und {@code F..}, sonst den Wert der {@code super}-Methode
+   */
+  @Override
+  public int getOperatorParameterCount(String op) {
+    // Funktionen mit einem geklammerten Parameter
+    if (op.equalsIgnoreCase("isNoData") || op.charAt(0) == 'F')
+      return 1;
+    return super.getOperatorParameterCount(op);
+  }
+
 }
 

Modified: branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/FeatureOperationTreeParser.java
===================================================================
--- branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/FeatureOperationTreeParser.java	2009-11-24 17:33:29 UTC (rev 570)
+++ branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/FeatureOperationTreeParser.java	2009-11-24 18:16:18 UTC (rev 571)
@@ -100,30 +100,5 @@
       rule = "1";
     return new FeatureOperationTreeFilter(rule);
   }
-
- at Override
-public String getOperatorDescription(String operator) {
-	// TODO Auto-generated method stub
-	return null;
 }
 
- at Override
-public int getOperatorParameterCount(String operator) {
-	// TODO Auto-generated method stub
-	return 0;
-}
-
- at Override
-public String getOperatorTitle(String operator) {
-	// TODO Auto-generated method stub
-	return null;
-}
-
- at Override
-public Vector<String> getOperators() {
-	// TODO Auto-generated method stub
-	return null;
-}
-
-}
-

Modified: branches/1.0-gt2-2.6/src/schmitzm/geotools/gui/FeatureFilterPanel.java
===================================================================
--- branches/1.0-gt2-2.6/src/schmitzm/geotools/gui/FeatureFilterPanel.java	2009-11-24 17:33:29 UTC (rev 570)
+++ branches/1.0-gt2-2.6/src/schmitzm/geotools/gui/FeatureFilterPanel.java	2009-11-24 18:16:18 UTC (rev 571)
@@ -131,7 +131,7 @@
 	 *            Unterklasse erfolgen!)
 	 */
 	protected FeatureFilterPanel(FilterParser parser, SimpleFeatureType ftype, boolean initGUI) {
-		super(false);
+		super(parser,false);
 		setFilterParser(parser);
 
 		// Zusaetzliche Operatoren und Konstanten

Modified: branches/1.0-gt2-2.6/src/schmitzm/lang/tree/OperationTreeParser.java
===================================================================
--- branches/1.0-gt2-2.6/src/schmitzm/lang/tree/OperationTreeParser.java	2009-11-24 17:33:29 UTC (rev 570)
+++ branches/1.0-gt2-2.6/src/schmitzm/lang/tree/OperationTreeParser.java	2009-11-24 18:16:18 UTC (rev 571)
@@ -29,7 +29,10 @@
  ******************************************************************************/
 package schmitzm.lang.tree;
 
+import java.util.HashMap;
+import java.util.Map;
 import java.util.NoSuchElementException;
+import java.util.Vector;
 
 import org.apache.log4j.Logger;
 
@@ -41,6 +44,8 @@
 import schmitzm.lang.tree.OperationTree.MultiParamOperatorNode;
 import schmitzm.lang.tree.OperationTree.OperatorNode;
 import schmitzm.lang.tree.OperationTree.UnaryOperatorNode;
+import schmitzm.swing.ParserOperatorsHints;
+import schmitzm.swing.SwingUtil;
 
 /**
  * Diese Klasse stellt einen Parser fuer einen {@linkplain OperationTree Operator-Baum}
@@ -133,7 +138,7 @@
  * @author <a href="mailto:martin.schmitz at koeln.de">Martin Schmitz</a> (University of Bonn/Germany)
  * @version 1.0
  */
-public class OperationTreeParser {
+public class OperationTreeParser implements ParserOperatorsHints {
   private Logger LOG = Logger.getLogger(this.getClass());
 
   /** Ergebnis-Typ von {@link #checkRuleClosing(String)}. */
@@ -162,6 +167,16 @@
    */
   protected String delimiter    = null;
 
+  /** Contains the operators available to create a valid rule.<br>
+   *  <b>Note: These operators do not effect the parsing process, but
+   *     only used for user/GUI interaction. */
+  protected Vector<String>  avOperators = new Vector<String>();
+
+  /** Contains a resource key postfix for each operator in {@link #avOperators},
+   *  because not all operators (e.g. "=") can be used as resource key in
+   *  property files. */
+  protected Map<String,String>  avOperatorsKeys = new HashMap<String,String>();
+
   /**
    * Erzeugt eine neue Instanz des Parsers.
    */
@@ -171,6 +186,7 @@
                 getStringEncapsulationChars() +
                 getParameterSeperatorChars() +
                 getOperatorChars() + "\n";
+    initOperatorList();
   }
 
   ///////////////////////////////////////////////////////////////////
@@ -1136,4 +1152,156 @@
     while ( tok.pushback().trim().equals("") );
   }
 
+  ////////////////////////////////////////////////////////////////
+  /////////////////   ParserOperatorsHints   /////////////////////
+  ////////////////////////////////////////////////////////////////
+  /**
+   * Initialises the list of available operators.
+   * @see #getOperators()
+   * @see #avOperators
+   */
+  protected void initOperatorList() {
+    // Zur Verfuegung stehende Operatoren
+    avOperators.clear();
+    avOperators.add("&");           
+    avOperators.add("|");           
+    avOperators.add("!");           
+    avOperators.add("abs");         
+    avOperators.add("sqrt");        
+    avOperators.add("round");       
+    avOperators.add("trunc");       
+    avOperators.add("isNaN");       
+    avOperators.add("NaN");         
+    avOperators.add("random");      
+    avOperators.add("sin");         
+    avOperators.add("cos");         
+    avOperators.add("tan");         
+    avOperators.add("asin");        
+    avOperators.add("acos");        
+    avOperators.add("atan");        
+    avOperators.add("exp");         
+    avOperators.add("ln");          
+    avOperators.add("log");         
+    avOperators.add("str");         
+    avOperators.add("val");         
+    avOperators.add("len");         
+    avOperators.add("toupper");     
+    avOperators.add("tolower");     
+    avOperators.add("ITE");         
+    avOperators.add("REGEX");       
+    avOperators.add("SUBSTR");      
+    // Die "einfachen Operatoren" and Ende setzen, da diese eigentlich
+    // menuell eingegeben werden und nicht so oft gebraucht werden
+    avOperators.add("+"); 
+    avOperators.add("-"); 
+    avOperators.add("*"); 
+    avOperators.add("/"); 
+    avOperators.add("^"); 
+    avOperators.add("="); 
+    avOperators.add("<>");
+    avOperators.add("<"); 
+    avOperators.add("<=");
+    avOperators.add(">"); 
+    avOperators.add(">=");
+    
+    initOperatorKeys();
+  }
+  
+  /**
+   * Initialises the localisation key list for the available operators.
+   * @see #avOperatorsKeys
+   */
+  protected void initOperatorKeys() {
+    avOperatorsKeys.clear();
+    // Usually the operator can be uses as key for localization...
+    for (String op : avOperators)
+      avOperatorsKeys.put(op,op);
+    // ... but some operators can not be used as keys, so they are replaced
+    // with special keys
+    avOperatorsKeys.put("&","and");
+    avOperatorsKeys.put("|","or");
+    avOperatorsKeys.put("!","not");
+    avOperatorsKeys.put("+","plus");
+    avOperatorsKeys.put("-","minus");
+    avOperatorsKeys.put("*","multiply");
+    avOperatorsKeys.put("/","divide");
+    avOperatorsKeys.put("^","pow");
+    avOperatorsKeys.put("=","eq");
+    avOperatorsKeys.put("<>","ne");
+    avOperatorsKeys.put("<","lt");
+    avOperatorsKeys.put("<=","le");
+    avOperatorsKeys.put(">","gt");
+    avOperatorsKeys.put(">=","ge");
+  }
+  
+  /**
+   * Returns the operators, which are available for creating a
+   * valid rule.<br> 
+   * <b>This method is not used for the parsing process, but only
+   * for GUI/User interaction!</b>  
+   */
+  @Override
+  public Vector<String> getOperators() {
+    return avOperators;
+  }
+
+  /**
+   * Returns a short (internationalised) title for an operator. 
+   * @param operator an operator
+   * @return {@code null} if operator is undefined
+   */
+  @Override
+  public String getOperatorTitle(String operator) {
+    String opKey = avOperatorsKeys.get(operator);
+    if ( opKey == null )
+      return null;
+    return SwingUtil.RESOURCE.getString("OperationTreePanel.OpDesc."+opKey);
+  }
+
+  /**
+   * Returns an (internationalised) description for an operator. 
+   * @param operator an operator
+   * @return {@code null} if operator is undefined
+   */
+  @Override
+  public String getOperatorDescription(String operator) {
+    String opKey = avOperatorsKeys.get(operator);
+    if ( opKey == null )
+      return null;
+    return SwingUtil.RESOURCE.getString("OperationTreePanel.OpTooltip."+opKey);
+  }
+
+  /**
+   * Returns the number of bracked-enclosed parameters for an operator.
+   * @param op an operator
+   * @return {@code 0} if operator is undefined
+   */
+  @Override
+  public int getOperatorParameterCount(String op) {
+    // Funktionen mit einem geklammerten Parameter
+    if (op.equalsIgnoreCase("abs") || op.equalsIgnoreCase("sqrt") ||
+        op.equalsIgnoreCase("round") || op.equalsIgnoreCase("trunc") ||
+        op.equalsIgnoreCase("isNaN") || op.equalsIgnoreCase("sin") ||
+        op.equalsIgnoreCase("cos") || op.equalsIgnoreCase("tan") ||
+        op.equalsIgnoreCase("asin") || op.equalsIgnoreCase("acos") ||
+        op.equalsIgnoreCase("atan") || op.equalsIgnoreCase("exp") ||
+        op.equalsIgnoreCase("ln") || op.equalsIgnoreCase("log") ||
+        op.equalsIgnoreCase("val") || op.equalsIgnoreCase("str") ||
+        op.equalsIgnoreCase("toupper") || op.equalsIgnoreCase("tolower") ||
+        op.equalsIgnoreCase("!") )
+      return 1;
+
+    // Funktionen mit zwei geklammerten Parameter
+    if (op.equalsIgnoreCase("REGEX") )
+      return 2;
+
+    // Funktionen mit drei geklammerten Parameter
+    if (op.equalsIgnoreCase("ITE") || op.equalsIgnoreCase("SUBSTR") )
+      return 3;
+
+    // sonst: Konstante/Alias angenommen
+    return 0;
+  }
+
+
 }

Modified: branches/1.0-gt2-2.6/src/schmitzm/swing/OperationTreePanel.java
===================================================================
--- branches/1.0-gt2-2.6/src/schmitzm/swing/OperationTreePanel.java	2009-11-24 17:33:29 UTC (rev 570)
+++ branches/1.0-gt2-2.6/src/schmitzm/swing/OperationTreePanel.java	2009-11-24 18:16:18 UTC (rev 571)
@@ -93,32 +93,40 @@
   protected JButton startButton = null;
   /** Auswahl-Liste der zur Verfuegung stehenden Operatoren und Konstanzen. */
   protected SelectionInputOption.Combo<String> operators = null;
+  /** Liefert Informationen ueber die Operatoren, die dem Nutzer in der
+   *  ComboBox zur Verfuegung gestellt werden. */
+  protected ParserOperatorsHints opHints = null;
   /** Enthaelt die in der Operator-Auswahl zur Verfuegung gestellten Operatoren
    *  Konstanten */
-  protected Vector<String>         avOperators     = new Vector<String>();
+  private Vector<String> avOperators     = new Vector<String>();
   /** Enthaelt die in der Operator-Auswahl angezeigen Operatoren Konstanten */
-  protected HashMap<String,String> avOperatorsDesc = new HashMap<String,String>();
+  private HashMap<String,String> avOperatorsTitle = new HashMap<String,String>();
   /** Enthaelt die in der Operator-Auswahl angezeigen Tooltips der Operatoren. */
-  protected HashMap<Object,String> avOperatorsToolTip = new HashMap<Object,String>();
-
+  private HashMap<Object,String> avOperatorsToolTip = new HashMap<Object,String>();
+ 
   private JTextField ruleTextField = null;
   private JComboBox  operatorsComboBox = null;
 
   /**
    * Erzeugt eine neue Eingabe-GUI fuer den {@link OperationTree}.
+   * @param opHints Liefert Informationen ueber die Operatoren, die dem Nutzer in der
+   *                ComboBox zur Verfuegung gestellt werden.
    */
-  public OperationTreePanel() {
-    this(true);
+  public OperationTreePanel(ParserOperatorsHints opHints) {
+    this(opHints,true);
   }
 
   /**
    * Erzeugt eine neue Eingabe-GUI fuer den {@link OperationTree}.
+   * @param opHints Liefert Informationen ueber die Operatoren, die dem Nutzer in der
+   *                ComboBox zur Verfuegung gestellt werden.
    * @param initGUI Flag, ob {@link #initGUI()} am Ende des Konstruktor
    *        aufgerufen werden soll (wenn {@code false} muss die explizit
    *        durch die Unterklasse erfolgen!)
    */
-  protected OperationTreePanel(boolean initGUI) {
+  protected OperationTreePanel(ParserOperatorsHints opHints, boolean initGUI) {
     super();
+    this.opHints = opHints;
     this.setPreferredSize( new Dimension(500,400) );
     this.setLayout( new GridBagLayout() );
 
@@ -127,53 +135,16 @@
     layoutConstraints.put(OPERATOR_COMBOBOX, new GridBagConstraints(1,0,1,1,0.0,0.0,GridBagConstraints.SOUTHEAST, GridBagConstraints.NONE, new Insets(0,10,5,10),0,0));
     layoutConstraints.put(START_BUTTON,      new GridBagConstraints(0,1,1,1,0.0,0.0,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,10,5,10),0,0));
 
-    // Zur Verfuegung stehende Operatoren
-    avOperators.add("&");            fillOperatorDescMaps("&",       "and");
-    avOperators.add("|");            fillOperatorDescMaps("|",       "or");
-    avOperators.add("!");            fillOperatorDescMaps("!",       "not");
-    avOperators.add("abs");          fillOperatorDescMaps("abs",     "abs");
-    avOperators.add("sqrt");         fillOperatorDescMaps("sqrt",    "sqrt");
-    avOperators.add("round");        fillOperatorDescMaps("round",   "round");
-    avOperators.add("trunc");        fillOperatorDescMaps("trunc",   "trunc");
-    avOperators.add("isNaN");        fillOperatorDescMaps("isNaN",   "isNaN");
-    avOperators.add("NaN");          fillOperatorDescMaps("NaN",     "NaN");
-    avOperators.add("random");       fillOperatorDescMaps("random",  "random");
-    avOperators.add("sin");          fillOperatorDescMaps("sin",     "sin");
-    avOperators.add("cos");          fillOperatorDescMaps("cos",     "cos");
-    avOperators.add("tan");          fillOperatorDescMaps("tan",     "tan");
-    avOperators.add("asin");         fillOperatorDescMaps("asin",    "asin");
-    avOperators.add("acos");         fillOperatorDescMaps("acos",    "acos");
-    avOperators.add("atan");         fillOperatorDescMaps("atan",    "atan");
-    avOperators.add("exp");          fillOperatorDescMaps("exp",     "exp");
-    avOperators.add("ln");           fillOperatorDescMaps("ln",      "ln");
-    avOperators.add("log");          fillOperatorDescMaps("log",     "log");
-    avOperators.add("str");          fillOperatorDescMaps("str",     "str");
-    avOperators.add("val");          fillOperatorDescMaps("val",     "val");
-    avOperators.add("len");          fillOperatorDescMaps("len",     "len");
-    avOperators.add("toupper");      fillOperatorDescMaps("toupper", "toupper");
-    avOperators.add("tolower");      fillOperatorDescMaps("tolower", "tolower");
-    avOperators.add("ITE");          fillOperatorDescMaps("ITE",     "ite");
-    avOperators.add("REGEX");        fillOperatorDescMaps("REGEX",   "regex");
-    avOperators.add("SUBSTR");       fillOperatorDescMaps("SUBSTR",  "substr");
-    // Die "einfachen Operatoren" and Ende setzen, da diese eigentlich
-    // menuell eingegeben werden und nicht so oft gebraucht werden
-    avOperators.add("+");            fillOperatorDescMaps("+",  "plus");
-    avOperators.add("-");            fillOperatorDescMaps("-",  "minus");
-    avOperators.add("*");            fillOperatorDescMaps("*",  "multiply");
-    avOperators.add("/");            fillOperatorDescMaps("/",  "divide");
-    avOperators.add("^");            fillOperatorDescMaps("^",  "pow");
-    avOperators.add("=");            fillOperatorDescMaps("=",  "eq");
-    avOperators.add("<>");           fillOperatorDescMaps("<>", "ne");
-    avOperators.add("<");            fillOperatorDescMaps("<",  "lt");
-    avOperators.add("<=");           fillOperatorDescMaps("<=", "le");
-    avOperators.add(">");            fillOperatorDescMaps(">",  "gt");
-    avOperators.add(">=");           fillOperatorDescMaps(">=", "ge");
     
     // Operatoren filtern
-    for (String op : new Vector<String>(avOperators))
-      if ( !acceptOperator(op) )
-        avOperators.remove(op);
-
+    if ( this.opHints != null )
+      for (String op : opHints.getOperators() )
+        if ( acceptOperator(op) ) {
+          avOperators.add(op);
+          avOperatorsTitle.put(op, opHints.getOperatorTitle(op));
+          avOperatorsToolTip.put(opHints.getOperatorTitle(op), opHints.getOperatorDescription(op));
+        }
+    
     if (initGUI)
       initGUI();
   }
@@ -202,7 +173,7 @@
     String[] opArr  = (String[])avOperators.toArray(new String[0]);
     String[] opDesc = new String[opArr.length];
     for (int i=0; i<opArr.length; i++) {
-      String desc = avOperatorsDesc.get(opArr[i]);
+      String desc = avOperatorsTitle.get(opArr[i]);
       opDesc[i] = (desc == null) ? opArr[i] : desc;
     }
     operators = new SelectionInputOption.Combo<String>(
@@ -245,21 +216,6 @@
   }
 
   /**
-   * Befuellt die Maps fuer Beschreibung und Tooltip der Operatoren
-   * @param op    Operator 
-   * @param opKey key fuer den Operator in der Lokalisation
-   */
-  private void fillOperatorDescMaps(String op, String opKey) {
-    // Operator-Bezeichnung, die in ComboBox angezeigt wird.
-    String desc = SwingUtil.RESOURCE.getString("OperationTreePanel.OpDesc."+opKey);
-    avOperatorsDesc.put(op, desc );
-    // Tooltip zum Operator
-    // --> Map fuer ComboBox-Tooltip muss ueber die in der ComboBox
-    //     angezeigten Werte (also "desc") erstellt werden!
-    avOperatorsToolTip.put(desc, desc+": "+SwingUtil.RESOURCE.getString("OperationTreePanel.OpTooltip."+opKey) );
-  }
-
-  /**
    * Setzt die Labels des Panels neu. Die Beschriftungen werden in einer
    * Map hinterlegt und ueber die Konstanten {@link #RULE_LABEL}, {@link #RULE_TOOLTIP},
    * {@link #OPERATOR_LABEL} und {@link #START_BUTTON} angesprochen.
@@ -361,7 +317,7 @@
     String selection = textField.getSelectedText();
 
     // Anzahl an geklammerten Parametern fuer den Operator ermitteln
-    int parameterCount = getParameterCount(op);
+    int parameterCount = opHints.getOperatorParameterCount(op);
 
     // Bei mehr-stelligen Funktionen, erhaelt die Funktion den selektierten
     // Bereich als ersten Operand
@@ -388,34 +344,4 @@
       textField.setSelectionEnd( selStart + op.length() );
     }
   }
-
-  /**
-   * Liefert die Anzahl an geklammerten Parametern, die ein Operator hat.
-   * @param op Operator
-   */
-  protected int getParameterCount(String op) {
-    // Funktionen mit einem geklammerten Parameter
-    if (op.equalsIgnoreCase("abs") || op.equalsIgnoreCase("sqrt") ||
-        op.equalsIgnoreCase("round") || op.equalsIgnoreCase("trunc") ||
-        op.equalsIgnoreCase("isNaN") || op.equalsIgnoreCase("sin") ||
-        op.equalsIgnoreCase("cos") || op.equalsIgnoreCase("tan") ||
-        op.equalsIgnoreCase("asin") || op.equalsIgnoreCase("acos") ||
-        op.equalsIgnoreCase("atan") || op.equalsIgnoreCase("exp") ||
-        op.equalsIgnoreCase("ln") || op.equalsIgnoreCase("log") ||
-        op.equalsIgnoreCase("val") || op.equalsIgnoreCase("str") ||
-        op.equalsIgnoreCase("toupper") || op.equalsIgnoreCase("tolower") ||
-        op.equalsIgnoreCase("!") )
-      return 1;
-
-    // Funktionen mit zwei geklammerten Parameter
-    if (op.equalsIgnoreCase("REGEX") )
-      return 2;
-
-    // Funktionen mit drei geklammerten Parameter
-    if (op.equalsIgnoreCase("ITE") || op.equalsIgnoreCase("SUBSTR") )
-      return 3;
-
-    // sonst: Konstante/Alias angenommen
-    return 0;
-  }
 }

Modified: branches/1.0-gt2-2.6/src/schmitzm/swing/resource/locales/SwingResourceBundle.properties
===================================================================
--- branches/1.0-gt2-2.6/src/schmitzm/swing/resource/locales/SwingResourceBundle.properties	2009-11-24 17:33:29 UTC (rev 570)
+++ branches/1.0-gt2-2.6/src/schmitzm/swing/resource/locales/SwingResourceBundle.properties	2009-11-24 18:16:18 UTC (rev 571)
@@ -116,9 +116,9 @@
 OperationTreePanel.OpDesc.len=len($TEXT)
 OperationTreePanel.OpDesc.toupper=toupper($TEXT)
 OperationTreePanel.OpDesc.tolower=tolower($TEXT)
-OperationTreePanel.OpDesc.ite=IF .. THEN .. ELSE
-OperationTreePanel.OpDesc.regex=REGEX( $TEXT , REGEX)
-OperationTreePanel.OpDesc.substr=SUBSTRING( $TEXT , $NUMBER , $NUMBER)
+OperationTreePanel.OpDesc.ITE=IF .. THEN .. ELSE
+OperationTreePanel.OpDesc.REGEX=REGEX( $TEXT , REGEX)
+OperationTreePanel.OpDesc.SUBSTR=SUBSTRING( $TEXT , $NUMBER , $NUMBER)
 OperationTreePanel.OpDesc.plus=+
 OperationTreePanel.OpDesc.minus=-
 OperationTreePanel.OpDesc.multiply=*
@@ -130,6 +130,10 @@
 OperationTreePanel.OpDesc.le=<=
 OperationTreePanel.OpDesc.gt=>
 OperationTreePanel.OpDesc.ge=>=
+OperationTreePanel.OpDesc.X=Raster cell X
+OperationTreePanel.OpDesc.Y=Raster cell Y
+OperationTreePanel.OpDesc.NoData=NoData value
+OperationTreePanel.OpDesc.isNoData=isNoData(.)
 
 OperationTreePanel.OpTooltip.and=Returns TRUE only if both arguments is TRUE.
 OperationTreePanel.OpTooltip.or=Returns TRUE is any argument is TRUE.
@@ -169,6 +173,10 @@
 OperationTreePanel.OpTooltip.le=Lesser or equal
 OperationTreePanel.OpTooltip.gt=Greater
 OperationTreePanel.OpTooltip.ge=Greater or equal
+OperationTreePanel.OpTooltip.X=Returns the raster cells X coordinate
+OperationTreePanel.OpTooltip.Y=Returns the raster cells Y coordinate
+OperationTreePanel.OpTooltip.NoData=Constant for the NoData value
+OperationTreePanel.OpTooltip.isNoData=Returns TRUE if cell contains no data.
 
 TranslationAskJDialog.Title=Please translate
 TranslationAskJDialog.ErrorMsg.InvalidCharacterInTranslation = Sorry, but you must not use characters { and } in any text label.

Modified: branches/1.0-gt2-2.6/src/schmitzm/swing/resource/locales/SwingResourceBundle_de.properties
===================================================================
--- branches/1.0-gt2-2.6/src/schmitzm/swing/resource/locales/SwingResourceBundle_de.properties	2009-11-24 17:33:29 UTC (rev 570)
+++ branches/1.0-gt2-2.6/src/schmitzm/swing/resource/locales/SwingResourceBundle_de.properties	2009-11-24 18:16:18 UTC (rev 571)
@@ -115,6 +115,10 @@
 OperationTreePanel.OpDesc.le=<=
 OperationTreePanel.OpDesc.gt=>
 OperationTreePanel.OpDesc.ge=>=
+OperationTreePanel.OpDesc.X=X-Koordinate
+OperationTreePanel.OpDesc.Y=Y-Koordinate
+OperationTreePanel.OpDesc.NoData=NoData
+OperationTreePanel.OpDesc.isNoData=isNoData(.)
 
 OperationTreePanel.OpTooltip.and=Liefert WAHR, wenn beide Argumente WAHR sind. 
 OperationTreePanel.OpTooltip.or=Liefert WAHR, sobald ein Argument WAHR ist.
@@ -140,9 +144,9 @@
 OperationTreePanel.OpTooltip.len=Berechnet die L\u00e4nge eines Texts.
 OperationTreePanel.OpTooltip.toupper=Konvertiert Text in Gro\u00dfbuchstaben.
 OperationTreePanel.OpTooltip.tolower=Konvertiert Text in Kleinbuchstaben.
-OperationTreePanel.OpTooltip.ite=Spezifiziert einen logischen Test.
-OperationTreePanel.OpTooltip.regex=Wertet einen regul\u00e4ren Ausdruck auf einem Text aus.
-OperationTreePanel.OpTooltip.substr=Liefert einen Teil-String.
+OperationTreePanel.OpTooltip.ITE=Spezifiziert einen logischen Test.
+OperationTreePanel.OpTooltip.REGEX=Wertet einen regul\u00e4ren Ausdruck auf einem Text aus.
+OperationTreePanel.OpTooltip.SUBSTR=Liefert einen Teil-String.
 OperationTreePanel.OpTooltip.plus=Addition
 OperationTreePanel.OpTooltip.minus=Subtraktion
 OperationTreePanel.OpTooltip.multiply=Multiplikation
@@ -154,6 +158,10 @@
 OperationTreePanel.OpTooltip.le=Kleiner oder gleich
 OperationTreePanel.OpTooltip.gt=Gr\u00f6\u00dfer als 
 OperationTreePanel.OpTooltip.ge=Gr\u00f6\u00dfer oder gleich
+OperationTreePanel.OpTooltip.X=Liefert die X-Koordinate einer Zelle (in Raster-Koordinaten)
+OperationTreePanel.OpTooltip.Y=Liefert die Y-Koordinate einer Zelle (in Raster-Koordinaten)
+OperationTreePanel.OpTooltip.NoData=Liefert den "NoData"-Wert
+OperationTreePanel.OpTooltip.isNoData=Liefert WAHR, wenn die Zelle keinen Wert beinhaltet
 
 TranslationAskJDialog.Title=Bitte \u00fcbersetzen
 TranslationAskJDialog.ErrorMsg.InvalidCharacterInTranslation = Die Zeichen { und } d\u00fcrfen Sie leider nicht benutzen.

Modified: branches/1.0-gt2-2.6/src/schmitzm/swing/resource/locales/SwingResourceBundle_fr.properties
===================================================================
--- branches/1.0-gt2-2.6/src/schmitzm/swing/resource/locales/SwingResourceBundle_fr.properties	2009-11-24 17:33:29 UTC (rev 570)
+++ branches/1.0-gt2-2.6/src/schmitzm/swing/resource/locales/SwingResourceBundle_fr.properties	2009-11-24 18:16:18 UTC (rev 571)
@@ -101,9 +101,9 @@
 OperationTreePanel.OpTooltip.len=Calcule la longueur d'un texte.
 OperationTreePanel.OpTooltip.toupper=Convertit texte en majuscules.
 OperationTreePanel.OpTooltip.tolower=Convertit texte en minuscules.
-OperationTreePanel.OpTooltip.ite=Sp\u00e9cifie un texte logique.
-OperationTreePanel.OpTooltip.regex=utilise une expression r\u00e9guli\u00e8re sur un texte.
-OperationTreePanel.OpTooltip.substr= Fournit une partie du string.
+OperationTreePanel.OpTooltip.ITE=Sp\u00e9cifie un texte logique.
+OperationTreePanel.OpTooltip.REGEX=utilise une expression r\u00e9guli\u00e8re sur un texte.
+OperationTreePanel.OpTooltip.SUBSTR= Fournit une partie du string.
 OperationTreePanel.OpTooltip.plus=Addition
 OperationTreePanel.OpTooltip.minus=Soustractio
 OperationTreePanel.OpTooltip.multiply=Multiplication



More information about the Schmitzm-commits mailing list