Revision 11004 trunk/extensions/extRasterTools-SE/src/org/gvsig/rastertools/histogram/ui/HistogramPanel.java

View differences:

HistogramPanel.java
77 77
	 * bandas no son de visualizaci?n (bandas de la imagen en disco) tendr? un elemento
78 78
	 * por cada una. 
79 79
	 */
80
	public boolean[]					showBands = {true, true, true};
80
//	public boolean[]					showBands = {true, true, true};
81 81
	
82 82
	/**
83 83
	 * Tipo de histograma 
......
131 131
	 */
132 132
	public GraphicContainer getGraphicContainer() {
133 133
		if (graphicContainer == null) {
134
			graphicContainer = new GraphicContainer( false);
134
			graphicContainer = new GraphicContainer(true);
135 135
		}
136 136
		return graphicContainer;
137 137
	}
......
339 339
		getHistogramPanelListener().comboEventEnable = false;
340 340
		getJComboBands().removeAllItems();
341 341
		getJComboBands().addItem(Messages.getText("todas"));
342
		showBands = new boolean[bands];
342
//		showBands = new boolean[bands];
343 343
		for(int i = 0; i < bands; i++){
344 344
			getJComboBands().addItem("Band "+String.valueOf(i));
345
			showBands[i] = true;
345
//			showBands[i] = true;
346 346
		}
347 347
		getHistogramPanelListener().comboEventEnable = panelInizialited;
348 348
	}
......
380 380
	 */
381 381
	public void setRGBInBandList(){
382 382
		getHistogramPanelListener().comboEventEnable = false;
383
		boolean[] list = {true, true, true};
384
		showBands = list;
383
//		boolean[] list = {true, true, true};
384
//		showBands = list;
385 385
		getJComboBands().removeAllItems();
386 386
		getJComboBands().addItem(Messages.getText("todas"));
387 387
		getJComboBands().addItem("R");
......
391 391
	}
392 392
	
393 393
	/**
394
	 * A?ade o elimina una banda de la visualizaci?n. Si la banda se est? visualizando
395
	 * se elimina y si no entonces se muestra
396
	 * @param band banda a visualizar o borrar del gr?fico
397
	 */
398
	public void addOrRemoveGraphicBand(int band){
399
		if (band > showBands.length)
400
			return;
401
		showBands[band] = !showBands[band];
402
	}
403
	
404
	/**
405
	 * Limpia la gr?fica
406
	 */
407
	public void cleanChart(){
408
		GraphicChartPanel gcp = graphicContainer.getPGraphic();
409
		gcp.cleanChart();
410
		for(int i = 0; i < showBands.length; i++)
411
			showBands[i] = false;
412
	}
413
	
414
	/**
415 394
	 * Obtiene el tipo de datos de la fuente de la imagen
416 395
	 * @return tipo de datos de la fuente de la imagen
417 396
	 */
......
428 407
	}
429 408

  
430 409
	/**
431
	 * Obtiene la lista de bandas que se muestran en el histograma
432
	 * @return Lista de bandas donde cada elemento es un booleano. True si la banda
433
	 * se muestra y false si no se muestra.
410
	 * Limpia la gr?fica
434 411
	 */
435
	public boolean[] getBandListShowInChart(){
436
		return showBands;
412
	public void cleanChart(){
413
		GraphicChartPanel gcp = graphicContainer.getPGraphic();
414
		gcp.cleanChart();
437 415
	}
438 416

  
439 417
	/**
440
	 * Asigna la lista de bandas que se muestran en el histograma
441
	 * @param Lista de bandas donde cada elemento es un booleano. True si la banda
442
	 * se muestra y false si no se muestra.
443
	 */
444
	public void setBandListShowInChart(boolean[] showBands) {
445
		this.showBands = showBands;
446
	}
447
	
448
	/**
449 418
	 * Obtiene el tipo de histograma a mostrar
450 419
	 * @return acumulado/no acumulado
451 420
	 */
......
469 438
	 */
470 439
	public double[] getBoxesValues(){
471 440
		double[] v = new double[2];
472
		double[] currentValues = getGraphicContainer().getBoxesValues();
441
		double[] currentValues = new double[2];
442
		currentValues[0] = getGraphicContainer().getX2();
443
		currentValues[1] = getGraphicContainer().getX1();
473 444
		switch (requestDataType){
474 445
			case RasterBuf.TYPE_BYTE: 	v[0] = (currentValues[0] * RasterUtilities.MAX_BYTE_BIT_VALUE) / 100; 
475 446
				v[1] = (currentValues[1] * RasterUtilities.MAX_BYTE_BIT_VALUE) / 100;

Also available in: Unified diff