/[schmitzm]/trunk/src/skrueger/geotools/StyledFS.java
ViewVC logotype

Diff of /trunk/src/skrueger/geotools/StyledFS.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

branches/1.0-gt2-2.6/src/skrueger/geotools/StyledFS.java revision 464 by alfonx, Tue Oct 13 13:22:31 2009 UTC branches/2.0-RC1/src/skrueger/geotools/StyledFS.java revision 607 by alfonx, Wed Dec 9 15:13:42 2009 UTC
# Line 41  import javax.swing.JPanel; Line 41  import javax.swing.JPanel;
41    
42  import org.apache.log4j.Logger;  import org.apache.log4j.Logger;
43  import org.geotools.data.FeatureSource;  import org.geotools.data.FeatureSource;
 import org.geotools.data.store.EmptyFeatureCollection;  
44  import org.geotools.feature.FeatureCollection;  import org.geotools.feature.FeatureCollection;
45  import org.geotools.styling.Style;  import org.geotools.styling.Style;
46  import org.opengis.feature.simple.SimpleFeature;  import org.opengis.feature.simple.SimpleFeature;
# Line 245  public class StyledFS implements StyledF Line 244  public class StyledFS implements StyledF
244          public AttributeMetadataMap getAttributeMetaDataMap() {          public AttributeMetadataMap getAttributeMetaDataMap() {
245                  if (map == null) {                  if (map == null) {
246    
247                          map = new AttributeMetadataMap();                          map = new AttributeMetadataMap(new String[] {Translation.getActiveLang()});
248    
249                          // Leaving out the first one, it will be the_geom                          // Leaving out the first one, it will be the_geom
250                          for (int i = 1; i < fs.getSchema().getAttributeCount(); i++) {                          for (int i = 1; i < fs.getSchema().getAttributeCount(); i++) {
251                                  AttributeDescriptor attDesc = fs.getSchema().getDescriptor(i);                                  AttributeDescriptor attDesc = fs.getSchema().getDescriptor(i);
252    
253                                  AttributeMetadata attMetaData = new AttributeMetadata(attDesc.getName());                                  AttributeMetadata attMetaData = new AttributeMetadata(attDesc.getName(), map.getLanguages());
254                                  map.put(attDesc.getName(), attMetaData);                                  map.put(attDesc.getName(), attMetaData);
255                          }                          }
256                  }                  }
# Line 303  public class StyledFS implements StyledF Line 302  public class StyledFS implements StyledF
302    
303          @Override          @Override
304          public FeatureCollection<SimpleFeatureType, SimpleFeature> getFeatureCollectionFiltered() {          public FeatureCollection<SimpleFeatureType, SimpleFeature> getFeatureCollectionFiltered() {
305                  final FeatureCollection<SimpleFeatureType, SimpleFeature> fc = getFeatureCollection();  //              final FeatureCollection<SimpleFeatureType, SimpleFeature> fc = getFeatureCollection();
306                  if (filter == Filter.EXCLUDE)  //              if (filter == Filter.EXCLUDE)
307                          return new EmptyFeatureCollection(fc.getSchema());  //                      return new EmptyFeatureCollection(fc.getSchema());
308                  if (filter == Filter.INCLUDE)  //              if (filter == Filter.INCLUDE)
309                          return fc;  //                      return fc;
310                  return fc.subCollection(filter);  //              return fc.subCollection(filter);
311                    
312                    try {
313                            return getFeatureSource().getFeatures(filter);
314                    } catch (IOException e) {
315                            throw new RuntimeException(e);
316                    }
317          }          }
318    
319          @Override          @Override

Legend:
Removed from v.464  
changed lines
  Added in v.607

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26