svn-gvsig-desktop / tags / v2_0_0_Build_2020 / libraries / libFMap_mapcontext / src / org / gvsig / fmap / mapcontext / MapContextManager.java @ 33955
History | View | Annotate | Download (10.2 KB)
1 |
/* gvSIG. Geographic Information System of the Valencian Government
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department
|
4 |
* of the Valencian Government (CIT)
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 2
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
*/
|
22 |
|
23 |
/*
|
24 |
* AUTHORS (In addition to CIT):
|
25 |
* 2009 {DiSiD Technologies} {Create Manager to register MapContextDrawer implementation}
|
26 |
*/
|
27 |
package org.gvsig.fmap.mapcontext; |
28 |
|
29 |
import java.awt.Color; |
30 |
import java.awt.Font; |
31 |
|
32 |
import org.cresques.cts.IProjection; |
33 |
|
34 |
import org.gvsig.fmap.dal.DataStore; |
35 |
import org.gvsig.fmap.dal.DataStoreParameters; |
36 |
import org.gvsig.fmap.mapcontext.exceptions.LoadLayerException; |
37 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
38 |
import org.gvsig.fmap.mapcontext.layers.vectorial.GraphicLayer; |
39 |
import org.gvsig.fmap.mapcontext.rendering.legend.ILegend; |
40 |
import org.gvsig.fmap.mapcontext.rendering.legend.IVectorLegend; |
41 |
import org.gvsig.fmap.mapcontext.rendering.legend.driver.ILegendReader; |
42 |
import org.gvsig.fmap.mapcontext.rendering.legend.driver.ILegendWriter; |
43 |
import org.gvsig.fmap.mapcontext.rendering.symbols.IMultiLayerSymbol; |
44 |
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol; |
45 |
import org.gvsig.fmap.mapcontext.rendering.symbols.IWarningSymbol; |
46 |
import org.gvsig.fmap.mapcontext.rendering.symbols.SymbolManager; |
47 |
import org.gvsig.fmap.mapcontext.rendering.symbols.SymbolPreferences; |
48 |
|
49 |
/**
|
50 |
* Manager of the MapContext library.
|
51 |
*
|
52 |
* Holds the default implementation of the {@link MapContextDrawer}.
|
53 |
*
|
54 |
* @author <a href="mailto:cordinyana@gvsig.org">C?sar Ordi?ana</a>
|
55 |
* @author <a href="mailto:jjdelcerro@gvsig.org">Joaquin Jose del Cerro</a>
|
56 |
*/
|
57 |
public interface MapContextManager { |
58 |
|
59 |
/**
|
60 |
* Create a new layer from the data parameters passed as parameter.
|
61 |
*
|
62 |
* @param layerName name used in for the new layer.
|
63 |
* @param parameters used for create the {@link DataStore} of the new layer
|
64 |
*
|
65 |
* @return the new FLayer
|
66 |
*
|
67 |
* @throws LoadLayerException
|
68 |
*/
|
69 |
public FLayer createLayer(String layerName, |
70 |
DataStoreParameters parameters) throws LoadLayerException;
|
71 |
|
72 |
/**
|
73 |
* Create a layer from a {@link DataStore}.
|
74 |
*
|
75 |
* @param layerName name used in for the new layer.
|
76 |
* @param store used for the new layer
|
77 |
*
|
78 |
* @return the new FLayer
|
79 |
*
|
80 |
* @throws LoadLayerException
|
81 |
*/
|
82 |
public FLayer createLayer(String layerName, DataStore store) |
83 |
throws LoadLayerException;
|
84 |
|
85 |
/**
|
86 |
* Create a layer to be used as the {@link GraphicLayer}.
|
87 |
*
|
88 |
* @param projection used in the layer.
|
89 |
*
|
90 |
* @return the new {@link GraphicLayer}.
|
91 |
*/
|
92 |
public GraphicLayer createGraphicsLayer(IProjection projection);
|
93 |
|
94 |
/**
|
95 |
* Returns the current {@link SymbolManager}.
|
96 |
*
|
97 |
* @return the {@link SymbolManager}
|
98 |
*/
|
99 |
SymbolManager getSymbolManager(); |
100 |
|
101 |
/**
|
102 |
* Sets the class to use as the default implementation for the
|
103 |
* {@link MapContextDrawer}.
|
104 |
*
|
105 |
* @param drawerClazz
|
106 |
* the {@link MapContextDrawer} class to use
|
107 |
* @throws MapContextException
|
108 |
* if there is any error setting the class
|
109 |
*/
|
110 |
public void setDefaultMapContextDrawer(Class drawerClazz) |
111 |
throws MapContextException;
|
112 |
|
113 |
public void validateMapContextDrawer(Class drawerClazz) throws MapContextException; |
114 |
|
115 |
/**
|
116 |
* Creates a new instance of the default {@link MapContextDrawer}
|
117 |
* implementation.
|
118 |
*
|
119 |
* @return the new {@link MapContextDrawer} instance
|
120 |
* @throws MapContextException
|
121 |
* if there is an error creating the new object instance
|
122 |
*/
|
123 |
public MapContextDrawer createDefaultMapContextDrawerInstance()
|
124 |
throws MapContextException;
|
125 |
|
126 |
/**
|
127 |
* Creates a new instance of the provided {@link MapContextDrawer}
|
128 |
* implementation.
|
129 |
*
|
130 |
* @param drawerClazz
|
131 |
* the {@link MapContextDrawer} implementation class
|
132 |
* @return the new {@link MapContextDrawer} instance
|
133 |
* @throws MapContextException
|
134 |
* if there is an error creating the new object instance
|
135 |
*/
|
136 |
public MapContextDrawer createMapContextDrawerInstance(Class drawerClazz) |
137 |
throws MapContextException;
|
138 |
|
139 |
|
140 |
|
141 |
void registerLegend(String legendName, Class legendClass) |
142 |
throws MapContextRuntimeException;
|
143 |
|
144 |
ILegend createLegend(String legendName) throws MapContextRuntimeException; |
145 |
|
146 |
void setDefaultVectorLegend(String legendName); |
147 |
|
148 |
IVectorLegend createDefaultVectorLegend(int shapeType)
|
149 |
throws MapContextRuntimeException;
|
150 |
|
151 |
void registerLegendWriter(String legendName, String format, |
152 |
Class writerClass) throws MapContextRuntimeException; |
153 |
|
154 |
void registerLegendReader(String format, Class readerClass) |
155 |
throws MapContextRuntimeException;
|
156 |
|
157 |
ILegendWriter createLegendWriter(String legendName, String format) |
158 |
throws MapContextException;
|
159 |
|
160 |
ILegendReader createLegendReader(String format)
|
161 |
throws MapContextRuntimeException;
|
162 |
|
163 |
/**
|
164 |
* @deprecated to be removed in gvSIG 2.0
|
165 |
* @see {@link SymbolPreferences}.
|
166 |
*/
|
167 |
int getDefaultCartographicSupportMeasureUnit();
|
168 |
|
169 |
/**
|
170 |
* @deprecated to be removed in gvSIG 2.0
|
171 |
* @see {@link SymbolPreferences}.
|
172 |
*/
|
173 |
void setDefaultCartographicSupportMeasureUnit(
|
174 |
int defaultCartographicSupportMeasureUnit);
|
175 |
|
176 |
/**
|
177 |
* @deprecated to be removed in gvSIG 2.0
|
178 |
* @see {@link SymbolPreferences}.
|
179 |
*/
|
180 |
int getDefaultCartographicSupportReferenceSystem();
|
181 |
|
182 |
/**
|
183 |
* @deprecated to be removed in gvSIG 2.0
|
184 |
* @see {@link SymbolPreferences}.
|
185 |
*/
|
186 |
void setDefaultCartographicSupportReferenceSystem(
|
187 |
int defaultCartographicSupportReferenceSystem);
|
188 |
|
189 |
/**
|
190 |
* @deprecated to be removed in gvSIG 2.0
|
191 |
* @see {@link SymbolPreferences}.
|
192 |
*/
|
193 |
Color getDefaultSymbolColor();
|
194 |
|
195 |
/**
|
196 |
* @deprecated to be removed in gvSIG 2.0
|
197 |
* @see {@link SymbolPreferences}.
|
198 |
*/
|
199 |
void setDefaultSymbolColor(Color defaultSymbolColor); |
200 |
|
201 |
/**
|
202 |
* @deprecated to be removed in gvSIG 2.0
|
203 |
* @see {@link SymbolPreferences}.
|
204 |
*/
|
205 |
void resetDefaultSymbolColor();
|
206 |
|
207 |
/**
|
208 |
* @deprecated to be removed in gvSIG 2.0
|
209 |
* @see {@link SymbolPreferences}.
|
210 |
*/
|
211 |
Color getDefaultSymbolFillColor();
|
212 |
|
213 |
/**
|
214 |
* @deprecated to be removed in gvSIG 2.0
|
215 |
* @see {@link SymbolPreferences}.
|
216 |
*/
|
217 |
void setDefaultSymbolFillColor(Color defaultSymbolFillColor); |
218 |
|
219 |
/**
|
220 |
* @deprecated to be removed in gvSIG 2.0
|
221 |
* @see {@link SymbolPreferences}.
|
222 |
*/
|
223 |
void resetDefaultSymbolFillColor();
|
224 |
|
225 |
/**
|
226 |
* @deprecated to be removed in gvSIG 2.0
|
227 |
* @see {@link SymbolPreferences}.
|
228 |
*/
|
229 |
boolean isDefaultSymbolFillColorAleatory();
|
230 |
|
231 |
/**
|
232 |
* @deprecated to be removed in gvSIG 2.0
|
233 |
* @see {@link SymbolPreferences}.
|
234 |
*/
|
235 |
void setDefaultSymbolFillColorAleatory(
|
236 |
boolean defaultSymbolFillColorAleatory);
|
237 |
|
238 |
/**
|
239 |
* @deprecated to be removed in gvSIG 2.0
|
240 |
* @see {@link SymbolPreferences}.
|
241 |
*/
|
242 |
void resetDefaultSymbolFillColorAleatory();
|
243 |
|
244 |
/**
|
245 |
* @deprecated to be removed in gvSIG 2.0
|
246 |
* @see {@link SymbolPreferences}.
|
247 |
*/
|
248 |
Font getDefaultSymbolFont();
|
249 |
|
250 |
/**
|
251 |
* @deprecated to be removed in gvSIG 2.0
|
252 |
* @see {@link SymbolPreferences}.
|
253 |
*/
|
254 |
void setDefaultSymbolFont(Font defaultSymbolFont); |
255 |
|
256 |
/**
|
257 |
* @deprecated to be removed in gvSIG 2.0
|
258 |
* @see {@link SymbolPreferences}.
|
259 |
*/
|
260 |
void resetDefaultSymbolFont();
|
261 |
|
262 |
/**
|
263 |
* @deprecated to be removed in gvSIG 2.0
|
264 |
* @see {@link SymbolPreferences}.
|
265 |
*/
|
266 |
String getSymbolLibraryPath();
|
267 |
|
268 |
/**
|
269 |
* @deprecated to be removed in gvSIG 2.0
|
270 |
* @see {@link SymbolPreferences}.
|
271 |
*/
|
272 |
void setSymbolLibraryPath(String symbolLibraryPath); |
273 |
|
274 |
/**
|
275 |
* @deprecated to be removed in gvSIG 2.0
|
276 |
* @see {@link SymbolPreferences}.
|
277 |
*/
|
278 |
void resetSymbolLibraryPath();
|
279 |
|
280 |
|
281 |
/**
|
282 |
* @deprecated to be removed in gvSIG 2.0 @see {@link SymbolManager}
|
283 |
*/
|
284 |
ISymbol createSymbol(String symbolName) throws MapContextRuntimeException; |
285 |
|
286 |
/**
|
287 |
* @deprecated to be removed in gvSIG 2.0 @see {@link SymbolManager}
|
288 |
*/
|
289 |
ISymbol createSymbol(int shapeType) throws MapContextRuntimeException; |
290 |
|
291 |
/**
|
292 |
* @deprecated to be removed in gvSIG 2.0 @see {@link SymbolManager}
|
293 |
*/
|
294 |
ISymbol createSymbol(String symbolName, Color color) |
295 |
throws MapContextRuntimeException;
|
296 |
|
297 |
/**
|
298 |
* @deprecated to be removed in gvSIG 2.0 @see {@link SymbolManager}
|
299 |
*/
|
300 |
ISymbol createSymbol(int shapeType, Color color) |
301 |
throws MapContextRuntimeException;
|
302 |
|
303 |
/**
|
304 |
* @deprecated to be removed in gvSIG 2.0 @see {@link SymbolManager}
|
305 |
*/
|
306 |
IMultiLayerSymbol createMultiLayerSymbol(String symbolName)
|
307 |
throws MapContextRuntimeException;
|
308 |
|
309 |
/**
|
310 |
* @deprecated to be removed in gvSIG 2.0 @see {@link SymbolManager}
|
311 |
*/
|
312 |
IMultiLayerSymbol createMultiLayerSymbol(int shapeType)
|
313 |
throws MapContextRuntimeException;
|
314 |
|
315 |
/**
|
316 |
* @deprecated to be removed in gvSIG 2.0 @see {@link SymbolManager}
|
317 |
*/
|
318 |
void registerSymbol(String symbolName, Class symbolClass) |
319 |
throws MapContextRuntimeException;
|
320 |
|
321 |
/**
|
322 |
* @deprecated to be removed in gvSIG 2.0 @see {@link SymbolManager}
|
323 |
*/
|
324 |
void registerSymbol(String symbolName, int[] shapeTypes, Class symbolClass) |
325 |
throws MapContextException;
|
326 |
|
327 |
/**
|
328 |
* @deprecated to be removed in gvSIG 2.0 @see {@link SymbolManager}
|
329 |
*/
|
330 |
void registerMultiLayerSymbol(String symbolName, Class symbolClass) |
331 |
throws MapContextRuntimeException;
|
332 |
|
333 |
/**
|
334 |
* @deprecated to be removed in gvSIG 2.0 @see {@link SymbolManager}
|
335 |
*/
|
336 |
void registerMultiLayerSymbol(String symbolName, int[] shapeTypes, |
337 |
Class symbolClass) throws MapContextRuntimeException; |
338 |
|
339 |
/**
|
340 |
* @deprecated to be removed in gvSIG 2.0 @see {@link SymbolManager}
|
341 |
*/
|
342 |
IWarningSymbol getWarningSymbol(String message, String symbolDesc, |
343 |
int symbolDrawExceptionType) throws MapContextRuntimeException; |
344 |
|
345 |
/**
|
346 |
* It returns the legend associated with a {@link DataStore}.
|
347 |
* If the legend doesn't exist it returns <code>null</code>.
|
348 |
* @param dataStore
|
349 |
* the store that could have a legend.
|
350 |
* @return
|
351 |
* the legend or <code>null</code>.
|
352 |
*/
|
353 |
ILegend getLegend(DataStore dataStore); |
354 |
|
355 |
|
356 |
// TODO:
|
357 |
// DynObjectModel getFeatureTypeUIModel(DataStore store,
|
358 |
// FeatureType featureType);
|
359 |
} |