Revision 18830 trunk/extensions/extRemoteSensing/src/org/gvsig/remotesensing/RemoteSensingModule.java

View differences:

RemoteSensingModule.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
*
3
* Copyright (C) 2007 Instituto de Desarrollo Regional and Generalitat Valenciana.
4
*
5
* This program is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU General Public License
7
* as published by the Free Software Foundation; either version 2
8
* of the License, or (at your option) any later version.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
*
19
* For more information, contact:
20
*
21
*  Generalitat Valenciana
22
*   Conselleria d'Infraestructures i Transport
23
*   Av. Blasco Ib??ez, 50
24
*   46010 VALENCIA
25
*   SPAIN
26
*
27
*      +34 963862235
28
*   gvsig@gva.es
29
*      www.gvsig.gva.es
30
*
31
*    or
32
*
33
*   Instituto de Desarrollo Regional (Universidad de Castilla La-Mancha)
34
*   Campus Universitario s/n
35
*   02071 Alabacete
36
*   Spain
37
*
38
*   +34 967 599 200
39
*/
1 40
package org.gvsig.remotesensing;
2 41

  
42
import javax.swing.Icon;
43

  
3 44
import org.gvsig.fmap.raster.layers.FLyrRasterSE;
45
import org.gvsig.raster.gui.IGenericToolBarMenuItem;
4 46
import org.gvsig.remotesensing.decisiontrees.gui.DecisionTreeDialog;
5 47
import org.gvsig.remotesensing.scatterplot.gui.ScatterPlotTocMenuEntry;
6 48

  
7 49
import com.iver.andami.PluginServices;
8 50
import com.iver.andami.plugins.Extension;
9 51
import com.iver.cit.gvsig.fmap.MapContext;
52
import com.iver.cit.gvsig.fmap.layers.FLayer;
10 53
import com.iver.cit.gvsig.fmap.layers.FLayers;
11 54
import com.iver.cit.gvsig.project.documents.view.IProjectView;
12 55
import com.iver.cit.gvsig.project.documents.view.gui.View;
56
import com.iver.cit.gvsig.project.documents.view.toc.ITocItem;
13 57
import com.iver.utiles.extensionPoints.ExtensionPoints;
14 58
import com.iver.utiles.extensionPoints.ExtensionPointsSingleton;
15 59

  
16
public class RemoteSensingModule extends Extension {
60
public class RemoteSensingModule extends Extension implements IGenericToolBarMenuItem {
17 61

  
62
	/*
63
	 * (non-Javadoc)
64
	 * @see com.iver.andami.plugins.IExtension#execute(java.lang.String)
65
	 */
18 66
	public void execute(String actionCommand) {
19 67
		if (actionCommand.equals("decision_trees")){
20 68
			com.iver.andami.ui.mdiManager.IWindow activeWindow = PluginServices.getMDIManager().getActiveWindow();
......
27 75
		}
28 76
	}
29 77

  
78
	/*
79
	 * (non-Javadoc)
80
	 * @see com.iver.andami.plugins.IExtension#initialize()
81
	 */
30 82
	public void initialize() {
31 83
		ExtensionPoints extensionPoints = ExtensionPointsSingleton.getInstance();
32 84
		
33 85
		//A?adimos la entrada del toc de diagramas de dispersion.
34
		extensionPoints.add("View_TocActions", "ScatterPlot", new ScatterPlotTocMenuEntry());
86
		extensionPoints.add("View_TocActions", "ScatterPlot", ScatterPlotTocMenuEntry.getSingleton());
35 87

  
88
		extensionPoints.add("GenericToolBarMenu", "ScatterPlot", ScatterPlotTocMenuEntry.getSingleton());
89
		extensionPoints.add("GenericToolBarMenu", "DecisionTree", this);
36 90
	}
37 91

  
92
	/*
93
	 * (non-Javadoc)
94
	 * @see com.iver.andami.plugins.IExtension#isEnabled()
95
	 */
38 96
	public boolean isEnabled() {
39 97
		com.iver.andami.ui.mdiManager.IWindow f = PluginServices.getMDIManager().getActiveWindow();
40 98
		if (f == null) {
......
52 110
		return false;
53 111
	}
54 112

  
113
	/*
114
	 * (non-Javadoc)
115
	 * @see com.iver.andami.plugins.IExtension#isVisible()
116
	 */
55 117
	public boolean isVisible() {
56 118
		com.iver.andami.ui.mdiManager.IWindow f = PluginServices.getMDIManager().getActiveWindow();
57 119
		if (f == null) {
......
67 129
		}
68 130
	}
69 131

  
70
}
132
	/*
133
	 * (non-Javadoc)
134
	 * @see org.gvsig.raster.gui.IGenericToolBarMenuItem#getGroup()
135
	 */
136
	public String getGroup() {
137
		return "RasterProcess";
138
	}
139

  
140
	/*
141
	 * (non-Javadoc)
142
	 * @see org.gvsig.raster.gui.IGenericToolBarMenuItem#getIcon()
143
	 */
144
	public Icon getIcon() {
145
		return PluginServices.getIconTheme().get("blank-icon");
146
	}
147

  
148
	/*
149
	 * (non-Javadoc)
150
	 * @see org.gvsig.raster.gui.IGenericToolBarMenuItem#getOrder()
151
	 */
152
	public int getOrder() {
153
		return 0;
154
	}
155

  
156
	/*
157
	 * (non-Javadoc)
158
	 * @see org.gvsig.raster.gui.IGenericToolBarMenuItem#getText()
159
	 */
160
	public String getText() {
161
		return PluginServices.getText(this, "decision_trees");
162
	}
163

  
164
	/*
165
	 * (non-Javadoc)
166
	 * @see org.gvsig.raster.gui.IGenericToolBarMenuItem#isEnabled(com.iver.cit.gvsig.project.documents.view.toc.ITocItem, com.iver.cit.gvsig.fmap.layers.FLayer[])
167
	 */
168
	public boolean isEnabled(ITocItem item, FLayer[] selectedItems) {
169
		return isEnabled();
170
	}
171

  
172
	/*
173
	 * (non-Javadoc)
174
	 * @see org.gvsig.raster.gui.IGenericToolBarMenuItem#isVisible(com.iver.cit.gvsig.project.documents.view.toc.ITocItem, com.iver.cit.gvsig.fmap.layers.FLayer[])
175
	 */
176
	public boolean isVisible(ITocItem item, FLayer[] selectedItems) {
177
		return isVisible();
178
	}
179

  
180
	/*
181
	 * (non-Javadoc)
182
	 * @see org.gvsig.raster.gui.IGenericToolBarMenuItem#execute(com.iver.cit.gvsig.project.documents.view.toc.ITocItem, com.iver.cit.gvsig.fmap.layers.FLayer[])
183
	 */
184
	public void execute(ITocItem item, FLayer[] selectedItems) {
185
		execute("decision_trees");
186
	}
187
}

Also available in: Unified diff