Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.symbology / org.gvsig.symbology.swing / org.gvsig.symbology.swing.api / src / main / java / org / gvsig / symbology / swing / SymbologySwingLocator.java @ 40560

History | View | Annotate | Download (2.81 KB)

1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 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 3
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.symbology.swing;
25

    
26
import org.gvsig.tools.locator.BaseLocator;
27

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

    
38
    /**
39
     * Symbology swing manager name.
40
     */
41
    public static final String SWING_MANAGER_NAME =
42
        "Symbology.swing.manager";
43

    
44
    /**
45
     * Symbology swing manager description.
46
     */
47
    public static final String SWING_MANAGER_DESCRIPTION =
48
        "Symbology UIManager";
49

    
50
    private static final String LOCATOR_NAME = "Symbology.swing.locator";
51

    
52
    /**
53
     * Unique instance.
54
     */
55
    private static final SymbologySwingLocator INSTANCE =
56
        new SymbologySwingLocator();
57

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

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

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

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

    
98
}