/[schmitzm]/branches/2.2.x/src/skrueger/geotools/StyledFeatureCollectionTableModel.java
ViewVC logotype

Diff of /branches/2.2.x/src/skrueger/geotools/StyledFeatureCollectionTableModel.java

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

revision 769 by alfonx, Sun Mar 21 11:02:34 2010 UTC revision 862 by alfonx, Sat May 22 01:24:46 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 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;
 import skrueger.AttributeMetadata;  
48  import skrueger.AttributeMetadataImpl;  import skrueger.AttributeMetadataImpl;
49    import skrueger.AttributeMetadataInterface;
50    
51  import com.vividsolutions.jts.geom.Envelope;  import com.vividsolutions.jts.geom.Envelope;
52    
# Line 61  import com.vividsolutions.jts.geom.Envel Line 61  import com.vividsolutions.jts.geom.Envel
61   * applied.</li>   * applied.</li>
62   * </ul>   * </ul>
63   *   *
64   * @author Stefan A. Krüger   * @author Stefan A. Tzeggai
65   */   */
66  public class StyledFeatureCollectionTableModel extends  public class StyledFeatureCollectionTableModel extends
67                  FeatureCollectionTableModel {                  FeatureCollectionTableModel {
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.769  
changed lines
  Added in v.862

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26