svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.raster.tools / org.gvsig.raster.tools.swing / org.gvsig.raster.tools.swing.api / src / main / java / org / gvsig / raster / tools / swing / api / RasterToolsSwingLocator.java @ 44831
History | View | Annotate | Download (2.73 KB)
1 | 44831 | jjdelcerro | package org.gvsig.raster.tools.swing.api; |
---|---|---|---|
2 | /* gvSIG. Desktop Geographic Information System.
|
||
3 | *
|
||
4 | * Copyright ? 2007-2017 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 | |||
26 | import org.gvsig.tools.locator.BaseLocator; |
||
27 | |||
28 | /**
|
||
29 | * This locator is the entry point for the Publish swing library,
|
||
30 | *
|
||
31 | * @author gvSIG team
|
||
32 | * @version $Id$
|
||
33 | */
|
||
34 | public class RasterToolsSwingLocator extends BaseLocator { |
||
35 | |||
36 | /**
|
||
37 | * Chart swing manager name.
|
||
38 | */
|
||
39 | public static final String SWING_MANAGER_NAME = |
||
40 | "Raster.tools.swing.manager";
|
||
41 | |||
42 | /**
|
||
43 | * Chart swing manager description.
|
||
44 | */
|
||
45 | public static final String SWING_MANAGER_DESCRIPTION = |
||
46 | "UIManager of Raster Tools plugin";
|
||
47 | |||
48 | private static final String LOCATOR_NAME = "Raster.tools.swing.locator"; |
||
49 | |||
50 | /**
|
||
51 | * Unique instance.
|
||
52 | */
|
||
53 | private static final RasterToolsSwingLocator INSTANCE = |
||
54 | new RasterToolsSwingLocator();
|
||
55 | |||
56 | /**
|
||
57 | * Return the singleton instance.
|
||
58 | *
|
||
59 | * @return the singleton instance
|
||
60 | */
|
||
61 | public static RasterToolsSwingLocator 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 RasterToolsSwingManager> 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 RasterToolsSwingManager getSwingManager() { |
||
92 | return (RasterToolsSwingManager) getInstance()
|
||
93 | .get(SWING_MANAGER_NAME); |
||
94 | } |
||
95 | |||
96 | } |