gvsig-3d / 2.1 / trunk / org.gvsig.view3d / org.gvsig.view3d.swing / org.gvsig.view3d.swing.api / src / main / java / org / gvsig / view3d / swing / api / View3DSwingLocator.java @ 474
History | View | Annotate | Download (2.8 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright ? 2007-2015 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 |
|
25 |
package org.gvsig.view3d.swing.api; |
26 |
|
27 |
import org.gvsig.tools.locator.BaseLocator; |
28 |
import org.gvsig.tools.locator.LocatorException; |
29 |
|
30 |
/**
|
31 |
* This locator is the entry point for the View 3D swing library, providing
|
32 |
* access to View3D swing services through the {@link View3DSwingManager} .
|
33 |
*
|
34 |
* @author <a href="mailto:lmarques@disid.com">Lluis Marques</a>
|
35 |
*/
|
36 |
public class View3DSwingLocator extends BaseLocator { |
37 |
|
38 |
private static final String LOCATOR_NAME = "View3DSwingLocator"; |
39 |
|
40 |
public static final String MANAGER_NAME = "View3D.SwingManager"; |
41 |
|
42 |
private static final String MANAGER_DESCRIPTION = "View 3D Swing Manager"; |
43 |
|
44 |
private static final View3DSwingLocator instance = new View3DSwingLocator(); |
45 |
|
46 |
/**
|
47 |
* Return the singleton instance.
|
48 |
*
|
49 |
* @return the singleton instance
|
50 |
*/
|
51 |
public static View3DSwingLocator getInstance() { |
52 |
return instance;
|
53 |
} |
54 |
|
55 |
public String getLocatorName() { |
56 |
return LOCATOR_NAME;
|
57 |
} |
58 |
|
59 |
/**
|
60 |
* Return a reference to View3DSwingManager.
|
61 |
*
|
62 |
* @return a reference to View3DSwingManager
|
63 |
* @throws LocatorException
|
64 |
* if there is no access to the class or the class
|
65 |
* cannot be instantiated
|
66 |
* @see Locator#get(String)View3DSwingManager
|
67 |
*/
|
68 |
public static View3DSwingManager getManager() throws LocatorException { |
69 |
return (View3DSwingManager) getInstance().get(MANAGER_NAME);
|
70 |
} |
71 |
|
72 |
/**
|
73 |
* Registers the Class implementing the View3DSwingLocator interface.
|
74 |
*
|
75 |
* @param clazz
|
76 |
* implementing the View3DSwingManager interface
|
77 |
*/
|
78 |
public static void registerManager(Class clazz) { |
79 |
getInstance().register(MANAGER_NAME, MANAGER_DESCRIPTION, clazz); |
80 |
} |
81 |
|
82 |
public static void registerDefaultManager(Class clazz) { |
83 |
getInstance().registerDefault(MANAGER_NAME, MANAGER_DESCRIPTION, clazz); |
84 |
} |
85 |
|
86 |
} |