/[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 52 by mojays, Fri Apr 17 13:57:14 2009 UTC revision 53 by mojays, Fri Apr 17 14:04:22 2009 UTC
# Line 27  import skrueger.AttributeMetaData; Line 27  import skrueger.AttributeMetaData;
27    
28    
29  /**  /**
30   * This class extends the   * This class extends the the {@link FeatureCollectionTableModel} with the
31     * functionalities of the {@link AttributeMetaData} (AMD) of {@linkplain StyledMapInterface styled objects}.
32     * <ul>
33     *   <li>column names are translated according to (AMD)</li>
34     *   <li>columns are hidden according to
35     * </ul>
36   * @author <a href="mailto:[email protected]">Martin Schmitz</a> (University of Bonn/Germany)   * @author <a href="mailto:[email protected]">Martin Schmitz</a> (University of Bonn/Germany)
37   *   *
38   */   */
# Line 47  public class StyledFeatureCollectionTabl Line 52  public class StyledFeatureCollectionTabl
52        
53    protected void setFeatureSource(FeatureSource fs, Map<Integer,AttributeMetaData> amd) throws Exception {    protected void setFeatureSource(FeatureSource fs, Map<Integer,AttributeMetaData> amd) throws Exception {
54      FeatureCollection fc = null;      FeatureCollection fc = null;
55      this.visibleAMD      = new TreeMap<Integer, AttributeMetaData>();      this.visibleAMD      = null;
56      if ( fs != null ) {      if ( fs != null ) {
57        Query query = new DefaultQuery();        Query query = new DefaultQuery();
58        if ( amd != null ) {        if ( amd != null ) {
# Line 98  public class StyledFeatureCollectionTabl Line 103  public class StyledFeatureCollectionTabl
103    public void reorganize() {    public void reorganize() {
104      super.reorganize();      super.reorganize();
105      // translate the column names      // translate the column names
106      Iterator<Integer> keys = visibleAMD.keySet().iterator();      if ( visibleAMD != null ) {
107      for (int i=0; keys.hasNext(); i++)        Iterator<Integer> keys = visibleAMD.keySet().iterator();
108        colNames[i] = visibleAMD.get( keys.next() ).getTitle().toString();        for (int i=0; keys.hasNext(); i++)
109            colNames[i] = visibleAMD.get( keys.next() ).getTitle().toString();
110        }
111    }    }
   
112  }  }

Legend:
Removed from v.52  
changed lines
  Added in v.53

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26