Revision 30043

View differences:

branches/v2_0_0_prep/libraries/libUIComponent/src/org/gvsig/gui/beans/table/models/ROIsTableModel.java
9 9
	private static final long serialVersionUID = 8716862990277121681L;
10 10

  
11 11
	
12
	private static boolean[]	canEdit = new boolean[] { true, false, false, false, true, false };
13
	private static Class[]   	types   = new Class[] { String.class, Integer.class, Integer.class, Integer.class, JButton.class, Integer.class };
12
	private static boolean[]	canEdit = new boolean[] { true, false, false, false, true };
13
	private static Class[]   	types   = new Class[] { String.class, Integer.class, Integer.class, Integer.class, JButton.class };
14 14
	private static Color[]   	colors  = new Color[] {Color.RED, Color.GREEN, Color.BLUE, Color.YELLOW, Color.MAGENTA, Color.CYAN,
15 15
		Color.ORANGE, Color.PINK, Color.WHITE, Color.BLACK};
16 16
	
17 17
	public ROIsTableModel(String[] columnNames) {
18
		super(new Object[0][6], columnNames);
18
		super(new Object[0][5], columnNames);
19 19
	}
20 20
	
21 21
	/*
......
30 30
		else{
31 31
			color = new Color((float)Math.random(),(float)Math.random(),(float)Math.random());
32 32
		}
33
		return new Object[] {"", new Integer(0), new Integer(0), new Integer(0), color, new Integer(0)};
33
		return new Object[] {"", new Integer(0), new Integer(0), new Integer(0), color};
34 34
	}
35 35

  
36 36
	/*
branches/v2_0_0_prep/extensions/extRasterTools-SE/src/org/gvsig/rastertools/roi/ui/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

  
branches/v2_0_0_prep/extensions/extRasterTools-SE/src/org/gvsig/rastertools/roi/ui/listener/DrawMouseViewListener.java
88 88
				((ILineSymbol)sym).setLineColor(geometryColor);
89 89
			}
90 90

  
91
			tablePanel.getTable().getModel().setValueAt(new Integer(roi.getValues()), selectedRow, 5);
92

  
93 91
			GraphicLayer graphicLayer = tablePanel.getMapControl().getMapContext().getGraphicsLayer();
94 92

  
95 93
			FGraphic fGraphic = new FGraphic(geometry,graphicLayer.addSymbol(sym));
......
98 96
			tablePanel.getMapControl().drawGraphics();
99 97
		} catch (NotInitializeException e) {
100 98
			RasterToolsUtil.messageBoxError("error_tabla_rois", tablePanel, e);
101
		} catch (GridException e) {
102
			e.printStackTrace();
103 99
		}
104 100

  
105 101
	}

Also available in: Unified diff