1 |
mojays |
2 |
package skrueger.geotools; |
2 |
|
|
|
3 |
|
|
import org.geotools.styling.Style; |
4 |
|
|
|
5 |
|
|
/** |
6 |
|
|
* This class combines a Geotools visualisation {@link Style} with additional |
7 |
|
|
* meta data needed for visualisation (for example legend data). |
8 |
|
|
* The class {@code E} defines the type of the meta data. |
9 |
|
|
* @author <a href="mailto:[email protected]">Martin Schmitz</a> (University of Bonn/Germany) |
10 |
|
|
* @version 1.0 |
11 |
|
|
*/ |
12 |
alfonx |
224 |
public class StyledLayerStyle<E> { |
13 |
mojays |
2 |
/** Holds the Geotools {@link Style} for the geo object visualisation. */ |
14 |
|
|
protected Style geoObjectStyle = null; |
15 |
|
|
/** Holds the additional meta data for object visualisation (for example |
16 |
|
|
* legend information). */ |
17 |
|
|
protected E metaData = null; |
18 |
|
|
|
19 |
|
|
/** |
20 |
alfonx |
224 |
* Creates a new style for a {@link StyledLayerInterface}. |
21 |
mojays |
2 |
* @param style Style |
22 |
|
|
* @param metaData E |
23 |
|
|
*/ |
24 |
alfonx |
224 |
public StyledLayerStyle(Style style, E metaData) { |
25 |
mojays |
2 |
setGeoObjectStyle(style); |
26 |
|
|
setMetaData(metaData); |
27 |
|
|
} |
28 |
|
|
|
29 |
|
|
/** |
30 |
|
|
* Returns the additional meta data needed for object visualisation. |
31 |
|
|
*/ |
32 |
|
|
public E getMetaData() { |
33 |
|
|
return metaData; |
34 |
|
|
} |
35 |
|
|
|
36 |
|
|
/** |
37 |
|
|
* Sets the additional meta data needed for object visualisation. |
38 |
|
|
* @param metaData the meta data |
39 |
|
|
*/ |
40 |
|
|
public void setMetaData(E metaData) { |
41 |
|
|
this.metaData = metaData; |
42 |
|
|
} |
43 |
|
|
|
44 |
|
|
/** |
45 |
|
|
* Returns the Geotools style for the object visualisation. |
46 |
|
|
*/ |
47 |
|
|
public Style getGeoObjectStyle() { |
48 |
|
|
return geoObjectStyle; |
49 |
|
|
} |
50 |
|
|
|
51 |
|
|
/** |
52 |
|
|
* Sets the Geotools style for the object visualisation. |
53 |
|
|
* @param style a Geotools visualisation style |
54 |
|
|
*/ |
55 |
|
|
public void setGeoObjectStyle(Style style) { |
56 |
|
|
this.geoObjectStyle = style; |
57 |
|
|
} |
58 |
|
|
} |