Revision 30043 branches/v2_0_0_prep/extensions/extRasterTools-SE/src/org/gvsig/rastertools/roi/ui/ROIsTablePanel.java

View differences:

ROIsTablePanel.java
195 195
					PluginServices.getText(this, "poligonos"),
196 196
					PluginServices.getText(this, "lineas"),
197 197
					PluginServices.getText(this, "puntos"),
198
					PluginServices.getText(this, "color"),
199
					PluginServices.getText(this, "pixeles")};
200
			int[] columnWidths = { 50, 25, 25, 25, 45, 50 };
198
					PluginServices.getText(this, "color")};
199
			int[] columnWidths = { 50, 25, 25, 25, 45};
201 200
			tableContainer = new TableContainer(columnNames, columnWidths);
202 201
			tableContainer.setModel("ROIsTableModel");
203 202
			tableContainer.initialize();
......
239 238

  
240 239
	public void setFLayer(FLayer layer) throws GridException {
241 240
		fLayer = layer;
242
		FLyrRasterSE rasterLayer = (FLyrRasterSE) layer;
241
		/*FLyrRasterSE rasterLayer = (FLyrRasterSE) layer;
243 242
		IRasterDataSource dsetCopy = null;
244 243
		dsetCopy = rasterLayer.getDataSource().newDataset();
245 244
		BufferFactory bufferFactory = new BufferFactory(dsetCopy);
......
255 254
			grid = new Grid(bufferFactory, bands);
256 255
		} catch (RasterBufferInvalidException e) {
257 256
			e.printStackTrace();
258
		}
257
		}*/
259 258

  
260 259
		if (view==null){
261 260
			IWindow[] list = PluginServices.getMDIManager().getAllWindows();
......
275 274
			previousTool = mapControl.getCurrentTool();
276 275

  
277 276
			// Listener de eventos de movimiento que pone las coordenadas del rat?n
278
			// en
279
			// la barra de estado
277
			// en la barra de estado
280 278
			StatusBarListener sbl = new StatusBarListener(mapControl);
281 279

  
282 280
			DrawMouseViewListener drawMouseViewListener = new DrawMouseViewListener(
......
470 468
	}
471 469

  
472 470
	public Grid getGrid() {
471
		if(grid == null) {
472
			FLyrRasterSE rasterLayer = (FLyrRasterSE) getFLayer();
473
			IRasterDataSource dsetCopy = null; 
474
			dsetCopy = rasterLayer.getDataSource().newDataset();
475
			BufferFactory bufferFactory = new BufferFactory(dsetCopy);
476
			bufferFactory.setReadOnly(true);
477
			bufferFactory.setAllDrawableBands();
478

  
479
			int bands[] = null;
480
			bands = new int[rasterLayer.getBandCount()];
481
			for (int i = 0; i < rasterLayer.getBandCount(); i++)
482
				bands[i] = i;
483
			try {
484
				grid = new Grid(bufferFactory, bands);
485
			} catch (RasterBufferInvalidException e) {
486
				e.printStackTrace();
487
			}
488
		}
473 489
		return grid;
474 490
	}
475 491

  

Also available in: Unified diff