Statistics
| Revision:

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

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