Statistics
| Revision:

gvsig-educa / org.gvsig.educa.thematicmap / trunk / org.gvsig.educa.thematicmap / org.gvsig.educa.thematicmap.lib / org.gvsig.educa.thematicmap.lib.impl / src / main / java / org / gvsig / educa / thematicmap / impl / ThematicMapDefaultImplLibrary.java @ 195

History | View | Annotate | Download (2.86 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
package org.gvsig.educa.thematicmap.impl;
23

    
24
import java.util.Locale;
25

    
26
import org.gvsig.educa.thematicmap.ThematicMapLibrary;
27
import org.gvsig.educa.thematicmap.ThematicMapLocator;
28
import org.gvsig.educa.thematicmap.impl.compilation.DefaultThematicMapCompilationInformation;
29
import org.gvsig.educa.thematicmap.impl.map.DefaultThematicMapInformation;
30
import org.gvsig.educa.thematicmap.spi.ThematicMapProviderLocator;
31
import org.gvsig.i18n.Messages;
32
import org.gvsig.tools.library.AbstractLibrary;
33
import org.gvsig.tools.library.LibraryException;
34

    
35
/**
36
 * Library for default implementation initialization and configuration.
37
 * 
38
 * @author gvSIG team
39
 * @version $Id$
40
 */
41
public class ThematicMapDefaultImplLibrary extends AbstractLibrary {
42

    
43
    @Override
44
    public void doRegistration() {
45
        registerAsImplementationOf(ThematicMapLibrary.class);
46
    }
47

    
48
    /** {@inheridDoc} */
49
    @Override
50
    protected void doInitialize() throws LibraryException {
51
        ThematicMapLocator.registerManager(DefaultThematicMapManager.class);
52
        ThematicMapLocator
53
            .registerFileServices(DefaultThematicMapFileServices.class);
54
        ThematicMapProviderLocator
55
                                .registerManager(DefaultThematicMapProviderManager.class);
56
        
57
        
58
        
59
    }
60

    
61
    /** {@inheridDoc} */
62
    @Override
63
    protected void doPostInitialize() throws LibraryException {
64
        DefaultThematicMapInformation.registerPersistent();
65
        try {
66
            DefaultThematicMapCompilationInformation.registerPersistentAlias();
67
        } catch (Exception e) {
68
            throw new LibraryException(getClass(), e);
69
        }
70

    
71
        // Register i18n messages
72
        Messages.addLocale(Locale.getDefault());
73
        Messages.addLocale(new Locale(Locale.getDefault().getLanguage()));
74
        Messages.addResourceFamily(
75
            "org.gvsig.educa.thematicmap.impl.i18n.text",
76
            ThematicMapDefaultImplLibrary.class.getClassLoader(),
77
            ThematicMapDefaultImplLibrary.class.getClass().getName());
78
    }
79

    
80
}