Statistics
| Revision:

gvsig-osm / org.gvsig.raster.osm / trunk / org.gvsig.raster.osm / org.gvsig.raster.osm.swing / org.gvsig.raster.osm.swing.api / src / main / java / org / gvsig / raster / osm / swing / OSMSwingLocator.java @ 85

History | View | Annotate | Download (2.7 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.raster.osm.swing;
23

    
24
import org.gvsig.tools.locator.BaseLocator;
25

    
26
/**
27
 * This locator is the entry point for the Validation swing library,
28
 * providing access to all Validation swing services through the
29
 * {@link OSMSwingManager} .
30
 * 
31
 * @author gvSIG team
32
 * @version $Id$
33
 */
34
public class OSMSwingLocator extends BaseLocator {
35

    
36
    /**
37
     * Validation swing manager name.
38
     */
39
    public static final String SWING_MANAGER_NAME =
40
        "OSM.swing.manager";
41

    
42
    /**
43
     * Validation swing manager description.
44
     */
45
    public static final String SWING_MANAGER_DESCRIPTION =
46
        "OSM UIManager";
47

    
48
    private static final String LOCATOR_NAME = "OSM.swing.locator";
49

    
50
    /**
51
     * Unique instance.
52
     */
53
    private static final OSMSwingLocator INSTANCE =
54
        new OSMSwingLocator();
55

    
56
    /**
57
     * Return the singleton instance.
58
     * 
59
     * @return the singleton instance
60
     */
61
    public static OSMSwingLocator getInstance() {
62
        return INSTANCE;
63
    }
64

    
65
    /**
66
     * Return the Locator's name
67
     * 
68
     * @return a String with the Locator's name
69
     */
70
    public final String getLocatorName() {
71
        return LOCATOR_NAME;
72
    }
73

    
74
    /**
75
     * Registers the Class implementing the PersistenceManager interface.
76
     * 
77
     * @param clazz
78
     *            implementing the PersistenceManager interface
79
     */
80
    public static void registerSwingManager(
81
        Class<? extends OSMSwingManager> clazz) {
82
        getInstance().register(SWING_MANAGER_NAME, SWING_MANAGER_DESCRIPTION,
83
            clazz);
84
    }
85

    
86
    /**
87
     * Gets the instance of the {@link ScriptingUIManager} registered.
88
     * 
89
     * @return {@link ScriptingUIManager}
90
     */
91
    public static OSMSwingManager getSwingManager() {
92
        return (OSMSwingManager) getInstance()
93
            .get(SWING_MANAGER_NAME);
94
    }
95

    
96
}