1 |
mojays |
2 |
package skrueger.geotools; |
2 |
|
|
import java.util.List; |
3 |
mojays |
127 |
|
4 |
mojays |
2 |
import org.geotools.map.MapContext; |
5 |
|
|
import org.geotools.map.MapLayer; |
6 |
|
|
import org.geotools.map.event.MapLayerListListener; |
7 |
|
|
import org.geotools.map.event.MapLayerListener; |
8 |
|
|
|
9 |
|
|
import skrueger.AttributeMetaData; |
10 |
|
|
import skrueger.RasterLegendData; |
11 |
|
|
|
12 |
|
|
/** |
13 |
|
|
* Implementations of this class can can be used to fill/insert/remove a mapContext |
14 |
alfonx |
224 |
* with {@link StyledLayerInterface} objects. |
15 |
mojays |
2 |
* |
16 |
|
|
* @author <a href="mailto:[email protected]">Stefan Alfons Krüger</a> |
17 |
|
|
* |
18 |
|
|
*/ |
19 |
|
|
public interface MapContextManagerInterface { |
20 |
|
|
|
21 |
|
|
/** |
22 |
alfonx |
224 |
* Add a {@link StyledLayerInterface} object into the underlying {@link MapContext} |
23 |
mojays |
2 |
* as the topmost layer |
24 |
|
|
* |
25 |
alfonx |
224 |
* @param styledLayer Layer to add to the map |
26 |
mojays |
2 |
*/ |
27 |
alfonx |
224 |
boolean addStyledLayer (StyledLayerInterface<?> styledLayer); |
28 |
mojays |
2 |
|
29 |
|
|
/** |
30 |
alfonx |
224 |
* @param mapContextIdx Index in the {@link MapContext}, bottom first |
31 |
|
|
* @return successful? |
32 |
mojays |
2 |
*/ |
33 |
|
|
boolean removeStyledLayer (int mapContextIdx); |
34 |
|
|
|
35 |
|
|
/** |
36 |
alfonx |
224 |
* Inserts a {@link StyledLayerInterface} object into the underlying {@link MapContext} |
37 |
mojays |
2 |
* at the given position |
38 |
|
|
*/ |
39 |
alfonx |
224 |
boolean insertStyledLayer (StyledLayerInterface<?> styledLayer, int mapContextIdx); |
40 |
mojays |
2 |
|
41 |
|
|
/** Add {@link MapLayerListener} */ |
42 |
|
|
void addMapLayerListListener( MapLayerListListener listener); |
43 |
|
|
|
44 |
|
|
/** Remove {@link MapLayerListener} */ |
45 |
|
|
void removeMapLayerListListener( MapLayerListListener listener); |
46 |
|
|
|
47 |
|
|
/** |
48 |
|
|
* Help the GC by disposing this Component |
49 |
|
|
*/ |
50 |
|
|
void dispose(); |
51 |
|
|
|
52 |
|
|
/** |
53 |
|
|
* Returns a ordered list of the layers that are contained in the underlying {@link MapContext} |
54 |
|
|
*/ |
55 |
alfonx |
224 |
List<StyledLayerInterface<?>> getStyledObjects(); |
56 |
mojays |
2 |
|
57 |
|
|
/** |
58 |
|
|
* Returns a list of {@link AttributeMetaData} that shall be shown (e.g. when the Mouse clicked into the map) |
59 |
|
|
* Returns an empty list if the layer doesn't exist or is not backed by a {@link StyledFeatureCollectionInterface} |
60 |
|
|
*/ |
61 |
alfonx |
224 |
List<AttributeMetaData> getVisibleAttribsFor(MapLayer mapLayer); |
62 |
mojays |
2 |
|
63 |
|
|
/** |
64 |
|
|
* Returns the title of the layer |
65 |
alfonx |
224 |
* @param mapLayer {@link MapLayer} |
66 |
|
|
* @return <code>null</code>, if the layer is unknown |
67 |
mojays |
2 |
*/ |
68 |
alfonx |
224 |
String getTitleFor(MapLayer mapLayer); |
69 |
mojays |
2 |
|
70 |
|
|
/** |
71 |
|
|
* Returns the description of the layer |
72 |
alfonx |
224 |
* @param mapLayer {@link MapLayer} |
73 |
|
|
* @return <code>null</code>, if the layer is unknown. Empty String if the description is empty |
74 |
mojays |
2 |
*/ |
75 |
alfonx |
224 |
String getDescFor(MapLayer mapLayer); |
76 |
mojays |
2 |
|
77 |
|
|
/** |
78 |
|
|
* Returns the {@link RasterLegendData} object for the layer. |
79 |
|
|
* @return null, if the layer is not found or of type raster |
80 |
|
|
*/ |
81 |
alfonx |
224 |
RasterLegendData getLegendMetaData(MapLayer mapLayer); |
82 |
mojays |
2 |
|
83 |
|
|
/** |
84 |
alfonx |
224 |
* Returns the {@link StyledLayerInterface} object that is associated with the layer or NULL if the layer can't be found. |
85 |
mojays |
2 |
*/ |
86 |
alfonx |
224 |
StyledLayerInterface<?> getStyledObjectFor(MapLayer layer); |
87 |
mojays |
2 |
} |