Revision 10981

View differences:

trunk/libraries/libUIComponent/src-test/org/gvsig/gui/beans/graphic/TestGraphic.java
9 9
	private GraphicContainer	graphic = null;
10 10
	
11 11
	public TestGraphic() throws NotInitializeException{
12
		graphic = new GraphicContainer(false);
12
		graphic = new GraphicContainer(true);
13 13
		frame.getContentPane().add(graphic);
14 14
		frame.setSize(500, 300);
15 15
		frame.show();
trunk/extensions/extRasterTools-SE/src/org/gvsig/rastertools/histogram/HistogramProcess.java
18 18
*/
19 19
package org.gvsig.rastertools.histogram;
20 20

  
21
import java.awt.event.ActionEvent;
22
import java.awt.event.ActionListener;
23
import java.util.ArrayList;
24
import java.util.Iterator;
25

  
26
import javax.swing.JButton;
27

  
28 21
import org.gvsig.gui.beans.incrementabletask.IIncrementable;
29 22
import org.gvsig.raster.util.Histogram;
30 23
import org.gvsig.raster.util.HistogramException;
trunk/extensions/extRasterTools-SE/src/org/gvsig/rastertools/histogram/ui/HistogramTocMenuEntry.java
69 69
		histogramDialog = new HistogramDialog(width, height);
70 70
		histogramDialog.setSize(width, height);
71 71

  
72
		histogramDialog.getHistogramPanel().clearSources();
73
		histogramDialog.getHistogramPanel().setHistogramableSource(((FLyrRasterSE)lyr).getSource().getRender().getLastRenderBuffer(), PluginServices.getText(this, "datos_visualizados"));
74
		histogramDialog.getHistogramPanel().setHistogramableSource(((FLyrRasterSE)lyr).getSource().getDatasource().getGeoRasterMultiFile(), PluginServices.getText(this, "vista_datasource"));
72
		histogramDialog.clearSources();
73
		histogramDialog.setHistogramableSource(((FLyrRasterSE)lyr).getSource().getRender().getLastRenderBuffer(), PluginServices.getText(this, "datos_visualizados"));
74
		histogramDialog.setHistogramableSource(((FLyrRasterSE)lyr).getSource().getDatasource().getGeoRasterMultiFile(), PluginServices.getText(this, "vista_datasource"));
75 75

  
76 76
		//Par?metros de inicializaci?n del histograma
77 77

  
......
79 79
		histogramDialog.getHistogramPanel().setType(0); //Tipo de histograma; no acumulado
80 80
		histogramDialog.getHistogramPanel().setRGBInBandList(); //Asignaci?n R,G,B en el combo
81 81

  
82
		histogramDialog.getHistogramPanel().getHistogramPanelListener().showHistogram(); //Dibujamos histograma
82
		histogramDialog.getHistogramPanel().firstRun(); // Mostar por primera vez el histograma
83 83
 		       					
84 84
		PluginServices.getMDIManager().addWindow(histogramDialog);
85 85
	}
trunk/extensions/extRasterTools-SE/src/org/gvsig/rastertools/histogram/ui/HistogramDialog.java
25 25
import javax.swing.JPanel;
26 26

  
27 27
import org.gvsig.gui.beans.buttonspanel.ButtonsPanel;
28
import org.gvsig.raster.util.IHistogramable;
28 29

  
29 30
import com.iver.andami.PluginServices;
30 31
import com.iver.andami.ui.mdiManager.IWindow;
......
84 85
			close();
85 86
		}
86 87
	}
88
	
89
	public void clearSources() {
90
		getHistogramPanel().clearSources();
91
	}
92

  
93
	public void setHistogramableSource(IHistogramable lyr, String name) {
94
		getHistogramPanel().setHistogramableSource(lyr, name);
95
	}
