[Schmitzm-commits] r53 - trunk/src/skrueger/geotools

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Apr 17 16:04:22 CEST 2009


Author: mojays
Date: 2009-04-17 16:04:22 +0200 (Fri, 17 Apr 2009)
New Revision: 53

Modified:
   trunk/src/skrueger/geotools/StyledFeatureCollectionTableModel.java
Log:
Hacking session in progress. No atomic commits.

Modified: trunk/src/skrueger/geotools/StyledFeatureCollectionTableModel.java
===================================================================
--- trunk/src/skrueger/geotools/StyledFeatureCollectionTableModel.java	2009-04-17 13:57:14 UTC (rev 52)
+++ trunk/src/skrueger/geotools/StyledFeatureCollectionTableModel.java	2009-04-17 14:04:22 UTC (rev 53)
@@ -27,7 +27,12 @@
 
 
 /**
- * This class extends the 
+ * This class extends the the {@link FeatureCollectionTableModel} with the
+ * functionalities of the {@link AttributeMetaData} (AMD) of {@linkplain StyledMapInterface styled objects}.
+ * <ul>
+ *   <li>column names are translated according to (AMD)</li>
+ *   <li>columns are hidden according to
+ * </ul> 
  * @author <a href="mailto:martin.schmitz at koeln.de">Martin Schmitz</a> (University of Bonn/Germany)
  *
  */
@@ -47,7 +52,7 @@
   
   protected void setFeatureSource(FeatureSource fs, Map<Integer,AttributeMetaData> amd) throws Exception {
     FeatureCollection fc = null;
-    this.visibleAMD      = new TreeMap<Integer, AttributeMetaData>();
+    this.visibleAMD      = null;
     if ( fs != null ) {
       Query query = new DefaultQuery();
       if ( amd != null ) {
@@ -98,9 +103,10 @@
   public void reorganize() {
     super.reorganize();
     // translate the column names
-    Iterator<Integer> keys = visibleAMD.keySet().iterator();
-    for (int i=0; keys.hasNext(); i++)
-      colNames[i] = visibleAMD.get( keys.next() ).getTitle().toString();
+    if ( visibleAMD != null ) {
+      Iterator<Integer> keys = visibleAMD.keySet().iterator();
+      for (int i=0; keys.hasNext(); i++)
+        colNames[i] = visibleAMD.get( keys.next() ).getTitle().toString();
+    }
   }
-
 }



More information about the Schmitzm-commits mailing list