Statistics
| Revision:

root / org.gvsig.proj / branches / refactor2018 / org.gvsig.proj / org.gvsig.proj.swing / org.gvsig.proj.swing.api / src / main / java / org / gvsig / proj / swing / CoordinateReferenceSystemSwingLibrary.java @ 852

History | View | Annotate | Download (2.24 KB)

1 7 cordinyana
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2012 gvSIG Association.
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
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.proj.swing;
25
26 24 cordinyana
import org.gvsig.proj.CoordinateReferenceSystemLibrary;
27 7 cordinyana
import org.gvsig.tools.library.AbstractLibrary;
28
import org.gvsig.tools.library.LibraryException;
29
import org.gvsig.tools.locator.ReferenceNotRegisteredException;
30 852 cmartinez
import org.gvsig.tools.swing.api.ToolsSwingLibrary;
31 7 cordinyana
32
/**
33 26 cordinyana
 * Initialization and configuration of the org.gvsig.proj.swing.api library.
34 7 cordinyana
 *
35
 * @author gvSIG team
36
 * @version $Id$
37
 */
38 24 cordinyana
public class CoordinateReferenceSystemSwingLibrary extends AbstractLibrary {
39 7 cordinyana
40
    public void doRegistration() {
41 24 cordinyana
        this.registerAsAPI(CoordinateReferenceSystemSwingLibrary.class);
42
        this.require(CoordinateReferenceSystemLibrary.class);
43 852 cmartinez
        this.require(ToolsSwingLibrary.class);
44 7 cordinyana
    }
45
46
    @Override
47
    protected void doInitialize() throws LibraryException {
48
        // Do nothing
49
    }
50
51
    @Override
52
    protected void doPostInitialize() throws LibraryException {
53
        // Validate there is any implementation registered.
54 123 jjdelcerro
55
        if( !CoordinateReferenceSystemSwingLocator.getInstance().exists(CoordinateReferenceSystemSwingLocator.SWING_MANAGER_NAME) ) {
56 7 cordinyana
            throw new ReferenceNotRegisteredException(
57 24 cordinyana
                CoordinateReferenceSystemSwingLocator.SWING_MANAGER_NAME,
58
                CoordinateReferenceSystemSwingLocator.getInstance());
59 7 cordinyana
        }
60
    }
61
62
}