[Schmitzm-commits] r626 - in branches/2.0-RC2/src/schmitzm/geotools: feature gui

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Jan 28 12:44:01 CET 2010


Author: mojays
Date: 2010-01-28 12:44:00 +0100 (Thu, 28 Jan 2010)
New Revision: 626

Modified:
   branches/2.0-RC2/src/schmitzm/geotools/feature/FeatureTypeBuilderTableModel.java
   branches/2.0-RC2/src/schmitzm/geotools/gui/FeatureLayerFilterDialog.java
   branches/2.0-RC2/src/schmitzm/geotools/gui/FeatureTypeInputOption.java
   branches/2.0-RC2/src/schmitzm/geotools/gui/JEditorPane.java
Log:
some changes to make the FeatureCollection editor stable again.

Modified: branches/2.0-RC2/src/schmitzm/geotools/feature/FeatureTypeBuilderTableModel.java
===================================================================
--- branches/2.0-RC2/src/schmitzm/geotools/feature/FeatureTypeBuilderTableModel.java	2010-01-28 11:01:15 UTC (rev 625)
+++ branches/2.0-RC2/src/schmitzm/geotools/feature/FeatureTypeBuilderTableModel.java	2010-01-28 11:44:00 UTC (rev 626)
@@ -25,7 +25,7 @@
  * 
  * Contributors:
  *     Martin O. J. Schmitz - initial API and implementation
- *     Stefan A. Krüger - additional utility classes
+ *     Stefan A. Krüger - additional utility classes
  ******************************************************************************/
 package schmitzm.geotools.feature;
 
@@ -111,16 +111,19 @@
    * Erstellt ein leeres Tabellen-Modell.
    */
   public FeatureTypeBuilderTableModel() {
-    this(null);
+    this(null,null);
   }
 
   /**
    * Erstellt ein neues Tabellen-Modell.
    * @param type ein SimpleFeatureType, der editiert wird
+   * @param typeName (neuer) Name fuer via {@link #createFeatureType()}
+   *                 erzeugte {@link SimpleFeatureType} (wenn {@code null}, wird
+   *                 der Name von {@code type} verwendet oder ein Default!)
    */
-  public FeatureTypeBuilderTableModel(SimpleFeatureType type) {
+  public FeatureTypeBuilderTableModel(SimpleFeatureType type, String typeName) {
     super();
-    setFeatureType(type);
+    setFeatureType(type, typeName);
   }
 
   /**
@@ -181,8 +184,9 @@
    * Dieser wird mit den Attributen des angegebenen {@link SimpleFeatureType}
    * initialisiert
    * @param ftype {@link SimpleFeatureType}
+   * @param typeName new name for the {@link SimpleFeatureType} (can be {@code null})
    */
-  public void setFeatureType(SimpleFeatureType ftype) {
+  public void setFeatureType(SimpleFeatureType ftype, String typeName) {
     // Attribut-Typen in Array speichern
     attrDefinitions.clear();
     if ( featureTypeBuilder != null )
@@ -198,7 +202,15 @@
     
     this.featureTypeBuilder = new SimpleFeatureTypeBuilder();
     this.featureTypeBuilder.init(ftype);
-
+    
+    // Set (new) name for FeatureType
+    if ( typeName != null )
+      this.featureTypeBuilder.setName(typeName);
+    else if ( ftype != null )
+      this.featureTypeBuilder.setName(ftype.getName());
+    else
+      this.featureTypeBuilder.setName("NewFeatureType");
+    
     this.fireTableDataChanged();
   }
 

Modified: branches/2.0-RC2/src/schmitzm/geotools/gui/FeatureLayerFilterDialog.java
===================================================================
--- branches/2.0-RC2/src/schmitzm/geotools/gui/FeatureLayerFilterDialog.java	2010-01-28 11:01:15 UTC (rev 625)
+++ branches/2.0-RC2/src/schmitzm/geotools/gui/FeatureLayerFilterDialog.java	2010-01-28 11:44:00 UTC (rev 626)
@@ -66,7 +66,7 @@
  * neuen Layers reagiert werden kann. Standardmaessig wird ein
  * {@link FeatureOperationTreeParser} verwendet, um die eingegebene Formel zu
  * parsen (und einen {@link FeatureOperationTreeFilter} zu erstellen). Ueber
- * {@code getFeatureCollectionFilterPanel().setFilterParser(FilterParser)} kann
+ * {@code getFilterPanel().setFilterParser(FilterParser)} kann
  * dieser jedoch einfach geaendert werden.
  * 
  * @see FeatureCollectionFilterPanel

Modified: branches/2.0-RC2/src/schmitzm/geotools/gui/FeatureTypeInputOption.java
===================================================================
--- branches/2.0-RC2/src/schmitzm/geotools/gui/FeatureTypeInputOption.java	2010-01-28 11:01:15 UTC (rev 625)
+++ branches/2.0-RC2/src/schmitzm/geotools/gui/FeatureTypeInputOption.java	2010-01-28 11:44:00 UTC (rev 626)
@@ -25,7 +25,7 @@
  * 
  * Contributors:
  *     Martin O. J. Schmitz - initial API and implementation
- *     Stefan A. Krüger - additional utility classes
+ *     Stefan A. Krüger - additional utility classes
  ******************************************************************************/
 package schmitzm.geotools.gui;
 
@@ -52,6 +52,9 @@
   /** Beinhaltet das Tabellen-Modell, in dem die Attribute verwaltet
    *  werden. */
   protected FeatureTypeBuilderTableModel inpTableModel;
+  /** Beinhaltet den Namen der beim Erzeugen des {@link SimpleFeatureType}
+   *  gesetzt wird. */
+  protected String fTypeName = null;
 
   /**
    * Erzeugt einen neue Eingabe-Option.
@@ -71,8 +74,9 @@
    */
   public FeatureTypeInputOption(String label, boolean inputNeeded, SimpleFeatureType fType) {
     super(label, inputNeeded, true);
-    if (fType != null)
+    if (fType != null) {
       setValue(fType);
+    }
   }
 
   /**
@@ -101,7 +105,7 @@
    * @return immer {@code true}
    */
   protected boolean performSetValue(SimpleFeatureType newValue) {
-    inpTableModel.setFeatureType(newValue);
+    inpTableModel.setFeatureType(newValue, null);
     return true;
   }
 

Modified: branches/2.0-RC2/src/schmitzm/geotools/gui/JEditorPane.java
===================================================================
--- branches/2.0-RC2/src/schmitzm/geotools/gui/JEditorPane.java	2010-01-28 11:01:15 UTC (rev 625)
+++ branches/2.0-RC2/src/schmitzm/geotools/gui/JEditorPane.java	2010-01-28 11:44:00 UTC (rev 626)
@@ -228,6 +228,7 @@
    * Instead this method reacts according to the current
    * editor mode.
    */
+//  @Override
   public void mouseClicked(MouseEvent e) {
     Point2D geoCoord = getScreenToWorld().transform(e.getPoint(), null);
     // Zunaechst Modus auf NULL pruefen, da ansonsten



More information about the Schmitzm-commits mailing list