[Schmitzm-commits] r332 - in branches/1.0-gt2-2.6/src: junit/skrueger/i8n org/geotools/gui/swing org/geotools/renderer/shape schmitzm/geotools/feature schmitzm/geotools/gui schmitzm/jfree/feature/style schmitzm/lang skrueger skrueger/geotools skrueger/geotools/labelsearch

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Aug 26 19:15:51 CEST 2009


Author: alfonx
Date: 2009-08-26 19:15:49 +0200 (Wed, 26 Aug 2009)
New Revision: 332

Modified:
   branches/1.0-gt2-2.6/src/junit/skrueger/i8n/SwitchLanguageDialogTest.java
   branches/1.0-gt2-2.6/src/org/geotools/gui/swing/JMapPane.java
   branches/1.0-gt2-2.6/src/org/geotools/renderer/shape/TransitionShapefileRenderer.java
   branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/AbstractAutoValueGenerator.java
   branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/AttributeTypeFilter.java
   branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/AutoValueGenerator.java
   branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/FeatureTableModel.java
   branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/FeatureTypeBuilderTableModel.java
   branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/FeatureTypeTableModel.java
   branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/FeatureUtil.java
   branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/NumberValueGenerator.java
   branches/1.0-gt2-2.6/src/schmitzm/geotools/gui/FeatureCollectionTableModel.java
   branches/1.0-gt2-2.6/src/schmitzm/geotools/gui/JEditorPane.java
   branches/1.0-gt2-2.6/src/schmitzm/jfree/feature/style/FeatureChartUtil.java
   branches/1.0-gt2-2.6/src/schmitzm/lang/LangUtil.java
   branches/1.0-gt2-2.6/src/skrueger/AttributeMetaDataAttributeTypeFilter.java
   branches/1.0-gt2-2.6/src/skrueger/geotools/LegendIconFeatureRenderer.java
   branches/1.0-gt2-2.6/src/skrueger/geotools/StyledFS.java
   branches/1.0-gt2-2.6/src/skrueger/geotools/StyledFeatureCollectionTableModel.java
   branches/1.0-gt2-2.6/src/skrueger/geotools/labelsearch/LabelSearch.java
Log:
* Replaced every occurrance of AttributeType with AttributeDescriptor
 - I think it saves a lot of typing...

Modified: branches/1.0-gt2-2.6/src/junit/skrueger/i8n/SwitchLanguageDialogTest.java
===================================================================
--- branches/1.0-gt2-2.6/src/junit/skrueger/i8n/SwitchLanguageDialogTest.java	2009-08-26 16:22:38 UTC (rev 331)
+++ branches/1.0-gt2-2.6/src/junit/skrueger/i8n/SwitchLanguageDialogTest.java	2009-08-26 17:15:49 UTC (rev 332)
@@ -31,6 +31,10 @@
 
 import java.util.ArrayList;
 
