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