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

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

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

revision 772 by alfonx, Sun Mar 21 14:05:26 2010 UTC revision 1033 by mojays, Tue Sep 21 14:40:11 2010 UTC
# Line 25  Line 25 
25   *   *
26   * Contributors:   * Contributors:
27   *     Martin O. J. Schmitz - initial API and implementation   *     Martin O. J. Schmitz - initial API and implementation
28   *     Stefan A. Krüger - additional utility classes   *     Stefan A. Tzeggai - additional utility classes
29   ******************************************************************************/   ******************************************************************************/
30  package skrueger.geotools;  package skrueger.geotools;
31    
# Line 41  import org.geotools.feature.FeatureColle Line 41  import org.geotools.feature.FeatureColle
41  import org.opengis.feature.simple.SimpleFeature;  import org.opengis.feature.simple.SimpleFeature;
42  import org.opengis.feature.simple.SimpleFeatureType;  import org.opengis.feature.simple.SimpleFeatureType;
43  import org.opengis.feature.type.AttributeDescriptor;  import org.opengis.feature.type.AttributeDescriptor;
44    import org.opengis.feature.type.Name;
45  import org.opengis.filter.Filter;  import org.opengis.filter.Filter;
46    
47  import schmitzm.geotools.feature.FeatureUtil;  import schmitzm.geotools.feature.FeatureUtil;
48  import schmitzm.geotools.gui.FeatureCollectionTableModel;  import schmitzm.geotools.gui.FeatureCollectionTableModel;
 import skrueger.AttributeMetadataInterface;  
49  import skrueger.AttributeMetadataImpl;  import skrueger.AttributeMetadataImpl;
50    import skrueger.AttributeMetadataInterface;
51    
52  import com.vividsolutions.jts.geom.Envelope;  import com.vividsolutions.jts.geom.Envelope;
53    
# Line 61  import com.vividsolutions.jts.geom.Envel Line 62  import com.vividsolutions.jts.geom.Envel
62   * applied.</li>   * applied.</li>
63   * </ul>   * </ul>
64   *   *
65   * @author Stefan A. Krüger   * @author Stefan A. Tzeggai
66   */   */
67  public class StyledFeatureCollectionTableModel extends  public class StyledFeatureCollectionTableModel extends
68                  FeatureCollectionTableModel {                  FeatureCollectionTableModel {
# Line 209  public class StyledFeatureCollectionTabl Line 210  public class StyledFeatureCollectionTabl
210                          // Pruefen, welche Attribute angezeigt werden                          // Pruefen, welche Attribute angezeigt werden
211                          attrTypes.clear();                          attrTypes.clear();
212                          for (AttributeMetadataInterface amd : amdMapVisibleOnly) {                          for (AttributeMetadataInterface amd : amdMapVisibleOnly) {
213                                  AttributeDescriptor type = schema.getDescriptor(amd.getName());                  Name name = amd.getName();
214                    AttributeDescriptor type = schema.getDescriptor(name);
215                    // if type can not be determined by complete name,
216                    // try only the local name
217                    if ( type == null )
218                      type = schema.getDescriptor(name.getLocalPart());
219                                  if (attrFilter == null || attrFilter.accept(type))                                  if (attrFilter == null || attrFilter.accept(type))
220                                          attrTypes.add(type);                                          attrTypes.add(type);
221                          }                          }
# Line 220  public class StyledFeatureCollectionTabl Line 226  public class StyledFeatureCollectionTabl
226                          colClass = new Class[attrTypes.size()];                          colClass = new Class[attrTypes.size()];
227                          attrIdxForCol = new int[attrTypes.size()];                          attrIdxForCol = new int[attrTypes.size()];
228                          for (int i = 0; i < colNames.length; i++) {                          for (int i = 0; i < colNames.length; i++) {
229                                  AttributeDescriptor descriptor = schema                  Name name = amdMapVisibleOnly.get(i).getName();
230                                                  .getDescriptor(amdMapVisibleOnly.get(i).getName());                  AttributeDescriptor descriptor = schema.getDescriptor(name);
231                    // if type can not be determined by complete name,
232                    // try only the local name
233                    if ( descriptor == null )
234                      descriptor = schema.getDescriptor(name.getLocalPart());
235    
236                                  // Not so nice in 26: find the index of an attribute...                                  // Not so nice in 26: find the index of an attribute...
237                                  int idx = schema.getAttributeDescriptors().indexOf(descriptor);                                  int idx = schema.getAttributeDescriptors().indexOf(descriptor);

Legend:
Removed from v.772  
changed lines
  Added in v.1033

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26