Statistics
| Revision:

root / branches / v2_0_0_prep / libraries / libFMap_mapcontext / src / org / gvsig / fmap / mapcontext / MapContextManager.java @ 33339

History | View | Annotate | Download (10.1 KB)

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