svn-gvsig-desktop / branches / v2_0_0_prep / libraries / org.gvsig.symbology / org.gvsig.symbology.swing / org.gvsig.symbology.swing.api / src / main / java / org / gvsig / symbology / swing / SymbologySwingLocator.java @ 34291
History | View | Annotate | Download (2.76 KB)
1 | 34291 | fdiaz | /* 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.symbology.swing; |
||
23 | |||
24 | import org.gvsig.tools.locator.BaseLocator; |
||
25 | |||
26 | /**
|
||
27 | * This locator is the entry point for the Symbology swing library,
|
||
28 | * providing access to all Symbology swing services through the
|
||
29 | * {@link SymbologySwingManager} .
|
||
30 | *
|
||
31 | * @author gvSIG team
|
||
32 | * @version $Id$
|
||
33 | */
|
||
34 | public class SymbologySwingLocator extends BaseLocator { |
||
35 | |||
36 | /**
|
||
37 | * Symbology swing manager name.
|
||
38 | */
|
||
39 | public static final String SWING_MANAGER_NAME = |
||
40 | "Symbology.swing.manager";
|
||
41 | |||
42 | /**
|
||
43 | * Symbology swing manager description.
|
||
44 | */
|
||
45 | public static final String SWING_MANAGER_DESCRIPTION = |
||
46 | "Symbology UIManager";
|
||
47 | |||
48 | private static final String LOCATOR_NAME = "Symbology.swing.locator"; |
||
49 | |||
50 | /**
|
||
51 | * Unique instance.
|
||
52 | */
|
||
53 | private static final SymbologySwingLocator INSTANCE = |
||
54 | new SymbologySwingLocator();
|
||
55 | |||
56 | /**
|
||
57 | * Return the singleton instance.
|
||
58 | *
|
||
59 | * @return the singleton instance
|
||
60 | */
|
||
61 | public static SymbologySwingLocator 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 SymbologySwingManager> 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 SymbologySwingManager getSwingManager() { |
||
92 | return (SymbologySwingManager) getInstance()
|
||
93 | .get(SWING_MANAGER_NAME); |
||
94 | } |
||
95 | |||
96 | } |