63 |
StyledFeatureCollectionInterface { |
StyledFeatureCollectionInterface { |
64 |
|
|
65 |
/** Holds the meta data for displaying a legend. */ |
/** Holds the meta data for displaying a legend. */ |
66 |
protected Map<Integer, AttributeMetaData> attrMetaData = null; |
protected AttributeMetadataMap attrMetaData = null; |
67 |
|
|
68 |
/** |
/** |
69 |
* We be filled with a "virtual" {@link FeatureSource} on demand. |
* We be filled with a "virtual" {@link FeatureSource} on demand. |
95 |
*/ |
*/ |
96 |
public StyledFeatureCollection(FeatureCollection<SimpleFeatureType,SimpleFeature> fc, String id, |
public StyledFeatureCollection(FeatureCollection<SimpleFeatureType,SimpleFeature> fc, String id, |
97 |
Translation title, Translation desc, Translation keywords, |
Translation title, Translation desc, Translation keywords, |
98 |
Style style, Map<Integer, AttributeMetaData> attrMetaData, |
Style style, AttributeMetadataMap attrMetaData, |
99 |
ImageIcon icon) { |
ImageIcon icon) { |
100 |
super(fc, fc.getBounds(), fc.getSchema().getGeometryDescriptor() |
super(fc, fc.getBounds(), fc.getSchema().getGeometryDescriptor() |
101 |
.getCoordinateReferenceSystem(), id, title, desc, keywords, style, icon); |
.getCoordinateReferenceSystem(), id, title, desc, keywords, style, icon); |
125 |
*/ |
*/ |
126 |
public StyledFeatureCollection(FeatureCollection<SimpleFeatureType,SimpleFeature> fc, String id, |
public StyledFeatureCollection(FeatureCollection<SimpleFeatureType,SimpleFeature> fc, String id, |
127 |
Translation title, Translation desc, Translation keywords, |
Translation title, Translation desc, Translation keywords, |
128 |
StyledLayerStyle<Map<Integer, AttributeMetaData>> style, |
StyledLayerStyle<AttributeMetadataMap> style, |
129 |
ImageIcon icon) { |
ImageIcon icon) { |
130 |
super(fc, fc.getBounds(), fc.getSchema().getGeometryDescriptor() |
super(fc, fc.getBounds(), fc.getSchema().getGeometryDescriptor() |
131 |
.getCoordinateReferenceSystem(), id, title, desc, keywords, |
.getCoordinateReferenceSystem(), id, title, desc, keywords, |
180 |
*/ |
*/ |
181 |
public StyledFeatureCollection(FeatureCollection<SimpleFeatureType,SimpleFeature> fc, String id, |
public StyledFeatureCollection(FeatureCollection<SimpleFeatureType,SimpleFeature> fc, String id, |
182 |
String title, String desc, String keywords, Style style, |
String title, String desc, String keywords, Style style, |
183 |
Map<Integer, AttributeMetaData> attrMetaData, ImageIcon icon) { |
AttributeMetadataMap attrMetaData, ImageIcon icon) { |
184 |
this(fc, id, (Translation) null, null, null, style, attrMetaData, icon); |
this(fc, id, (Translation) null, null, null, style, attrMetaData, icon); |
185 |
setTitle(title); |
setTitle(title); |
186 |
setDesc(desc); |
setDesc(desc); |
210 |
*/ |
*/ |
211 |
public StyledFeatureCollection(FeatureCollection<SimpleFeatureType,SimpleFeature> fc, String id, |
public StyledFeatureCollection(FeatureCollection<SimpleFeatureType,SimpleFeature> fc, String id, |
212 |
String title, String desc, String keywords, |
String title, String desc, String keywords, |
213 |
StyledLayerStyle<Map<Integer, AttributeMetaData>> style, |
StyledLayerStyle<AttributeMetadataMap> style, |
214 |
ImageIcon icon) { |
ImageIcon icon) { |
215 |
this(fc, id, title, desc, keywords, style != null ? style |
this(fc, id, title, desc, keywords, style != null ? style |
216 |
.getGeoObjectStyle() : null, style != null ? style |
.getGeoObjectStyle() : null, style != null ? style |
257 |
* @see #createDefaultAttributeMetaDataMap(FeatureCollection) |
* @see #createDefaultAttributeMetaDataMap(FeatureCollection) |
258 |
*/ |
*/ |
259 |
public StyledFeatureCollection(FeatureCollection<SimpleFeatureType,SimpleFeature> fc, String id, |
public StyledFeatureCollection(FeatureCollection<SimpleFeatureType,SimpleFeature> fc, String id, |
260 |
String title, StyledLayerStyle<Map<Integer, AttributeMetaData>> style) { |
String title, StyledLayerStyle<AttributeMetadataMap> style) { |
261 |
this(fc, id, title, null, null, style != null ? style |
this(fc, id, title, null, null, style != null ? style |
262 |
.getGeoObjectStyle() : null, style != null ? style |
.getGeoObjectStyle() : null, style != null ? style |
263 |
.getMetaData() : null, null); |
.getMetaData() : null, null); |
275 |
/** |
/** |
276 |
* Returns the meta data needed for displaying a legend. |
* Returns the meta data needed for displaying a legend. |
277 |
*/ |
*/ |
278 |
public Map<Integer, AttributeMetaData> getAttributeMetaDataMap() { |
public AttributeMetadataMap getAttributeMetaDataMap() { |
279 |
return attrMetaData; |
return attrMetaData; |
280 |
} |
} |
281 |
|
|
288 |
* map of attribute meta data |
* map of attribute meta data |
289 |
*/ |
*/ |
290 |
public void setAttributeMetaData( |
public void setAttributeMetaData( |
291 |
Map<Integer, AttributeMetaData> attrMetaData) { |
AttributeMetadataMap attrMetaData) { |
292 |
this.attrMetaData = (attrMetaData != null) ? attrMetaData |
this.attrMetaData = (attrMetaData != null) ? attrMetaData |
293 |
: createDefaultAttributeMetaDataMap(geoObject); |
: createDefaultAttributeMetaDataMap(geoObject); |
294 |
} |
} |
300 |
* @param fc |
* @param fc |
301 |
* a {@link FeatureCollection} |
* a {@link FeatureCollection} |
302 |
*/ |
*/ |
303 |
public static Map<Integer, AttributeMetaData> createDefaultAttributeMetaDataMap( |
public static AttributeMetadataMap createDefaultAttributeMetaDataMap( |
304 |
FeatureCollection<SimpleFeatureType,SimpleFeature> fc) { |
FeatureCollection<SimpleFeatureType,SimpleFeature> fc) { |
305 |
HashMap<Integer, AttributeMetaData> metaDataMap = new HashMap<Integer, AttributeMetaData>(); |
AttributeMetadataMap metaDataMap = new AttributeMetadataMap(); |
306 |
SimpleFeatureType ftype = fc.getSchema(); |
SimpleFeatureType ftype = fc.getSchema(); |
307 |
for (int i = 0; i < ftype.getAttributeCount(); i++) { |
for (int i = 0; i < ftype.getAttributeCount(); i++) { |
308 |
AttributeDescriptor aType = ftype.getAttributeDescriptors().get(i); |
AttributeDescriptor aType = ftype.getAttributeDescriptors().get(i); |