Revision 20291

View differences:

trunk/extensions/extRemoteSensing/src/org/gvsig/remotesensing/profiles/gui/LineProfileOptionsPanel.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
*/
40

  
1 41
package org.gvsig.remotesensing.profiles.gui;
2 42

  
3 43
import java.awt.BorderLayout;
4
import java.awt.Color;
5 44
import java.awt.Cursor;
6 45
import java.awt.GridBagConstraints;
7 46
import java.awt.GridBagLayout;
......
10 49
import java.awt.Toolkit;
11 50
import java.util.ArrayList;
12 51
import java.util.HashMap;
13
import java.util.Iterator;
14 52
import java.util.LinkedHashMap;
15 53

  
16 54
import javax.swing.ComboBoxModel;
......
45 83
import com.iver.cit.gvsig.project.documents.view.toolListeners.StatusBarListener;
46 84
import com.iver.utiles.swing.JComboBox;
47 85

  
86
/**
87
* Panel para los lineProfiles. Contiene la tabla y los controles asociados para a?adir y eliminar
88
* nuevos profiles.
89
* 	
90
* @author Alejandro Mu?oz Sanchez (alejandro.munoz@uclm.es)   
91
* @version 11/12/2007
92
*  
93
**/
48 94
public class LineProfileOptionsPanel extends JPanel {
49 95

  
50 96
	private static final long serialVersionUID = 1L;
......
89 135
		getTable().getTable().getJTable().getModel().addTableModelListener(
90 136
				listener);
91 137
		
92
		// Grid fuente de datos
93 138
		FLyrRasterSE rasterLayer = (FLyrRasterSE) fLayer;
94 139
		IRasterDataSource dsetCopy = null; 
95 140
		dsetCopy = rasterLayer.getDataSource().newDataset();
......
114 159
	
115 160
	public TableContainer getTable() {
116 161
		if (tableContainer == null) {
117
			String[] columnNames = { PluginServices.getText(this, "punto"),
162
			String[] columnNames = { PluginServices.getText(this, "Linea"),
118 163
					PluginServices.getText(this, "color"),
119
					PluginServices.getText(this, "linea"),
120
					PluginServices.getText(this, "columna"),
121
					PluginServices.getText(this, "coordenada x"),
122
					PluginServices.getText(this, "coordenada y")
164
					PluginServices.getText(this, "valor_max"),
165
					PluginServices.getText(this, "valor_min"),
166
					PluginServices.getText(this, "valor_medio")
123 167
			};
124
			int[] columnWidths = { 50, 25, 25, 25, 45, 50 };
168
			int[] columnWidths = {30, 30, 25, 25, 25};
125 169
			tableContainer = new TableContainer(columnNames, columnWidths);
126
			tableContainer.setModel("ROIsTableModel");
170
			tableContainer.setModel("ProfilesTableModel");
127 171
			tableContainer.initialize();
128 172
			tableContainer.setControlVisible(false);
129 173
		}
......
134 178
	public JPanel getControlPanel() {
135 179
		if (controlPanel == null) {
136 180
			controlPanel = new JPanel();
137
			//controlPanel.setPreferredSize(new Dimension(80,20));	
138 181
			GridBagLayout gb = new GridBagLayout();
139 182
			controlPanel.setLayout(gb);
140 183
			GridBagConstraints constrains = new GridBagConstraints();
......
150 193
			constrains.gridx= 0;
151 194
			constrains.gridy= 2;
152 195
			controlPanel.add(getComboBands(),constrains);
153

  
154 196
		}
155 197
		return controlPanel;
156 198
	}
......
178 220
	}
179 221

  
180 222
	
181
	
182 223
	public void selectDrawRoiTool() {
183 224
		if (mapControl != null){
184 225
			if (getNewButton().isSelected()) {
trunk/extensions/extRemoteSensing/src/org/gvsig/remotesensing/profiles/gui/ZProfileOptionsPanel.java
157 157
		if (tableContainer == null) {
158 158
			String[] columnNames = { PluginServices.getText(this, "punto"),
159 159
					PluginServices.getText(this, "color"),
160
					PluginServices.getText(this, "linea"),
161
					PluginServices.getText(this, "columna"),
162
					PluginServices.getText(this, "coordenada x"),
163
					PluginServices.getText(this, "coordenada y")
160
					PluginServices.getText(this, "coordx"),
161
					PluginServices.getText(this, "coordy"),
164 162
			};
165
			int[] columnWidths = { 50, 25, 25, 25, 45, 50 };
163
			int[] columnWidths = { 20, 25, 25, 25, 0 };
166 164
			tableContainer = new TableContainer(columnNames, columnWidths);
167
			tableContainer.setModel("ROIsTableModel");
165
			tableContainer.setModel("ProfilesTableModel");
168 166
			tableContainer.initialize();
169 167
			tableContainer.setControlVisible(false);
170 168
		}
trunk/extensions/extRemoteSensing/src/org/gvsig/remotesensing/profiles/gui/ProfilePanel.java
48 48
import javax.swing.event.ChangeEvent;
49 49
import javax.swing.event.ChangeListener;
50 50

  
51
import org.gvsig.fmap.raster.grid.roi.VectorialROI;
51 52
import org.gvsig.gui.beans.buttonspanel.ButtonsPanel;
52 53
import org.gvsig.gui.beans.defaultbuttonspanel.DefaultButtonsPanel;
53 54
import org.gvsig.gui.beans.graphic.GraphicChartPanel;
......
181 182
				GraphicLayer graphicLayer = mapControl.getMapContext().getGraphicsLayer();
182 183
				graphicLayer.clearAllGraphics();
183 184
				getLineOptionsPanel().selectDrawRoiTool();
185
			
186
				try {
187
				
188
					int selectedRow = getLineOptionsPanel().getTable().getSelectedRow();
189
					String roiName = (String)getLineOptionsPanel().getTable().getModel().getValueAt(selectedRow,0);
190
					VectorialROI roi = (VectorialROI)getLineOptionsPanel().getROI(roiName);
191
					roi.setBandToOperate(getLineOptionsPanel().getComboBands().getSelectedIndex());
192
					getLineOptionsPanel().getTable().setSelectedIndex(0);
193
					getLineOptionsPanel().getTable().updateUI();
194
				
195
					
196
				} catch (Exception e1) {
197
					// TODO: handle exception
198
				}
199
				
184 200
				graphicLayer.clearSymbolsGraphics();
185 201
				mapControl.rePaintDirtyLayers();
186 202
				nextActiveChart= PANELZPROFILE;

Also available in: Unified diff