87 96
}
trunk/extensions/extRasterTools-SE/src/org/gvsig/rastertools/histogram/ui/HistogramPanel.java
51 51
public class HistogramPanel extends DefaultButtonsPanel {
52 52
	private static final long serialVersionUID = 2772897994667886753L;
53 53

  
54
	private HistogramPanelListener  	histogramPanelListener = null;
54
	private HistogramPanelListener  	histogramPanelListener = getHistogramPanelListener();
55 55
	private ArrayList comboSource = new ArrayList();
56
	private boolean panelInizialited = false;
56 57

  
57
	public static int					MAXBANDS = 10;  
58
	public static int					MAXBANDS = 10;
58 59
	private int 						HSUP = 60;
59 60
	
60 61
	private GraphicContainer	graphicContainer = null;
......
274 275
	 *utilizada para extensiones que necesitan histograma pero no pueden acceder a la fuente de datos.
275 276
	 */
276 277
	public void setOnlyViewValue(){
277
		HistogramPanelListener.comboEventEnable = false;
278
		getHistogramPanelListener().comboEventEnable = false;
278 279
		getJComboBoxOrigen().removeAllItems();
279 280
		getJComboBoxOrigen().addItem(Messages.getText("vista"));
280
		HistogramPanelListener.comboEventEnable = true;
281
		getHistogramPanelListener().comboEventEnable = panelInizialited;
281 282
	}
282 283
	
283 284
	/**
......
319 320
	 * @return javax.swing.JComboBox	
320 321
	 */
321 322
	public JComboBox getJComboBands() {
323
		getHistogramPanelListener().comboEventEnable = false;
322 324
		if (jComboBands == null) {
323 325
			String lista [] = {Messages.getText("todas")};
324 326
			jComboBands = new JComboBox(lista);
325 327
			jComboBands.addActionListener(getHistogramPanelListener());
326 328
			jComboBands.setPreferredSize(new java.awt.Dimension(100,25));
327 329
		}
330
		getHistogramPanelListener().comboEventEnable = panelInizialited;
328 331
		return jComboBands;
329 332
	}
330 333
		
......
333 336
	 * @param bands N?mero de bandas de la imagen
334 337
	 */
335 338
	public void setBands(int bands){
336
		HistogramPanelListener.comboEventEnable = false;
339
		getHistogramPanelListener().comboEventEnable = false;
337 340
		getJComboBands().removeAllItems();
338 341
		getJComboBands().addItem(Messages.getText("todas"));
339 342
		showBands = new boolean[bands];
......
341 344
			getJComboBands().addItem("Band "+String.valueOf(i));
342 345
			showBands[i] = true;
343 346
		}
344
		HistogramPanelListener.comboEventEnable = true;
347
		getHistogramPanelListener().comboEventEnable = panelInizialited;
345 348
	}
346 349
	
347 350
	
......
376 379
	 *
377 380
	 */
378 381
	public void setRGBInBandList(){
379
		HistogramPanelListener.comboEventEnable = false;
382
		getHistogramPanelListener().comboEventEnable = false;
380 383
		boolean[] list = {true, true, true};
381 384
		showBands = list;
382 385
		getJComboBands().removeAllItems();
......
384 387
		getJComboBands().addItem("R");
385 388
		getJComboBands().addItem("G");
386 389
		getJComboBands().addItem("B");
387
		HistogramPanelListener.comboEventEnable = true;
390
		getHistogramPanelListener().comboEventEnable = panelInizialited;
388 391
	}
389 392
	
