Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.exportto / org.gvsig.exportto.swing / org.gvsig.exportto.swing.api / src / main / java / org / gvsig / export / swing / ExportSwingLocator.java @ 43925

History | View | Annotate | Download (3.54 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.export.swing;
25

    
26
import org.gvsig.export.swing.spi.ExportPanelsManager;
27
import org.gvsig.tools.locator.BaseLocator;
28

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

    
39
    public static final String SWING_MANAGER_NAME = "Export.swing.manager";
40
    public static final String SWING_MANAGER_DESCRIPTION = "Export Swing Manager";
41

    
42
    public static final String PANELS_MANAGER_NAME = "Export.swing.panels.manager";
43
    public static final String PANELS_MANAGER_DESCRIPTION = "Export Panels Manager";
44

    
45
    private static final String LOCATOR_NAME = "Exportto.swing.locator";
46

    
47
    /**
48
     * Unique instance.
49
     */
50
    private static final ExportSwingLocator INSTANCE =
51
        new ExportSwingLocator();
52

    
53
    /**
54
     * Return the singleton instance.
55
     * 
56
     * @return the singleton instance
57
     */
58
    public static ExportSwingLocator getInstance() {
59
        return INSTANCE;
60
    }
61

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

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

    
84
    /**
85
     * Gets the instance of the {@link ExportSwingManager} registered.
86
     * 
87
     * @return {@link ExportSwingManager}
88
     */
89
    public static ExportSwingManager getSwingManager() {
90
        return (ExportSwingManager) getInstance().get(SWING_MANAGER_NAME);
91
    }
92

    
93
    /**
94
     * Registers the Class implementing the ExportPanelsManager interface.
95
     * 
96
     * @param clazz
97
     *            implementing the ExportPanelsManager interface
98
     */
99
    public static void registerExportPanelsManager(
100
        Class<? extends ExportPanelsManager> clazz) {
101
        getInstance().register(PANELS_MANAGER_NAME, PANELS_MANAGER_DESCRIPTION,
102
            clazz);
103
    }
104

    
105
    /**
106
     * Gets the instance of the {@link ScriptingUIManager} registered.
107
     * 
108
     * @return {@link ScriptingUIManager}
109
     */
110
    public static ExportPanelsManager getExportPanelsManager() {
111
        return (ExportPanelsManager) getInstance().get(PANELS_MANAGER_NAME);
112
    }
113
}