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); |
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 |
|
|
121 |
} |
} |
122 |
} |
} |
123 |
|
|
124 |
public FeatureSource getGeoObject() throws Exception { |
public FeatureSource getGeoObject() { |
125 |
return fs; |
return fs; |
126 |
} |
} |
127 |
|
|
165 |
* nicht in der Legende auftauchen sollen. Meines Wissens hat keiner bisher |
* nicht in der Legende auftauchen sollen. Meines Wissens hat keiner bisher |
166 |
* die Funktion genutzt. |
* die Funktion genutzt. |
167 |
* |
* |
168 |
// public boolean isHideInLegend() { |
* // public boolean isHideInLegend() { // return false; // } |
|
// return false; |
|
|
// } |
|
169 |
*/ |
*/ |
170 |
|
|
171 |
public void setDesc(Translation dec) { |
public void setDesc(Translation 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) { |
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 |
} |
} |
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üger</a> |
* @author <a href="mailto:[email protected]">Stefan Alfons |
220 |
|
* Krüger</a> |
221 |
*/ |
*/ |
222 |
public File getSldFile() { |
public File getSldFile() { |
223 |
return sldFile; |
return sldFile; |