390 393
	/**
......
486 489
	}
487 490
	
488 491
	public void setHistogramableSource(IHistogramable lyr, String name) {
492
		getHistogramPanelListener().comboEventEnable = false;
489 493
		ArrayList aux = new ArrayList();
490 494
		aux.add(lyr);
491 495
		aux.add(name);
492 496
		comboSource.add(aux);
493 497
		updateComboBoxSource();
498
		getHistogramPanelListener().comboEventEnable = panelInizialited;
494 499
	}
495 500

  
496 501
	public ArrayList getComboSource() {
......
498 503
	}
499 504

  
500 505
	private void updateComboBoxSource() {
506
		getHistogramPanelListener().comboEventEnable = false;
501 507
		getJComboBoxOrigen().removeAllItems();
502 508
		for (int i = 0; i < comboSource.size(); i++) {
503 509
			getJComboBoxOrigen().addItem(((ArrayList) comboSource.get(i)).get(1));
504 510
		}
505
		
511
		getHistogramPanelListener().comboEventEnable = panelInizialited;
506 512
	}
507 513

  
508 514
	public void clearSources() {
509 515
		comboSource = new ArrayList();
510 516
		updateComboBoxSource();
511 517
	}
518
	
519
	public void firstRun() {
520
		panelInizialited = true;
521
		getHistogramPanelListener().comboEventEnable = true;
522
		getHistogramPanelListener().showHistogram();
523
	}
512 524
}
trunk/extensions/extRasterTools-SE/src/org/gvsig/rastertools/histogram/HistogramPanelListener.java
30 30
import org.gvsig.gui.beans.incrementabletask.IncrementableEvent;
31 31
import org.gvsig.gui.beans.incrementabletask.IncrementableListener;
32 32
import org.gvsig.gui.beans.incrementabletask.IncrementableTask;
33
import org.gvsig.raster.dataset.properties.DatasetStatistics;
33
import org.gvsig.raster.util.Histogram;
34 34
import org.gvsig.raster.util.IHistogramable;
35 35
import org.gvsig.rastertools.histogram.ui.HistogramPanel;
36 36
/**
......
41 41
 * @author Borja Sanchez Zamorano (borja.sanchez@iver.es)
42 42
 */
