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
/* 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
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
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
import org.gvsig.fmap.mapcontext.rendering.symbols.SymbolManager;
46
import org.gvsig.fmap.mapcontext.rendering.symbols.SymbolPreferences;
47

    
48
/**
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
 * @author <a href="mailto:jjdelcerro@gvsig.org">Joaquin Jose del Cerro</a>
55
 */
56
public interface MapContextManager {
57

    
58
        /**
59
         * 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
         * @deprecated to be removed in gvSIG 2.0
164
         * @see {@link SymbolPreferences}.
165
         */
166
        int getDefaultCartographicSupportMeasureUnit();
167

    
168
        /**
169
         * @deprecated to be removed in gvSIG 2.0
170
         * @see {@link SymbolPreferences}.
171
         */
172
        void setDefaultCartographicSupportMeasureUnit(
173
                        int defaultCartographicSupportMeasureUnit);
174

    
175
        /**
176
         * @deprecated to be removed in gvSIG 2.0
177
         * @see {@link SymbolPreferences}.
178
         */
179
        int getDefaultCartographicSupportReferenceSystem();
180

    
181
        /**
182
         * @deprecated to be removed in gvSIG 2.0
183
         * @see {@link SymbolPreferences}.
184
         */
185
        void setDefaultCartographicSupportReferenceSystem(
186
                        int defaultCartographicSupportReferenceSystem);
187

    
188
        /**
189
         * @deprecated to be removed in gvSIG 2.0
190
         * @see {@link SymbolPreferences}.
191
         */
192
        Color getDefaultSymbolColor();
193

    
194
        /**
195
         * @deprecated to be removed in gvSIG 2.0
196
         * @see {@link SymbolPreferences}.
197
         */
198
        void setDefaultSymbolColor(Color defaultSymbolColor);
199

    
200
        /**
201
         * @deprecated to be removed in gvSIG 2.0
202
         * @see {@link SymbolPreferences}.
203
         */
204
        void resetDefaultSymbolColor();
205

    
206
        /**
207
         * @deprecated to be removed in gvSIG 2.0
208
         * @see {@link SymbolPreferences}.
209
         */
210
        Color getDefaultSymbolFillColor();
211

    
212
        /**
213
         * @deprecated to be removed in gvSIG 2.0
214
         * @see {@link SymbolPreferences}.
215
         */
216
        void setDefaultSymbolFillColor(Color defaultSymbolFillColor);
217

    
218
        /**
219
         * @deprecated to be removed in gvSIG 2.0
220
         * @see {@link SymbolPreferences}.
221
         */
222
        void resetDefaultSymbolFillColor();
223

    
224
        /**
225
         * @deprecated to be removed in gvSIG 2.0
226
         * @see {@link SymbolPreferences}.
227
         */
228
        boolean isDefaultSymbolFillColorAleatory();
229

    
230
        /**
231
         * @deprecated to be removed in gvSIG 2.0
232
         * @see {@link SymbolPreferences}.
233
         */
234
        void setDefaultSymbolFillColorAleatory(
235
                        boolean defaultSymbolFillColorAleatory);
236

    
237
        /**
238
         * @deprecated to be removed in gvSIG 2.0
239
         * @see {@link SymbolPreferences}.
240
         */
241
        void resetDefaultSymbolFillColorAleatory();
242

    
243
        /**
244
         * @deprecated to be removed in gvSIG 2.0
245
         * @see {@link SymbolPreferences}.
246
         */
247
        Font getDefaultSymbolFont();
248

    
249
        /**
250
         * @deprecated to be removed in gvSIG 2.0
251
         * @see {@link SymbolPreferences}.
252
         */
253
        void setDefaultSymbolFont(Font defaultSymbolFont);
254

    
255
        /**
256
         * @deprecated to be removed in gvSIG 2.0
257
         * @see {@link SymbolPreferences}.
258
         */
259
        void resetDefaultSymbolFont();
260

    
261
        /**
262
         * @deprecated to be removed in gvSIG 2.0
263
         * @see {@link SymbolPreferences}.
264
         */
265
        String getSymbolLibraryPath();
266

    
267
        /**
268
         * @deprecated to be removed in gvSIG 2.0
269
         * @see {@link SymbolPreferences}.
270
         */
271
        void setSymbolLibraryPath(String symbolLibraryPath);
272

    
273
        /**
274
         * @deprecated to be removed in gvSIG 2.0
275
         * @see {@link SymbolPreferences}.
276
         */
277
        void resetSymbolLibraryPath();
278
        
279
        
280
        /**
281
         * @deprecated to be removed in gvSIG 2.0 @see {@link SymbolManager}
282
         */
283
        ISymbol createSymbol(String symbolName) throws MapContextRuntimeException;
284

    
285
        /**
286
         * @deprecated to be removed in gvSIG 2.0 @see {@link SymbolManager}
287
         */
288
        ISymbol createSymbol(int shapeType) throws MapContextRuntimeException;
289

    
290
        /**
291
         * @deprecated to be removed in gvSIG 2.0 @see {@link SymbolManager}
292
         */
293
        ISymbol createSymbol(String symbolName, Color color)
294
                        throws MapContextRuntimeException;
295

    
296
        /**
297
         * @deprecated to be removed in gvSIG 2.0 @see {@link SymbolManager}
298
         */
299
        ISymbol createSymbol(int shapeType, Color color)
300
                        throws MapContextRuntimeException;
301

    
302
        /**
303
         * @deprecated to be removed in gvSIG 2.0 @see {@link SymbolManager}
304
         */
305
        IMultiLayerSymbol createMultiLayerSymbol(String symbolName)
306
                        throws MapContextRuntimeException;
307

    
308
        /**
309
         * @deprecated to be removed in gvSIG 2.0 @see {@link SymbolManager}
310
         */
311
        IMultiLayerSymbol createMultiLayerSymbol(int shapeType)
312
                        throws MapContextRuntimeException;
313

    
314
        /**
315
         * @deprecated to be removed in gvSIG 2.0 @see {@link SymbolManager}
316
         */
317
        void registerSymbol(String symbolName, Class symbolClass)
318
                        throws MapContextRuntimeException;
319

    
320
        /**
321
         * @deprecated to be removed in gvSIG 2.0 @see {@link SymbolManager}
322
         */
323
        void registerSymbol(String symbolName, int[] shapeTypes, Class symbolClass)
324
                        throws MapContextException;
325

    
326
        /**
327
         * @deprecated to be removed in gvSIG 2.0 @see {@link SymbolManager}
328
         */
329
        void registerMultiLayerSymbol(String symbolName, Class symbolClass)
330
                        throws MapContextRuntimeException;
331

    
332
        /**
333
         * @deprecated to be removed in gvSIG 2.0 @see {@link SymbolManager}
334
         */
335
        void registerMultiLayerSymbol(String symbolName, int[] shapeTypes,
336
                        Class symbolClass) throws MapContextRuntimeException;
337

    
338
        /**
339
         * @deprecated to be removed in gvSIG 2.0 @see {@link SymbolManager}
340
         */
341
        IWarningSymbol getWarningSymbol(String message, String symbolDesc,
342
                        int symbolDrawExceptionType) throws MapContextRuntimeException;
343
        
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
}