+import junit.framework.TestCase;
+
+import org.junit.Test;
+
 import skrueger.i8n.SwitchLanguageDialog;
 
 public class SwitchLanguageDialogTest extends TestCase {

Modified: branches/1.0-gt2-2.6/src/org/geotools/gui/swing/JMapPane.java
===================================================================
--- branches/1.0-gt2-2.6/src/org/geotools/gui/swing/JMapPane.java	2009-08-26 16:22:38 UTC (rev 331)
+++ branches/1.0-gt2-2.6/src/org/geotools/gui/swing/JMapPane.java	2009-08-26 17:15:49 UTC (rev 332)
@@ -85,7 +85,6 @@
 
 import schmitzm.swing.SwingUtil;
 
-import com.sun.jini.jeri.internal.runtime.SelectionManager;
 import com.vividsolutions.jts.geom.Coordinate;
 import com.vividsolutions.jts.geom.Envelope;
 import com.vividsolutions.jts.geom.Geometry;

Modified: branches/1.0-gt2-2.6/src/org/geotools/renderer/shape/TransitionShapefileRenderer.java
===================================================================
--- branches/1.0-gt2-2.6/src/org/geotools/renderer/shape/TransitionShapefileRenderer.java	2009-08-26 16:22:38 UTC (rev 331)
+++ branches/1.0-gt2-2.6/src/org/geotools/renderer/shape/TransitionShapefileRenderer.java	2009-08-26 17:15:49 UTC (rev 332)
@@ -54,7 +54,6 @@
 import org.geotools.data.shapefile.shp.ShapeType;
 import org.geotools.data.shapefile.shp.ShapefileReader;
 import org.geotools.data.shapefile.shp.ShapefileReader.Record;
-import org.geotools.feature.AttributeType;
 import org.geotools.feature.FeatureTypeBuilder;
 import org.geotools.feature.GeometryAttributeType;
 import org.geotools.feature.SchemaException;
@@ -93,6 +92,7 @@
 import org.geotools.util.NumberRange;
 import org.opengis.feature.simple.SimpleFeature;
 import org.opengis.feature.simple.SimpleFeatureType;
+import org.opengis.feature.type.AttributeDescriptor;
 import org.opengis.filter.Filter;
 import org.opengis.referencing.FactoryException;
 import org.opengis.referencing.crs.CoordinateReferenceSystem;
@@ -205,7 +205,7 @@
 	IndexInfo[] layerIndexInfo;
 
 	/**
-	 * Maps between the AttributeType index of the new generated SimpleFeatureType and
+	 * Maps between the AttributeDescriptor index of the new generated SimpleFeatureType and
 	 * the real attributeType
 	 */
 	int[] attributeIndexing;
@@ -801,7 +801,7 @@
 		final SimpleFeatureType schema = ds.getSchema();
 		final String[] attributes = findStyleAttributes((query == null) ? Query.ALL
 				: query, style, schema);
-		final AttributeType[] types = new AttributeType[attributes.length];
+		final AttributeDescriptor[] types = new AttributeDescriptor[attributes.length];
 		attributeIndexing = new int[attributes.length];
 
 		if (attributes.length == 1

Modified: branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/AbstractAutoValueGenerator.java
===================================================================
--- branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/AbstractAutoValueGenerator.java	2009-08-26 16:22:38 UTC (rev 331)
+++ branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/AbstractAutoValueGenerator.java	2009-08-26 17:15:49 UTC (rev 332)
@@ -29,13 +29,13 @@
  ******************************************************************************/
 package schmitzm.geotools.feature;
 
-import org.geotools.feature.AttributeType;
+import org.opengis.feature.type.AttributeDescriptor;
 
 /**
  * This interface represents a generator to create an attribute default
  * value individually.
- * @see FeatureUtil#registerAutoValueGenerator(AttributeType, AutoValueGenerator)
- * @see FeatureUtil#getAutoValueGenerator(AttributeType)
+ * @see FeatureUtil#registerAutoValueGenerator(AttributeDescriptor, AutoValueGenerator)
+ * @see FeatureUtil#getAutoValueGenerator(AttributeDescriptor)
  * @author <a href="mailto:martin.schmitz at koeln.de">Martin Schmitz</a> (University of Bonn/Germany)
  */
 public abstract class AbstractAutoValueGenerator<E> implements AutoValueGenerator<E> {

Modified: branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/AttributeTypeFilter.java
===================================================================
--- branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/AttributeTypeFilter.java	2009-08-26 16:22:38 UTC (rev 331)
+++ branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/AttributeTypeFilter.java	2009-08-26 17:15:49 UTC (rev 332)
@@ -29,8 +29,8 @@
  ******************************************************************************/
 package schmitzm.geotools.feature;
 
-import org.geotools.feature.AttributeType;
 import org.geotools.feature.type.GeometricAttributeType;
+import org.opengis.feature.type.AttributeDescriptor;
 
 import schmitzm.geotools.gui.FeatureFilterPanel;
 
@@ -54,7 +54,7 @@
    * Standard-Filter, der alle Attribute akzeptiert.
    */
   public static final AttributeTypeFilter ALL = new AttributeTypeFilter() {
-    public boolean accept(AttributeType type, int idx) {
+    public boolean accept(AttributeDescriptor type, int idx) {
       return true;
     }
   };
@@ -64,7 +64,7 @@
    * ausblendet.
    */
   public static final AttributeTypeFilter NO_GEOMETRY = new AttributeTypeFilter() {
-    public boolean accept(AttributeType type, int idx) {
+    public boolean accept(AttributeDescriptor type, int idx) {
       return !( type instanceof GeometricAttributeType );
     }
   };
@@ -74,5 +74,5 @@
    * @param type ein Attribut-Typ
    * @param idx  der Index des Attributs
    */
-  public boolean accept(AttributeType type, int idx);
+  public boolean accept(AttributeDescriptor type, int idx);
 }

Modified: branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/AutoValueGenerator.java
===================================================================
--- branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/AutoValueGenerator.java	2009-08-26 16:22:38 UTC (rev 331)
+++ branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/AutoValueGenerator.java	2009-08-26 17:15:49 UTC (rev 332)
@@ -29,13 +29,13 @@
  ******************************************************************************/
 package schmitzm.geotools.feature;
 
-import org.geotools.feature.AttributeType;
+import org.opengis.feature.type.AttributeDescriptor;
 
 /**
  * This interface represents a generator to create an attribute default
  * value individually.
- * @see FeatureUtil#registerAutoValueGenerator(AttributeType, AutoValueGenerator)
- * @see FeatureUtil#getAutoValueGenerator(AttributeType)
+ * @see FeatureUtil#registerAutoValueGenerator(AttributeDescriptor, AutoValueGenerator)
+ * @see FeatureUtil#getAutoValueGenerator(AttributeDescriptor)
  * @author <a href="mailto:martin.schmitz at koeln.de">Martin Schmitz</a> (University of Bonn/Germany)
  */
 public interface AutoValueGenerator<E> {

Modified: branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/FeatureTableModel.java
===================================================================
--- branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/FeatureTableModel.java	2009-08-26 16:22:38 UTC (rev 331)
+++ branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/FeatureTableModel.java	2009-08-26 17:15:49 UTC (rev 332)
@@ -31,9 +31,9 @@
 
 import javax.swing.table.TableModel;
 
-import org.geotools.feature.AttributeType;
 import org.opengis.feature.simple.SimpleFeature;
 import org.opengis.feature.simple.SimpleFeatureType;
+import org.opengis.feature.type.AttributeDescriptor;
 
 import schmitzm.geotools.gui.GeotoolsGUIUtil;
 import schmitzm.swing.table.AbstractTableModel;
@@ -150,7 +150,7 @@
    * @param columnIndex Spalten-Index (beginnend bei 0)
    */
   public Object getValueAt(int rowIndex, int columnIndex) {
-    AttributeType aType = featureType.getAttributeType(rowIndex);
+    AttributeDescriptor aType = featureType.getAttributeType(rowIndex);
     switch ( columnIndex ) {
       case 0: return aType.getLocalName();
       case 1: return aType.getBinding().getSimpleName();
@@ -166,7 +166,7 @@
    */
   @Override
   public void setValueAt(Object value, int rowIndex, int columnIndex) {
-    AttributeType aType = featureType.getAttributeType(rowIndex);
+    AttributeDescriptor aType = featureType.getAttributeType(rowIndex);
     if ( "".equals(value) )
       value = null;
     if ( value != null &&  Number.class.isAssignableFrom(aType.getBinding()) )

Modified: branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/FeatureTypeBuilderTableModel.java
===================================================================
--- branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/FeatureTypeBuilderTableModel.java	2009-08-26 16:22:38 UTC (rev 331)
+++ branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/FeatureTypeBuilderTableModel.java	2009-08-26 17:15:49 UTC (rev 332)
@@ -41,13 +41,13 @@
 import javax.swing.JTextField;
 import javax.swing.table.TableModel;
 
-import org.geotools.feature.AttributeType;
 import org.geotools.feature.AttributeTypeFactory;
 import org.geotools.feature.DefaultAttributeType;
 import org.geotools.feature.FeatureTypeBuilder;
 import org.geotools.feature.SchemaException;
 import org.geotools.feature.type.GeometricAttributeType;
 import org.opengis.feature.simple.SimpleFeatureType;
+import org.opengis.feature.type.AttributeDescriptor;
 
 import schmitzm.geotools.gui.GeotoolsGUIUtil;
 import schmitzm.swing.BooleanInputOption;
@@ -197,7 +197,7 @@
     attrDefinitions.clear();
     if ( featureTypeBuilder != null )
       for (int i=0; i<featureTypeBuilder.getAttributeCount(); i++) {
-        AttributeType type = featureTypeBuilder.get(i);
+        AttributeDescriptor type = featureTypeBuilder.get(i);
         attrDefinitions.add( new AttributeDefinition(
             type.getLocalName(),
             type.getBinding(),
@@ -235,7 +235,7 @@
         this.featureTypeBuilder.removeType(0);
 
       for (AttributeDefinition aDef : attrDefinitions) {
-        AttributeType aType = aDef.createAttributeType();
+        AttributeDescriptor aType = aDef.createAttributeType();
         featureTypeBuilder.addType( aType );
         if ( featureTypeBuilder.getDefaultGeometry() == null &&
              aType instanceof GeometricAttributeType )
@@ -365,10 +365,10 @@
     }
 
     /**
-     * Creates an {@link AttributeType} from the definition.
+     * Creates an {@link AttributeDescriptor} from the definition.
      * @return {@link DefaultAttributeType} or {@link GeometricAttributeType}
      */
-    public AttributeType createAttributeType() {
+    public AttributeDescriptor createAttributeType() {
       Class   type         = (Class)this.type.getValue();
       boolean nillable     = (Boolean)this.nillable.getValue();
       Object  defaultValue = this.defaultValue.getValue();
@@ -379,7 +379,7 @@
       if ( defaultValue == null && !nillable )
         defaultValue = FeatureUtil.getDefaultAttributeValue(type);
 
-      AttributeType aType = AttributeTypeFactory.newAttributeType(
+      AttributeDescriptor aType = AttributeTypeFactory.newAttributeType(
           (String)name.getValue(),
           type,
           nillable,

Modified: branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/FeatureTypeTableModel.java
===================================================================
--- branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/FeatureTypeTableModel.java	2009-08-26 16:22:38 UTC (rev 331)
+++ branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/FeatureTypeTableModel.java	2009-08-26 17:15:49 UTC (rev 332)
@@ -33,8 +33,8 @@
 
 import javax.swing.table.TableModel;
 
-import org.geotools.feature.AttributeType;
 import org.opengis.feature.simple.SimpleFeatureType;
+import org.opengis.feature.type.AttributeDescriptor;
 
 import schmitzm.geotools.gui.GeotoolsGUIUtil;
 import schmitzm.swing.table.AbstractTableModel;
@@ -54,7 +54,7 @@
   protected AttributeTypeFilter attrFilter = AttributeTypeFilter.ALL;
 
   /** Speichert die (die gefilterten!) Attibut-Typen des Features.*/
-  protected Vector<AttributeType> attrTypes = new Vector<AttributeType>();
+  protected Vector<AttributeDescriptor> attrTypes = new Vector<AttributeDescriptor>();
 
   /**
    * Erstellt ein leeres Tabellen-Modell.
@@ -82,7 +82,7 @@
     attrTypes.clear();
     if ( featureType != null )
       for (int i=0; i<featureType.getAttributeCount(); i++) {
-        AttributeType type = featureType.getAttributeType(i);
+        AttributeDescriptor type = featureType.getAttributeType(i);
         if ( attrFilter == null || attrFilter.accept( type, i ) )
           attrTypes.add( type );
       }
@@ -140,7 +140,7 @@
    * @param columnIndex Spalten-Index (beginnend bei 0)
    */
   public Object getValueAt(int rowIndex, int columnIndex) {
-    AttributeType aType = attrTypes.elementAt(rowIndex);
+    AttributeDescriptor aType = attrTypes.elementAt(rowIndex);
     switch ( columnIndex ) {
       case 0: return aType.getLocalName();
       case 1: return aType.getBinding().getSimpleName();

Modified: branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/FeatureUtil.java
===================================================================
--- branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/FeatureUtil.java	2009-08-26 16:22:38 UTC (rev 331)
+++ branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/FeatureUtil.java	2009-08-26 17:15:49 UTC (rev 332)
@@ -52,7 +52,6 @@
 import org.geotools.data.memory.MemoryDataStore;
 import org.geotools.factory.CommonFactoryFinder;
 import org.geotools.factory.GeoTools;
-import org.geotools.feature.AttributeType;
 import org.geotools.feature.AttributeTypeFactory;
 import org.geotools.feature.DefaultFeatureCollection;
 import org.geotools.feature.DefaultFeatureCollections;
@@ -73,6 +72,7 @@
 import org.geotools.util.SimpleInternationalString;
 import org.opengis.feature.simple.SimpleFeature;
 import org.opengis.feature.simple.SimpleFeatureType;
+import org.opengis.feature.type.AttributeDescriptor;
 import org.opengis.filter.FilterFactory2;
 import org.opengis.referencing.crs.CoordinateReferenceSystem;
 
@@ -155,10 +155,10 @@
   }
 
   /**
-   * Enthaelt die {@link AttributeType AttributeTypes}, fuer die
+   * Enthaelt die {@link AttributeDescriptor AttributeTypes}, fuer die
    * automatisch Werte generiert werden koennen.
    */
-  private static HashMap<AttributeType, AutoValueGenerator> autoAttrValueGenerators = new HashMap<AttributeType, AutoValueGenerator>();
+  private static HashMap<AttributeDescriptor, AutoValueGenerator> autoAttrValueGenerators = new HashMap<AttributeDescriptor, AutoValueGenerator>();
 
   /**
    * Determines the kind of geometry of a {@link SimpleFeatureType}.
@@ -427,8 +427,8 @@
       fTypeName = fType.getTypeName();
 
     FeatureTypeBuilder builder = FeatureTypeBuilder.newInstance(fType.getTypeName());
-    for (AttributeType aType : fType.getAttributeTypes() ) {
-      AttributeType aTypeClone = cloneAttributeType(aType, nillable);
+    for (AttributeDescriptor aType : fType.getAttributeTypes() ) {
+      AttributeDescriptor aTypeClone = cloneAttributeType(aType, nillable);
       if ( aTypeClone instanceof GeometryAttributeType && builder.getDefaultGeometry() == null )
         builder.setDefaultGeometry( (GeometryAttributeType)aTypeClone );
       else
@@ -438,16 +438,16 @@
   }
 
   /**
-   * Clones an {@link AttributeType}.
+   * Clones an {@link AttributeDescriptor}.
    * @param aType type to clone
    * @param nillable the clone gets this value for its nillable property independently
    *                 of {@code aType.isNillable()} (if {@code null} the nillable property
    *                 is taken from {@code aType})
    *
    */
-  public static AttributeType cloneAttributeType(AttributeType aType, Boolean nillable) {
+  public static AttributeDescriptor cloneAttributeType(AttributeDescriptor aType, Boolean nillable) {
     // If no special nillable property is specified, take it from the
-    // given AttributeType
+    // given AttributeDescriptor
     if ( nillable == null )
       nillable = aType.isNillable();
 
@@ -480,7 +480,7 @@
    * @throws SchemaException falls das Erweitern des SimpleFeature-Schemas scheitert
    * @throws NullPointerException falls {@code fType = null}
    */
-  public static SimpleFeatureType extendFeatureType(SimpleFeatureType fType, AttributeType... aTypes) throws SchemaException {
+  public static SimpleFeatureType extendFeatureType(SimpleFeatureType fType, AttributeDescriptor... aTypes) throws SchemaException {
 //BEMERKUNG: Folgende Methode funktioniert, fuegt die abgeleiteten (alten)
 //           Attribute aber hinten an die neuen Attribute an. Dies ist
 //           nicht gewuenscht und erschwert auch den Aufbau des fValues-Array
@@ -494,7 +494,7 @@
 //    );
     FeatureTypeBuilder builder = FeatureTypeBuilder.newInstance(fType.getTypeName());
     builder.addTypes( fType.getAttributeTypes() ); // old attributes
-    for (AttributeType aType : aTypes )
+    for (AttributeDescriptor aType : aTypes )
       try {
         if ( aType instanceof GeometryAttributeType && builder.getDefaultGeometry() == null )
           builder.setDefaultGeometry( (GeometryAttributeType)aType );
@@ -512,7 +512,7 @@
       }
     SimpleFeatureType resultType = builder.getFeatureType();
 
-    // As long as DataUtilities.defaultValue(AttributeType) does
+    // As long as DataUtilities.defaultValue(AttributeDescriptor) does
     // not handle the default value correctly for not-nillable
     // attributes, create a new SimpleFeatureType with all attributes
     // nillable
@@ -583,7 +583,7 @@
    * @throws IllegalAttributeException falls das Einfuegen der Features in die
    *         neue {@link FeatureCollection} scheitert
    */
-  public static FeatureCollection<SimpleFeatureType, SimpleFeature> extendFeatureCollection(FeatureCollection<SimpleFeatureType, SimpleFeature> fc, AttributeType... aTypes) throws SchemaException, IllegalAttributeException  {
+  public static FeatureCollection<SimpleFeatureType, SimpleFeature> extendFeatureCollection(FeatureCollection<SimpleFeatureType, SimpleFeature> fc, AttributeDescriptor... aTypes) throws SchemaException, IllegalAttributeException  {
     // Schema erstellen
     SimpleFeatureType fType = fc.getSchema();
     SimpleFeatureType resultType = extendFeatureType( fType, aTypes );
@@ -671,7 +671,7 @@
         //             von "fValues" der Attributwert aus fc1 in der inneren
         //             FOR-Schleife ggf. durch den Attributwert von fc2
         //             ueberschrieben wird!)
-        AttributeType aType = fType2.getAttributeType(attrName);
+        AttributeDescriptor aType = fType2.getAttributeType(attrName);
         // zweite Wahl: Attribut von fc1 uebernehmen
         if ( aType == null )
           aType = fType1.getAttributeType(attrName);
@@ -810,7 +810,7 @@
 
     // Wenn keine Attribute angegeben sind, alle verwenden
     for (int i=0; i<attrCount; i++) {
-      AttributeType attrType = attrName.length > 0 ? ft.getAttributeType(attrName[i]) : ft.getAttributeType(i);
+      AttributeDescriptor attrType = attrName.length > 0 ? ft.getAttributeType(attrName[i]) : ft.getAttributeType(i);
       // wenn attrType = null, dann gibt es das Attribut im SimpleFeatureType nicht
       // -> destArray nicht ueberschreiben
       if ( attrType != null )
@@ -824,7 +824,7 @@
    * @param attrType Attribut-Typ
    * @return {@code null}, wenn das Attribut NILLABLE ist
    */
-  public static Object getDefaultAttributeValue(AttributeType attrType) {
+  public static Object getDefaultAttributeValue(AttributeDescriptor attrType) {
     return( getDefaultAttributeValue(attrType, true) );
   }
 
@@ -834,7 +834,7 @@
    * @param allowNull wenn {@code false}, wird in jedem Fall ein Wert ungleich
    *                  {@code null} geliefert, auch wenn das Attribut NILLABLE ist
    */
-  public static Object getDefaultAttributeValue(AttributeType attrType, boolean allowNull) {
+  public static Object getDefaultAttributeValue(AttributeDescriptor attrType, boolean allowNull) {
 //    AutoValueGenerator avg = getAutoValueGenerator(attrType);
 //    Object attrValue = (avg == null) ? attrType.createDefaultValue() : avg.getNextValue();
     Object attrValue = attrType.createDefaultValue();
@@ -992,7 +992,7 @@
   public static FeatureCollection<SimpleFeatureType, SimpleFeature> joinFeatureCollection(JoinType joinType, FeatureCollection<SimpleFeatureType, SimpleFeature> fc, String fcJoinAttr, AttributeFilter compareOp, ResultSet rs, String rsJoinAttr, String... projAttr) throws SchemaException, IllegalAttributeException, SQLException  {
     if ( fcJoinAttr == null || fcJoinAttr.trim().equals("") ) {
       // Erste Nicht-Geometrie-Spalte suchen
-      for (AttributeType aType : fc.getSchema().getAttributeTypes()) {
+      for (AttributeDescriptor aType : fc.getSchema().getAttributeTypes()) {
         if ( aType != fc.getSchema().getDefaultGeometry() ) {
           fcJoinAttr = aType.getName();
           break;
@@ -1098,7 +1098,7 @@
     for (String attrName : projAttr)
       projAttrList.add(attrName);
 
-    // Fuer alle Attribute aus Metadaten einen AttributeType erzeugen
+    // Fuer alle Attribute aus Metadaten einen AttributeDescriptor erzeugen
     // und diesen in SimpleFeatureType uebernehmen
     FeatureTypeBuilder   featureTypeFac = FeatureTypeBuilder.newInstance(featureTypeName);
     for (int i=1; i<=metaData.getColumnCount(); i++) {
@@ -1176,42 +1176,42 @@
   }
 
   /**
-   * Registriert einen {@link AutoValueGenerator} fuer einen {@link AttributeType}, so
-   * dass {@link #getNextAutoValue(AttributeType)} fuer diesen {@link AttributeType}
+   * Registriert einen {@link AutoValueGenerator} fuer einen {@link AttributeDescriptor}, so
+   * dass {@link #getNextAutoValue(AttributeDescriptor)} fuer diesen {@link AttributeDescriptor}
    * verwendet werden kann.
-   * @param aType ein {@link AttributeType}
+   * @param aType ein {@link AttributeDescriptor}
    * @param generator generiert automatische Attribut-Werte
    */
-  public static void registerAutoValueGenerator(AttributeType aType, AutoValueGenerator generator) {
+  public static void registerAutoValueGenerator(AttributeDescriptor aType, AutoValueGenerator generator) {
     autoAttrValueGenerators.put(aType, generator);
   }
 
   /**
-   * Entfernt einen {@link AutoValueGenerator} fuer einen {@link AttributeType}.
-   * @param aType ein {@link AttributeType}
+   * Entfernt einen {@link AutoValueGenerator} fuer einen {@link AttributeDescriptor}.
+   * @param aType ein {@link AttributeDescriptor}
    */
-  public static void unregisterAutoValueGenerator(AttributeType aType) {
+  public static void unregisterAutoValueGenerator(AttributeDescriptor aType) {
     if ( autoAttrValueGenerators.containsKey( aType ) )
       autoAttrValueGenerators.remove(aType);
   }
 
   /**
-   * Liefert den {@link AutoValueGenerator} fuer einen {@link AttributeType}.
-   * @param aType ein {@link AttributeType}
-   * @return {@code null}, wenn fuer den {@link AttributeType} noch kein
+   * Liefert den {@link AutoValueGenerator} fuer einen {@link AttributeDescriptor}.
+   * @param aType ein {@link AttributeDescriptor}
+   * @return {@code null}, wenn fuer den {@link AttributeDescriptor} noch kein
    *         {@link AutoValueGenerator} registriert worden ist
    */
-  public static AutoValueGenerator getAutoValueGenerator(AttributeType aType) {
+  public static AutoValueGenerator getAutoValueGenerator(AttributeDescriptor aType) {
     return autoAttrValueGenerators.get(aType);
   }
 
   /**
-   * Liefert den naechsten Auto-Wert fuer einen {@link AttributeType}.
-   * @param aType ein {@link AttributeType}
+   * Liefert den naechsten Auto-Wert fuer einen {@link AttributeDescriptor}.
+   * @param aType ein {@link AttributeDescriptor}
    * @exception UnsupportedOperationException falls fuer das Attribut noch
    *            kein {@link AutoValueGenerator} registriert ist
    */
-  public static Object getNextAutoValue(AttributeType aType) {
+  public static Object getNextAutoValue(AttributeDescriptor aType) {
     AutoValueGenerator avg = getAutoValueGenerator(aType);
     if ( avg == null )
       throw new UnsupportedOperationException("No AutoValueGenerator registered for attribute type: "+aType.getLocalName());

Modified: branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/NumberValueGenerator.java
===================================================================
--- branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/NumberValueGenerator.java	2009-08-26 16:22:38 UTC (rev 331)
+++ branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/NumberValueGenerator.java	2009-08-26 17:15:49 UTC (rev 332)
@@ -29,15 +29,15 @@
  ******************************************************************************/
 package schmitzm.geotools.feature;
 
-import org.geotools.feature.AttributeType;
+import org.opengis.feature.type.AttributeDescriptor;
 
 /**
  * This interface represents a generator for {@link Number} values.
  * Starting with an individual value, the next value is increased
  * with every call of {@link #getNextValue()}. The increase interval
  * can also be set individually.
- * @see FeatureUtil#registerAutoValueGenerator(AttributeType, AutoValueGenerator)
- * @see FeatureUtil#getAutoValueGenerator(AttributeType)
+ * @see FeatureUtil#registerAutoValueGenerator(AttributeDescriptor, AutoValueGenerator)
+ * @see FeatureUtil#getAutoValueGenerator(AttributeDescriptor)
  * @author <a href="mailto:martin.schmitz at koeln.de">Martin Schmitz</a> (University of Bonn/Germany)
  */
 public class NumberValueGenerator extends AbstractAutoValueGenerator<Number> {

Modified: branches/1.0-gt2-2.6/src/schmitzm/geotools/gui/FeatureCollectionTableModel.java
===================================================================
--- branches/1.0-gt2-2.6/src/schmitzm/geotools/gui/FeatureCollectionTableModel.java	2009-08-26 16:22:38 UTC (rev 331)
+++ branches/1.0-gt2-2.6/src/schmitzm/geotools/gui/FeatureCollectionTableModel.java	2009-08-26 17:15:49 UTC (rev 332)
@@ -34,12 +34,12 @@
 
 import javax.swing.table.AbstractTableModel;
 
-import org.geotools.feature.AttributeType;
 import org.geotools.feature.FeatureCollection;
 import org.geotools.feature.FeatureCollections;
 import org.geotools.feature.FeatureIterator;
 import org.opengis.feature.simple.SimpleFeature;
 import org.opengis.feature.simple.SimpleFeatureType;
+import org.opengis.feature.type.AttributeDescriptor;
 
 import schmitzm.geotools.feature.AttributeTypeFilter;
 import schmitzm.geotools.feature.FeatureUtil;
@@ -75,7 +75,7 @@
   protected AttributeTypeFilter attrFilter = AttributeTypeFilter.ALL;
 
   /** Speichert die angezeigten Attribut-Typen. */
-  protected Vector<AttributeType> attrTypes = new Vector<AttributeType>();
+  protected Vector<AttributeDescriptor> attrTypes = new Vector<AttributeDescriptor>();
   /** Speichert den Attribut-Index fuer jede Spalte (wichtig, wenn nicht
    *  alle Spalten angezeigt werden!) */
   protected int[] attrIdxForCol = null;
@@ -130,7 +130,7 @@
       // Pruefen, welche Attribute angezeigt werden
       attrTypes.clear();
       for (int i=0; i<ft.getAttributeCount(); i++) {
-        AttributeType type = ft.getAttributeType(i);
+        AttributeDescriptor type = ft.getAttributeType(i);
         if ( attrFilter == null || attrFilter.accept( type, i ) )
           attrTypes.add( type );
       }

Modified: branches/1.0-gt2-2.6/src/schmitzm/geotools/gui/JEditorPane.java
===================================================================
--- branches/1.0-gt2-2.6/src/schmitzm/geotools/gui/JEditorPane.java	2009-08-26 16:22:38 UTC (rev 331)
+++ branches/1.0-gt2-2.6/src/schmitzm/geotools/gui/JEditorPane.java	2009-08-26 17:15:49 UTC (rev 332)
@@ -41,7 +41,6 @@
 import java.util.Map;
 import java.util.Stack;
 
-import org.geotools.feature.AttributeType;
 import org.geotools.feature.DefaultFeatureCollection;
 import org.geotools.feature.DefaultFeatureCollections;
 import org.geotools.feature.FeatureCollection;
@@ -59,6 +58,7 @@
 import org.geotools.styling.Style;
 import org.opengis.feature.simple.SimpleFeature;
 import org.opengis.feature.simple.SimpleFeatureType;
+import org.opengis.feature.type.AttributeDescriptor;
 
 import schmitzm.geotools.feature.FeatureUtil;
 import schmitzm.geotools.feature.FeatureUtil.GeometryForm;
@@ -776,7 +776,7 @@
         // replace default attribute values with auto generate
         // values (for all registered attributes)
         for (int i=0; i<attr.length; i++) {
-          AttributeType aType = editorFeatureType.getAttributeType(i);
+          AttributeDescriptor aType = editorFeatureType.getAttributeType(i);
           if ( FeatureUtil.getAutoValueGenerator(aType) != null )
             attr[i] = FeatureUtil.getNextAutoValue(aType);
         }

Modified: branches/1.0-gt2-2.6/src/schmitzm/jfree/feature/style/FeatureChartUtil.java
===================================================================
--- branches/1.0-gt2-2.6/src/schmitzm/jfree/feature/style/FeatureChartUtil.java	2009-08-26 16:22:38 UTC (rev 331)
+++ branches/1.0-gt2-2.6/src/schmitzm/jfree/feature/style/FeatureChartUtil.java	2009-08-26 17:15:49 UTC (rev 332)
@@ -39,7 +39,6 @@
 import java.util.Vector;
 
 import org.apache.log4j.Logger;
-import org.geotools.feature.AttributeType;
 import org.geotools.feature.FeatureCollection;
 import org.geotools.feature.FeatureIterator;
 import org.jfree.chart.JFreeChart;
@@ -56,6 +55,7 @@
 import org.jfree.data.xy.XYSeriesCollection;
 import org.opengis.feature.simple.SimpleFeature;
 import org.opengis.feature.simple.SimpleFeatureType;
+import org.opengis.feature.type.AttributeDescriptor;
 
 import schmitzm.geotools.feature.FeatureUtil;
 import schmitzm.geotools.feature.PipedFeatureIterator;
@@ -155,7 +155,7 @@
 			FeatureChartStyle style) {
 		String xAttr = style.getAttributeName(0);
 		// Check the X attribute to differ between XY- and CategoryDataset
-		AttributeType xType = fc.getSchema().getAttributeType(xAttr);
+		AttributeDescriptor xType = fc.getSchema().getAttributeType(xAttr);
 		if (xType == null)
 			throw new UnsupportedOperationException("Unknown attribute: "
 					+ xAttr);
@@ -183,7 +183,7 @@
 	 */
 	private static void checkAttributeType(SimpleFeatureType fType, String aName,
 			Class typeToCheck, String... errDesc) {
-		AttributeType aType = fType.getAttributeType(aName);
+		AttributeDescriptor aType = fType.getAttributeType(aName);
 		if (aType == null)
 			throw new UnsupportedOperationException("Unknown attribute: "
 					+ aName);

Modified: branches/1.0-gt2-2.6/src/schmitzm/lang/LangUtil.java
===================================================================
--- branches/1.0-gt2-2.6/src/schmitzm/lang/LangUtil.java	2009-08-26 16:22:38 UTC (rev 331)
+++ branches/1.0-gt2-2.6/src/schmitzm/lang/LangUtil.java	2009-08-26 17:15:49 UTC (rev 332)
@@ -40,8 +40,6 @@
 import java.util.TreeSet;
 import java.util.Vector;
 
-import net.jini.loader.pref.PreferredClassLoader;
-
 import org.apache.log4j.Category;
 import org.apache.log4j.Logger;
 

Modified: branches/1.0-gt2-2.6/src/skrueger/AttributeMetaDataAttributeTypeFilter.java
===================================================================
--- branches/1.0-gt2-2.6/src/skrueger/AttributeMetaDataAttributeTypeFilter.java	2009-08-26 16:22:38 UTC (rev 331)
+++ branches/1.0-gt2-2.6/src/skrueger/AttributeMetaDataAttributeTypeFilter.java	2009-08-26 17:15:49 UTC (rev 332)
@@ -32,7 +32,7 @@
 import java.util.HashMap;
 import java.util.Map;
 
-import org.geotools.feature.AttributeType;
+import org.opengis.feature.type.AttributeDescriptor;
 
 import schmitzm.geotools.feature.AttributeTypeFilter;
 
@@ -73,7 +73,7 @@
    * Returns {@code true} if the attribute meta data at index {@code idx} is
    * visible and the attribute is no geometry at all.
    */
-  public boolean accept(AttributeType type, int idx) {
+  public boolean accept(AttributeDescriptor type, int idx) {
     // if no meta data is given, all attributes (except Geometry)
     // are treaten as visible
     if ( attrMetaDataMap == null )

Modified: branches/1.0-gt2-2.6/src/skrueger/geotools/LegendIconFeatureRenderer.java
===================================================================
--- branches/1.0-gt2-2.6/src/skrueger/geotools/LegendIconFeatureRenderer.java	2009-08-26 16:22:38 UTC (rev 331)
+++ branches/1.0-gt2-2.6/src/skrueger/geotools/LegendIconFeatureRenderer.java	2009-08-26 17:15:49 UTC (rev 332)
@@ -59,7 +59,6 @@
 import org.apache.log4j.Logger;
 import org.geotools.factory.GeoTools;
 import org.geotools.factory.Hints;
-import org.geotools.feature.AttributeType;
 import org.geotools.feature.IllegalAttributeException;
 import org.geotools.geometry.jts.LiteShape2;
 import org.geotools.renderer.lite.StyledShapePainter;
@@ -76,6 +75,7 @@
 import org.geotools.util.NumberRange;
 import org.opengis.feature.simple.SimpleFeature;
 import org.opengis.feature.simple.SimpleFeatureType;
+import org.opengis.feature.type.AttributeDescriptor;
 
 import schmitzm.geotools.feature.FeatureUtil;
 
@@ -94,7 +94,7 @@
  * <li>07.02.2008:<br>
  * Determining the default values of a {@link SimpleFeatureType} by
  * {@link FeatureUtil#getDefaultAttributeValues(SimpleFeatureType)} instead of using
- * {@link AttributeType#createDefaultValue()} directly, because the latter
+ * {@link AttributeDescriptor#createDefaultValue()} directly, because the latter
  * returns {@code null} even though the attribut is not nillable.</li>
  * </ul>
  * 

Modified: branches/1.0-gt2-2.6/src/skrueger/geotools/StyledFS.java
===================================================================
--- branches/1.0-gt2-2.6/src/skrueger/geotools/StyledFS.java	2009-08-26 16:22:38 UTC (rev 331)
+++ branches/1.0-gt2-2.6/src/skrueger/geotools/StyledFS.java	2009-08-26 17:15:49 UTC (rev 332)
@@ -43,9 +43,9 @@
 
 import org.apache.log4j.Logger;
 import org.geotools.data.FeatureSource;
-import org.geotools.feature.AttributeType;
 import org.geotools.feature.FeatureCollection;
 import org.geotools.styling.Style;
+import org.opengis.feature.type.AttributeDescriptor;
 import org.opengis.referencing.crs.CoordinateReferenceSystem;
 
 import schmitzm.geotools.styling.StylingUtil;
@@ -231,7 +231,7 @@
 
 			// Leaving out the first one, it will be the_geom
 			for (int i = 1; i < fs.getSchema().getAttributeCount(); i++) {
-				AttributeType att = fs.getSchema().getAttributeType(i);
+				AttributeDescriptor att = fs.getSchema().getAttributeType(i);
 
 				AttributeMetaData attMetaData = new AttributeMetaData(i, att
 						.getLocalName());

Modified: branches/1.0-gt2-2.6/src/skrueger/geotools/StyledFeatureCollectionTableModel.java
===================================================================
--- branches/1.0-gt2-2.6/src/skrueger/geotools/StyledFeatureCollectionTableModel.java	2009-08-26 16:22:38 UTC (rev 331)
+++ branches/1.0-gt2-2.6/src/skrueger/geotools/StyledFeatureCollectionTableModel.java	2009-08-26 17:15:49 UTC (rev 332)
@@ -38,8 +38,8 @@
 import org.geotools.data.FeatureSource;
 import org.geotools.data.Query;
 import org.geotools.data.memory.MemoryDataStore;
-import org.geotools.feature.AttributeType;
 import org.geotools.feature.FeatureCollection;
+import org.opengis.feature.type.AttributeDescriptor;
 import org.opengis.filter.Filter;
 
 import schmitzm.geotools.gui.FeatureCollectionTableModel;
@@ -174,7 +174,7 @@
 					 * ArrayOutOfIndex.
 					 */
 					if (attrIdx < fs.getSchema().getAttributeCount()) {
-						final AttributeType attributeTypeAtIdx = fs.getSchema()
+						final AttributeDescriptor attributeTypeAtIdx = fs.getSchema()
 								.getAttributeType(attrIdx);
 						visibleAttrNames.add(attributeTypeAtIdx.getLocalName());
 					} else {

Modified: branches/1.0-gt2-2.6/src/skrueger/geotools/labelsearch/LabelSearch.java
===================================================================
--- branches/1.0-gt2-2.6/src/skrueger/geotools/labelsearch/LabelSearch.java	2009-08-26 16:22:38 UTC (rev 331)
+++ branches/1.0-gt2-2.6/src/skrueger/geotools/labelsearch/LabelSearch.java	2009-08-26 17:15:49 UTC (rev 332)
@@ -38,13 +38,13 @@
 
 import org.apache.log4j.Logger;
 import org.geotools.data.DefaultQuery;
-import org.geotools.feature.AttributeType;
 import org.geotools.feature.FeatureCollection;
 import org.geotools.map.MapLayer;
 import org.geotools.styling.Style;
 import org.geotools.styling.TextSymbolizer;
 import org.opengis.feature.simple.SimpleFeature;
 import org.opengis.feature.simple.SimpleFeatureType;
+import org.opengis.feature.type.AttributeDescriptor;
 import org.opengis.filter.Filter;
 import org.opengis.filter.expression.Expression;
 import org.opengis.filter.expression.PropertyName;
@@ -81,7 +81,7 @@
 		this.mapPane = mapPane;
 	}
 
-	private AttributeType getLabelAttribute(final TextSymbolizer ts,
+	private AttributeDescriptor getLabelAttribute(final TextSymbolizer ts,
 			final SimpleFeatureType schema) {
 		if (ts == null) {
 			// This layer has no labels
@@ -150,7 +150,7 @@
 					if (ts == null)
 						continue;
 
-					final AttributeType labelAttribute = getLabelAttribute(ts, ml
+					final AttributeDescriptor labelAttribute = getLabelAttribute(ts, ml
 							.getFeatureSource().getSchema());
 
 					if (labelAttribute == null) {



More information about the Schmitzm-commits mailing list