gvsig-raster / org.gvsig.raster / branches / org.gvsig.raster.2.4 / org.gvsig.wmts / org.gvsig.wmts.swing / org.gvsig.wmts.swing.api / src / main / java / org / gvsig / wmts / swing / api / WMTSSwingLocator.java @ 8700
History | View | Annotate | Download (2.88 KB)
1 | 8700 | 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.wmts.swing.api; |
||
23 | |||
24 | |||
25 | import org.gvsig.tools.locator.BaseLocator; |
||
26 | import org.gvsig.tools.locator.Locator; |
||
27 | import org.gvsig.tools.locator.LocatorException; |
||
28 | |||
29 | /**
|
||
30 | * This locator is the entry point for the Google Maps library,
|
||
31 | * providing access to all Google Maps services through the
|
||
32 | * {@link WMTSSwingManager} .
|
||
33 | *
|
||
34 | * @author gvSIG team
|
||
35 | * @version $Id$
|
||
36 | */
|
||
37 | public class WMTSSwingLocator extends BaseLocator { |
||
38 | |||
39 | /**
|
||
40 | * WebMap manager name.
|
||
41 | */
|
||
42 | public static final String MANAGER_NAME = "WMTSSwingManager"; |
||
43 | |||
44 | /**
|
||
45 | * WebMap manager description.
|
||
46 | */
|
||
47 | public static final String MANAGER_DESCRIPTION = "WMTS Swing Manager"; |
||
48 | |||
49 | private static final String LOCATOR_NAME = "WMTSSwingLocator"; |
||
50 | |||
51 | /**
|
||
52 | * Unique instance.
|
||
53 | */
|
||
54 | private static final WMTSSwingLocator INSTANCE = |
||
55 | new WMTSSwingLocator();
|
||
56 | |||
57 | /**
|
||
58 | * Return the singleton instance.
|
||
59 | *
|
||
60 | * @return the singleton instance
|
||
61 | */
|
||
62 | public static WMTSSwingLocator getInstance() { |
||
63 | return INSTANCE;
|
||
64 | } |
||
65 | |||
66 | /**
|
||
67 | * Return the Locator's name.
|
||
68 | *
|
||
69 | * @return a String with the Locator's name
|
||
70 | */
|
||
71 | public final String getLocatorName() { |
||
72 | return LOCATOR_NAME;
|
||
73 | } |
||
74 | |||
75 | /**
|
||
76 | * Return a reference to the WMTSSwingManager.
|
||
77 | *
|
||
78 | * @return a reference to the GoogleMapsSwingManager
|
||
79 | * @throws LocatorException
|
||
80 | * if there is no access to the class or the class cannot be
|
||
81 | * instantiated
|
||
82 | * @see Locator#get(String)
|
||
83 | */
|
||
84 | public static WMTSSwingManager getManager() throws LocatorException { |
||
85 | return (WMTSSwingManager) getInstance().get(MANAGER_NAME);
|
||
86 | } |
||
87 | |||
88 | /**
|
||
89 | * Registers the Class implementing the GoogleMapsSwingManager interface.
|
||
90 | *
|
||
91 | * @param clazz
|
||
92 | * implementing the GoogleMapsSwingManager interface
|
||
93 | */
|
||
94 | public static void registerManager( |
||
95 | Class<? extends WMTSSwingManager> clazz) { |
||
96 | getInstance().register(MANAGER_NAME, MANAGER_DESCRIPTION, clazz); |
||
97 | } |
||
98 | |||
99 | } |