43 43
public class HistogramPanelListener implements ActionListener, KeyListener, IncrementableListener {
44
	private HistogramPanel		histogramPanel = null;
45
	private IncrementableTask	incrementableTask = null;
46
	private HistogramProcess	histogramProcess = null;
47
	private long[][]					lastHistogram = null; 
44 48

  
45
	private HistogramPanel			panel = null;
46
	
47
	private IncrementableTask incrementableTask = null;
48
	private HistogramProcess histogramProcess = null;
49
	/**
50
	 * Objeto histograma para la gesti?n de procesos de histograma
51
	 */
52
//	private	Histogram				histogram = null;
53
	/**
54
	 * ?ltimo histograma visualizado en el gr?fico
55
	 */
56
	private int[][]						lastHistogram = null;
57

  
58
	public static boolean 			comboEventEnable = true;
49
	public boolean						comboEventEnable = false;
59 50
		
60 51
	public HistogramPanelListener(HistogramPanel p){
61
		panel = p;
52
		histogramPanel = p;
62 53
	}
63 54
	
64 55
	public void setControlListeners(){
65
		panel.getGraphicContainer().getPlusButtonControlLeft().addActionListener(this);
66
		panel.getGraphicContainer().getPlusButtonControlRight().addActionListener(this);
67
		panel.getGraphicContainer().getLessButtonControlLeft().addActionListener(this);
68
		panel.getGraphicContainer().getLessButtonControlRight().addActionListener(this);
69
		panel.getGraphicContainer().getTextControlRight().addKeyListener(this);
70
		panel.getGraphicContainer().getTextControlLeft().addKeyListener(this);
56
		histogramPanel.getGraphicContainer().getPlusButtonControlLeft().addActionListener(this);
57
		histogramPanel.getGraphicContainer().getPlusButtonControlRight().addActionListener(this);
58
		histogramPanel.getGraphicContainer().getLessButtonControlLeft().addActionListener(this);
59
		histogramPanel.getGraphicContainer().getLessButtonControlRight().addActionListener(this);
60
		histogramPanel.getGraphicContainer().getTextControlRight().addKeyListener(this);
61
		histogramPanel.getGraphicContainer().getTextControlLeft().addKeyListener(this);
71 62
	}
72 63

  
73 64
	
74 65
	public void keyPressed(KeyEvent e) {
75 66
		if (e.getKeyCode() == 10) {
76 67
			updateStatistic();
68
			updateGraphic();
77 69
		}
78 70
	}
79 71

  
80 72
	private void updateStatistic() {
81
		// TODO Actualizar tabla de los histogramas.
82
		panel.setStatistic(DatasetStatistics.getBasicStatsFromHistogram(getLastHistogram(), (int)panel.getBoxesValues()[1], (int)panel.getBoxesValues()[0], panel.showBands));
73
//		TODO Actualizar tabla de los histogramas.
74
//		histogramPanel.setStatistic(DatasetStatistics.getBasicStatsFromHistogram(getLastHistogram(), (int)panel.getBoxesValues()[1], (int)panel.getBoxesValues()[0], panel.showBands));
83 75
	}
84 76

  
77

  
85 78
	public void actionPerformed(ActionEvent e) {
86 79
		//Botones de m?s y menos
87
		if (e.getSource() == panel.getGraphicContainer().getPlusButtonControlLeft()  ||
88
				e.getSource() == panel.getGraphicContainer().getLessButtonControlLeft()  ||
89
				e.getSource() == panel.getGraphicContainer().getPlusButtonControlRight() ||
90
				e.getSource() == panel.getGraphicContainer().getLessButtonControlRight() ) {
80
		if (e.getSource() == histogramPanel.getGraphicContainer().getPlusButtonControlLeft()  ||
81
				e.getSource() == histogramPanel.getGraphicContainer().getLessButtonControlLeft()  ||
82
				e.getSource() == histogramPanel.getGraphicContainer().getPlusButtonControlRight() ||
83
				e.getSource() == histogramPanel.getGraphicContainer().getLessButtonControlRight() ) {
91 84
			updateStatistic();
85
			updateGraphic();
92 86
			return;
93 87
		}
94 88
		
95 89
		//--------------------------------------
96 90
		//Cambiar las bandas en el combo
97
		JComboBox cbb = panel.getJComboBands();
98
		if (comboEventEnable && e.getSource() == cbb) {
91
		JComboBox cbb = histogramPanel.getJComboBands();
92
		if (comboEventEnable && (e.getSource() == cbb)) {
93
			if (cbb.getSelectedItem() == null) return;
99 94
			if(cbb.getSelectedIndex() == 0) {
100
				boolean[] list = panel.getBandListShowInChart();
95
				boolean[] list = histogramPanel.getBandListShowInChart();
101 96
				for (int i = 0; i < list.length; i++)
102 97
					list[i] = true;
103
				panel.setBandListShowInChart(list);
104
			} else if(cbb.getSelectedItem().equals("R") || cbb.getSelectedItem().equals("Band 0"))
105
				panel.addOrRemoveGraphicBand(0);
106
			else if(cbb.getSelectedItem().equals("G") || cbb.getSelectedItem().equals("Band 1"))
107
				panel.addOrRemoveGraphicBand(1);
108
			else if(cbb.getSelectedItem().equals("B") || cbb.getSelectedItem().equals("Band 2"))
109
				panel.addOrRemoveGraphicBand(2);
110
			else {
111
				for (int i = 3; i < HistogramPanel.MAXBANDS; i++) {
112
					if (cbb.getSelectedItem().equals("Band "+i))
113
						panel.addOrRemoveGraphicBand(i);
114
				}
98
				histogramPanel.setBandListShowInChart(list);
99
				return;
115 100
			}
101
			if (cbb.getSelectedItem().equals("R")) {
102
				histogramPanel.addOrRemoveGraphicBand(0);
103
				return;
104
			}
105
			if(cbb.getSelectedItem().equals("G")) {
106
				histogramPanel.addOrRemoveGraphicBand(1);
107
				return;
108
			}
109
			if(cbb.getSelectedItem().equals("B")) {
110
				histogramPanel.addOrRemoveGraphicBand(2);
111
				return;
112
			}
113
			for (int i = 0; i < HistogramPanel.MAXBANDS; i++) {
114
				if (cbb.getSelectedItem().equals("Band "+i))
115
					histogramPanel.addOrRemoveGraphicBand(i);
116
			}
116 117
			return;
117 118
		}
118 119
		
119 120
		//--------------------------------------		
120 121
		//Limpiar
121
		JButton clean = panel.getJButtonClear();
122
		JButton clean = histogramPanel.getJButtonClear();
122 123
		if (e.getSource() == clean) {
123
			panel.cleanChart();
124
			cleanChart();
124 125
			return;
125 126
		}
126 127
		
127 128
		//--------------------------------------
128 129
		//Selecci?n de fuente de datos del histograma
129
		JComboBox cbo = panel.getJComboBoxOrigen();
130
		JComboBox cbo = histogramPanel.getJComboBoxOrigen();
130 131
		if (comboEventEnable && e.getSource() == cbo) {
131
//			showHistogram();
132
			showHistogram();
132 133
//			panel.setHistogramDataSource(cbo.getSelectedIndex());
133 134
			
134 135
			//En caso de que el histograma se monte a partir de los datos de la vista ponemos RGB en el combo
......
138 139
			//En caso de que el histograma se monte a partir de los datos reales ponemos el n?mero de bandas en el combo
139 140
//			if (cbo.getSelectedIndex() == 1 || cbo.getSelectedIndex() == 2)
140 141
//				panel.setBands(getHistogram().getGrid().getGrid().getBandCount());			
142
			return;
141 143
		}
142 144
				
143 145
		//--------------------------------------
144 146
		//Selecci?n de histograma acumulado y no acumulado
145
		JComboBox cbt = panel.getJComboBoxTipo();
147
		JComboBox cbt = histogramPanel.getJComboBoxTipo();
146 148
		if (comboEventEnable && e.getSource() == cbt) {
147
			panel.setType(cbt.getSelectedIndex());
149
			histogramPanel.setType(cbt.getSelectedIndex());
150
			showHistogram();
151
			return;
148 152
		}
149
	
150
//		if(comboEventEnable)
151
//			panel.showHistogram();
152

  
153 153
	}
154 154

  
155
	/**
156
	 * Obtiene el ?ltimo histograma visualizado
157
	 * @return
158
	 */
159
	public int[][] getLastHistogram() {
160
		return lastHistogram;
161
	}
162

  
163
	/**
164
	 * Asigna el objeto histograma para la gesti?n de procesos de histograma
165
	 * @param histogramObj
166
	 */
167
/*
168
	public void setHistogram(Histogram histogram) {
169
		this.histogram = histogram;
170
	}
171
*/
172
	/**
173
	 * M?todo que ejecuta el thread que comprueba cuando se ha acabado de generar
174
	 * el histograma. Al finalizar, se lee el histograma de la imagen completa 
175
	 * calculado y se muestra.
176
	 */
177
/*
178
	public void readFullHistogramFromThread(){
179
		if (panel.getType() == 0)
180
			lastHistogram = getHistogram().getFullHistogram();
181
		else if(panel.getType() == 1)
182
			lastHistogram = getHistogram().getFullAccumulatedHistogram();
183

  
184
		this.updateStatistic();
185

  
186
		//Si el histograma es grande lo recortamos para mostrarlo porque jfreeChart se vuelve
187
		//inestable al poner muchos elementos en las X
188
		
189
/*
190

  
191
 		int pos = lastHistogram[0].length;
192
		int[][] newHistogram = lastHistogram;
193
		boolean elem = true;
194
		if(lastHistogram[0].length >= Utilities.MAX_SHORT_BIT_VALUE){
195
			for(int i = (lastHistogram[0].length - 1); i >= 0; i--){
196
				for(int iBand = 0; iBand < lastHistogram.length; iBand ++){
197
					if(lastHistogram[iBand][i] != 0)
198
						elem = false;
199
				}
200
				if(!elem){
201
					pos = i;
202
					break;
203
				}
204
			}
205
			newHistogram = new int[lastHistogram.length][pos];
206
			for(int iBand = 0; iBand < lastHistogram.length; iBand ++){
207
				for(int i = 0; i < newHistogram[iBand].length; i ++){
208
					newHistogram[iBand][i] = lastHistogram[iBand][i];
209
				}
210
			}
211
		}
212
*/
213
/*
214
		GraphicChartPanel gcp = pHistogram.getPGraphic();
215
		
216
		String bandNames[] = new String[lastHistogram.length];
217
		for (int iBand = 0; iBand<lastHistogram.length; iBand++)
218
			bandNames[iBand]=this.getJComboBands().getItemAt(iBand+1).toString();
219
		
220
		gcp.setNewChart(newHistogram, bandNames);
221
*/
222
//	}
223
	
224 155
	public void showHistogram() {
225
		IHistogramable iaux = (IHistogramable) ((ArrayList) panel.getComboSource().get(panel.getJComboBoxOrigen().getSelectedIndex())).get(0);
226
		histogramProcess = new HistogramProcess(iaux, panel.getJComboBoxTipo().getSelectedIndex());
156
		if (histogramPanel.getJComboBoxOrigen().getSelectedIndex() < 0) return;
157
		IHistogramable iaux = (IHistogramable) ((ArrayList) histogramPanel.getComboSource().get(histogramPanel.getJComboBoxOrigen().getSelectedIndex())).get(0);
158
		histogramProcess = new HistogramProcess(iaux, histogramPanel.getJComboBoxTipo().getSelectedIndex());
227 159
		incrementableTask = new IncrementableTask(histogramProcess);
228 160
		incrementableTask.addIncrementableListener(this);
229 161
		incrementableTask.showWindow();
230 162
	}
231
/*
232
	public void showHistogram(){
233
		// Tipo noacumulado = 0, acumulado = 1
234
		switch (panel.getType()) {
235
			case 0:
236
				// Fte de datos vista = 0, extent = 1, completo = 2
237
				switch (panel.getHistogramDataSource()) {
238
					case 0:
239
						requestDataType = RasterBuf.TYPE_BYTE;
240
						calcHistogramFromView(panel.showBands); 
241
						break;
242
					case 1:
243
						if(this.getHistogram().getGrid().getDataType() == RasterBuf.TYPE_SHORT)
244
							requestDataType = RasterBuf.TYPE_SHORT;
245
						else
246
							requestDataType = RasterBuf.TYPE_BYTE;	
247
						calcHistogramFromDataSourceAndExtentView(panel.showBands);
248
						break;
249
					case 2:
250
						if(this.getHistogram().getGrid().getDataType() == RasterBuf.TYPE_SHORT)
251
							requestDataType = RasterBuf.TYPE_SHORT;
252
						else
253
							requestDataType = RasterBuf.TYPE_BYTE;
254
						calcFullHistogramFromDataSource(panel.showBands);	
255
						break;
256
				}
257
				break;
258
			case 1:
259
				// Fte de datos vista = 0, extent = 1, completo = 2
260
				switch (panel.getHistogramDataSource()) {
261
					case 0:
262
						requestDataType = RasterBuf.TYPE_BYTE;
263
						calcAccumulatedHistogramFromView(panel.showBands); 
264
						break;
265
					case 1:
266
						if(this.getHistogram().getGrid().getDataType() == RasterBuf.TYPE_SHORT)
267
							requestDataType = RasterBuf.TYPE_SHORT;
268
						else
269
							requestDataType = RasterBuf.TYPE_BYTE;
270
						calcHistogramFromDataSourceAndExtentView(panel.showBands);
271
						break;
272
					case 2:
273
						if(this.getHistogram().getGrid().getDataType() == RasterBuf.TYPE_SHORT)
274
							requestDataType = RasterBuf.TYPE_SHORT;
275
						else
276
							requestDataType = RasterBuf.TYPE_BYTE;
277
						calcFullAccumulatedHistogramFromDataSource(panel.showBands);
278
						break;
279
				}
280
				break;
281
		}
282
	}
283
*/
163
	
284 164
	/**
285
	 * Obtiene el objeto histograma para la gesti?n de procesos de histograma
286
	 * @return
165
	 * Limpia la gr?fica
287 166
	 */
288
/*
289
	public Histogram getHistogram() {
290
		return histogram;
167
	public void cleanChart(){
168
		histogramPanel.cleanChart();
169
		for(int i = 0; i < histogramPanel.showBands.length; i++)
170
			histogramPanel.showBands[i] = false;
291 171
	}
292
*/
293
	
172

  
294 173
	public void keyReleased(KeyEvent e) {
295 174
	}
296 175

  
......
298 177
	}
299 178

  
300 179
	private void closeHistogramProcess() {
301
		histogramProcess.suspend();
302 180
		histogramProcess = null;
303 181
		incrementableTask = null;
304 182
	}
......
306 184
		closeHistogramProcess();
307 185
	}
308 186

  
187
	private void updateGraphic() {
188
		if (lastHistogram == null) return;
189

  
190
		int first = 0;
191
		int end = lastHistogram[0].length;
192

  
193
		first = (int) ((histogramPanel.getGraphicContainer().getBoxesValues()[1]*lastHistogram[0].length)/100);
194
		end = (int) ((histogramPanel.getGraphicContainer().getBoxesValues()[0]*lastHistogram[0].length)/100);
195

  
196
		int[][] newHistogram = new int[lastHistogram.length][end - first];
197
		String[] bandNames = new String[lastHistogram.length];
198
		
199
		for (int iBand=0; iBand<lastHistogram.length; iBand++) {
200
			for (int j=first; j<end; j++)
201
				newHistogram[iBand][j-first] = (int) lastHistogram[iBand][j];
202
			bandNames[iBand] = iBand + "";
203
		}
204

  
205
		histogramPanel.getGraphicContainer().getPGraphic().cleanChart();
206
		histogramPanel.getGraphicContainer().getPGraphic().setNewChart(newHistogram, bandNames);
207
	}
208
	
309 209
	public void actionClosed(IncrementableEvent e) {
310
		//histogramProcess.
311
		panel.getGraphicContainer().getPGraphic().cleanChart();
312
		//panel.getGraphicContainer().getPGraphic().setNewChart(histogramProcess.getLastHistogram(), null);
210
		lastHistogram = histogramProcess.getLastHistogram();
211
		updateGraphic();
313 212
		closeHistogramProcess();
314 213
	}
315 214

  
......
320 219
	public void actionSuspended(IncrementableEvent e) {
321 220
		histogramProcess.suspend();
322 221
	}
323

  
324
	/**
325
	 * Calcula el histograma completo
326
	 * @param bandas que se desean visualizar. Cada elemento del vector es una banda y el boolean, si
327
	 * est? a true se visualizar? esa banda y si est? a false no se visualizar?
328
	 */
329
/*
330
	private void calcFullHistogramFromDataSource(boolean[] bands){
331
		if (histogram != null){
332
			histogram.calcFullHistogram(bands);
333
			incrementPanel = new HistogramIncrement(this);	
334
			incrementPanel.showWindow();
335
		}
336
	}
337
*/
338
	
339
	/**
340
	 * Calcula el histograma de la vista y solo con los datos de visualizaci?n
341
	 * de las bandas R, G o B solicitadas
342
	 * @param bandas que se desean visualizar. Cada elemento del vector es una banda y el boolean, si
343
	 * est? a true se visualizar? esa banda y si est? a false no se visualizar?
344
	 */
345
/*
346
	private void calcHistogramFromView(boolean[] bands){
347
		if(histogram != null){
348
			lastHistogram = histogram.calcHistogramFromView(bands);
349
			panel.showBands = bands;
350
			updateStatistic();
351

  
352
			GraphicChartPanel gcp = panel.getGraphicContainer().getPGraphic();
353
			
354
			String bandNames[] = new String[bands.length];
355
			for (int iBand = 0; iBand<bands.length; iBand++)
356
				bandNames[iBand] = panel.getJComboBands().getItemAt(iBand+1).toString();
357
			
358
			gcp.setNewChart(lastHistogram, bandNames);
359
		}
360
	}
361
*/
362 222
}

Also available in: Unified diff