/[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 771 by alfonx, Sun Mar 21 11:02:34 2010 UTC revision 772 by alfonx, Sun Mar 21 14:05:26 2010 UTC
# Line 45  import org.opengis.filter.Filter; Line 45  import org.opengis.filter.Filter;
45    
46  import schmitzm.geotools.feature.FeatureUtil;  import schmitzm.geotools.feature.FeatureUtil;
47  import schmitzm.geotools.gui.FeatureCollectionTableModel;  import schmitzm.geotools.gui.FeatureCollectionTableModel;
48  import skrueger.AttributeMetadata;  import skrueger.AttributeMetadataInterface;
49  import skrueger.AttributeMetadataImpl;  import skrueger.AttributeMetadataImpl;
50    
51  import com.vividsolutions.jts.geom.Envelope;  import com.vividsolutions.jts.geom.Envelope;
# Line 68  public class StyledFeatureCollectionTabl Line 68  public class StyledFeatureCollectionTabl
68          final static private Logger LOGGER = Logger          final static private Logger LOGGER = Logger
69                          .getLogger(StyledFeatureCollectionTableModel.class);                          .getLogger(StyledFeatureCollectionTableModel.class);
70          /** Contains the complete {@link AttributeMetadataImpl}-Map of the styled layer. */          /** Contains the complete {@link AttributeMetadataImpl}-Map of the styled layer. */
71          protected AttributeMetadataMap<? extends AttributeMetadata> amdMap = null;          protected AttributeMetadataMap<? extends AttributeMetadataInterface> amdMap = null;
72          /** Holds the current filter on the table */          /** Holds the current filter on the table */
73          protected Filter filter = null;          protected Filter filter = null;
74          /** Holds the Bounds for all features. Only set once during the constructor **/          /** Holds the Bounds for all features. Only set once during the constructor **/
# Line 80  public class StyledFeatureCollectionTabl Line 80  public class StyledFeatureCollectionTabl
80          protected String[] colTooltips = null;          protected String[] colTooltips = null;
81    
82          /** A cache for the #sortedValuesVisibleOnly() **/          /** A cache for the #sortedValuesVisibleOnly() **/
83          protected List<? extends AttributeMetadata> amdMapVisibleOnly = null;          protected List<? extends AttributeMetadataInterface> amdMapVisibleOnly = null;
84    
85          /**          /**
86           * Creates a new table model for a styled layer.           * Creates a new table model for a styled layer.
# Line 116  public class StyledFeatureCollectionTabl Line 116  public class StyledFeatureCollectionTabl
116           */           */
117          protected void setFeatureSource(          protected void setFeatureSource(
118                          FeatureSource<SimpleFeatureType, SimpleFeature> fs,                          FeatureSource<SimpleFeatureType, SimpleFeature> fs,
119                          AttributeMetadataMap<? extends AttributeMetadata> amdm, Filter filter) throws Exception {                          AttributeMetadataMap<? extends AttributeMetadataInterface> amdm, Filter filter) throws Exception {
120    
121                  if (filter == null)                  if (filter == null)
122                          filter = Filter.INCLUDE;                          filter = Filter.INCLUDE;
# Line 141  public class StyledFeatureCollectionTabl Line 141  public class StyledFeatureCollectionTabl
141                                                  .getLocalName());                                                  .getLocalName());
142    
143                                  // Add other visible attributes as ordered by weights                                  // Add other visible attributes as ordered by weights
144                                  for (AttributeMetadata a : amdMapVisibleOnly) {                                  for (AttributeMetadataInterface a : amdMapVisibleOnly) {
145                                          visibleAttrNames.add(a.getLocalName());                                          visibleAttrNames.add(a.getLocalName());
146                                  }                                  }
147    
# Line 208  public class StyledFeatureCollectionTabl Line 208  public class StyledFeatureCollectionTabl
208                          SimpleFeatureType schema = featureArray[0].getFeatureType();                          SimpleFeatureType schema = featureArray[0].getFeatureType();
209                          // Pruefen, welche Attribute angezeigt werden                          // Pruefen, welche Attribute angezeigt werden
210                          attrTypes.clear();                          attrTypes.clear();
211                          for (AttributeMetadata amd : amdMapVisibleOnly) {                          for (AttributeMetadataInterface amd : amdMapVisibleOnly) {
212                                  AttributeDescriptor type = schema.getDescriptor(amd.getName());                                  AttributeDescriptor type = schema.getDescriptor(amd.getName());
213                                  if (attrFilter == null || attrFilter.accept(type))                                  if (attrFilter == null || attrFilter.accept(type))
214                                          attrTypes.add(type);                                          attrTypes.add(type);
# Line 230  public class StyledFeatureCollectionTabl Line 230  public class StyledFeatureCollectionTabl
230                                  String attName = schema.getAttributeDescriptors().get(idx)                                  String attName = schema.getAttributeDescriptors().get(idx)
231                                                  .getLocalName();                                                  .getLocalName();
232                                  colNames[i] = amdMap.get(attName).getTitle().toString();                                  colNames[i] = amdMap.get(attName).getTitle().toString();
233                                  AttributeMetadata amd = amdMap.get(attName);                                  AttributeMetadataInterface amd = amdMap.get(attName);
234                                  colTooltips[i] = "<html>" + amd.getDesc().toString() + "<br>"                                  colTooltips[i] = "<html>" + amd.getDesc().toString() + "<br>"
235                                                  + amd.getName() + "</html>";                                                  + amd.getName() + "</html>";
236                                  colClass[i] = schema.getAttributeDescriptors().get(idx)                                  colClass[i] = schema.getAttributeDescriptors().get(idx)

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26