/[schmitzm]/branches/2.0-RC2/src/skrueger/geotools/StyledFS.java
ViewVC logotype

Diff of /branches/2.0-RC2/src/skrueger/geotools/StyledFS.java

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

revision 2 by mojays, Tue Feb 24 22:43:52 2009 UTC revision 176 by alfonx, Wed Jul 1 14:14:15 2009 UTC
# Line 64  public class StyledFS implements StyledF Line 64  public class StyledFS implements StyledF
64           */           */
65          public StyledFS(FeatureSource fs, File sldFile) {          public StyledFS(FeatureSource fs, File sldFile) {
66    
                 super();  
67                  this.fs = fs;                  this.fs = fs;
68                  id = StyledFS.class.getSimpleName()                  id = StyledFS.class.getSimpleName()
69                                  + new Random(new Date().getTime()).nextInt(10000000);                                  + new Random(new Date().getTime()).nextInt(10000000);
# Line 77  public class StyledFS implements StyledF Line 76  public class StyledFS implements StyledF
76                          } catch (FileNotFoundException e) {                          } catch (FileNotFoundException e) {
77                                  LOGGER                                  LOGGER
78                                                  .debug("The SLD file passed was empty. Leaving the Style untouched. (We are in the constructor.. so its null");                                                  .debug("The SLD file passed was empty. Leaving the Style untouched. (We are in the constructor.. so its null");
79                            } catch (Exception e) {
80                                    LOGGER.warn("Reading SLD failed: " + sldFile, e);
81                          }                          }
82                  }                  }
   
83                  title = new Translation();                  title = new Translation();
84                  title.fromOneLine(sldFile.getName());                  title.fromOneLine(sldFile.getName());
85    
# Line 153  public class StyledFS implements StyledF Line 153  public class StyledFS implements StyledF
153                  return false;                  return false;
154          }          }
155    
156          public boolean isHideInLegend() {          /**
157                  return false;           * If true, this layer will not be shown in the legend. Default = false
158          }           */
159            /**
160             *
161             * Killed by SK: 6. April 09: Ein Layer soll nicht generell auf
162             * verstecken/nicht verstecken gestellt werden können. Das sind
163             * Eigenschaften der Karte/MapContext, ebenso wie die Reihenfolge der Layer.
164             * Im Atlas verwaltet deshalb nun die Klasse skrueger.atlas.Map welche Layer
165             * nicht in der Legende auftauchen sollen. Meines Wissens hat keiner bisher
166             * die Funktion genutzt.
167             *
168             * // public boolean isHideInLegend() { // return false; // }
169             */
170    
171          public void setDesc(Translation dec) {          public void setDesc(Translation dec) {
172                  this.desc = dec;                  this.desc = dec;
173          }          }
174    
175          public void setImageIcon(ImageIcon icon) {          public void setImageIcon(ImageIcon icon) {
                 // TODO Auto-generated method stub  
   
176          }          }
177    
178          public void setKeywords(Translation keywords) {          public void setKeywords(Translation keywords) {
# Line 182  public class StyledFS implements StyledF Line 191  public class StyledFS implements StyledF
191          public void uncache() {          public void uncache() {
192          }          }
193    
194            /**
195             *
196             */
197          public Map<Integer, AttributeMetaData> getAttributeMetaDataMap() {          public Map<Integer, AttributeMetaData> getAttributeMetaDataMap() {
198                  if (map == null) {                  if (map == null) {
199    
200                          map = new HashMap<Integer, AttributeMetaData>();                          map = new HashMap<Integer, AttributeMetaData>();
201                            
202                          // Leaving out the first one, it will be the_geom                          // Leaving out the first one, it will be the_geom
203                          for (int i = 1; i < fs.getSchema().getAttributeCount(); i++) {                          for (int i = 1; i < fs.getSchema().getAttributeCount(); i++) {
204                                  AttributeType att = fs.getSchema().getAttributeType(i);                                  AttributeType att = fs.getSchema().getAttributeType(i);
205                                    
206                                  AttributeMetaData attMetaData = new AttributeMetaData(i, att.getLocalName());                                  AttributeMetaData attMetaData = new AttributeMetaData(i, att
207                                                    .getLocalName());
208                                  map.put(i, attMetaData);                                  map.put(i, attMetaData);
209                          }                          }
210                  }                  }
# Line 199  public class StyledFS implements StyledF Line 213  public class StyledFS implements StyledF
213    
214          /**          /**
215           * @return The {@link File} where the SLD was loaded from or           * @return The {@link File} where the SLD was loaded from or
216           *         <code>null</code> if there didn't exist a {@link File}. (It           *         <code>null</code> if there didn't exist a {@link File}. (It could
217           *         could be a WFS or a PostGIS           *         be a WFS or a PostGIS
218           *           *
219           * @author <a href="mailto:[email protected]">Stefan Alfons Kr&uuml;ger</a>           * @author <a href="mailto:[email protected]">Stefan Alfons
220             *         Kr&uuml;ger</a>
221           */           */
222          public File getSldFile() {          public File getSldFile() {
223                  return sldFile;                  return sldFile;

Legend:
Removed from v.2  
changed lines
  Added in v.176

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26