gvsig-raster / org.gvsig.raster.wcs / trunk / org.gvsig.raster.wcs / org.gvsig.raster.wcs.app / org.gvsig.raster.wcs.app.wcsclient / src / main / java / org / gvsig / raster / wcs / app / wcsclient / WCSClientExtension.java @ 418
History | View | Annotate | Download (2.79 KB)
1 |
/* 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.raster.wcs.app.wcsclient; |
23 |
|
24 |
import org.gvsig.andami.PluginServices; |
25 |
import org.gvsig.andami.plugins.Extension; |
26 |
import org.gvsig.app.extension.AddLayer; |
27 |
import org.gvsig.fmap.mapcontrol.MapControl; |
28 |
import org.gvsig.raster.app.extension.wcsclient.gui.toc.WCSPropsTocMenuEntry; |
29 |
import org.gvsig.raster.app.extension.wcsclient.gui.toc.WCSZoomPixelCursorTocMenuEntry; |
30 |
import org.gvsig.raster.app.extension.wcsclient.gui.wizard.WCSWizard; |
31 |
import org.gvsig.raster.app.extension.wcsclient.layer.DynObjectSetWCSInfo; |
32 |
import org.gvsig.raster.app.extension.wcsclient.layer.FLyrWCS; |
33 |
import org.gvsig.tools.ToolsLocator; |
34 |
import org.gvsig.tools.extensionpoint.ExtensionPoint; |
35 |
|
36 |
|
37 |
/**
|
38 |
* Extension for adding WCS support to gvSIG.
|
39 |
* @author jaume
|
40 |
*/
|
41 |
public class WCSClientExtension extends Extension { |
42 |
/**
|
43 |
* Initializes the toc menu
|
44 |
*/
|
45 |
public void initialize() { |
46 |
// Adds a new tab to the "add layer" wizard for WCS layer creation
|
47 |
ExtensionPoint exPoint = ToolsLocator.getExtensionPointManager().add( |
48 |
"View_TocActions");
|
49 |
|
50 |
AddLayer.addWizard(WCSWizard.class); |
51 |
|
52 |
exPoint.append("WCSProperties", "", new WCSPropsTocMenuEntry()); |
53 |
exPoint.append("WCSZoomPixel", "", new WCSZoomPixelCursorTocMenuEntry()); |
54 |
|
55 |
ToolsLocator.getExtensionPointManager().add("CatalogLayers").append(
|
56 |
"OGC:WCS", "", FLyrWCS.class); |
57 |
initializeIcons(); |
58 |
DynObjectSetWCSInfo.registerDynClass(); |
59 |
} |
60 |
|
61 |
public void execute(String actionCommand) { |
62 |
// no commands, no code.
|
63 |
} |
64 |
|
65 |
public boolean isEnabled() { |
66 |
// may return whatever
|
67 |
return true; |
68 |
} |
69 |
|
70 |
public boolean isVisible() { |
71 |
// may return whatever
|
72 |
return false; |
73 |
} |
74 |
|
75 |
void initializeIcons(){
|
76 |
PluginServices.getIconTheme().registerDefault( |
77 |
"view-previsualize-area",
|
78 |
MapControl.class.getResource("images/ZoomPixelCursor.gif")
|
79 |
); |
80 |
PluginServices.getIconTheme().registerDefault( |
81 |
"ico-WCS-Layer",
|
82 |
MapControl.class.getResource("images/icoLayer.png")
|
83 |
); |
84 |
} |
85 |
} |