Revision 23776

View differences:

trunk/extensions/extRasterTools-SE/src/org/gvsig/fmap/raster/layers/FLyrRasterSE.java
133 133
	private FLyrState           state               = new FLyrState();
134 134
	private ArrayList           filterArguments     = null;
135 135
	protected ILegend           lastLegend          = null;
136
	protected ColorTable        loadedFromProject   = null;
136 137
	private ArrayList           rois                = null;
137 138
	private RasterDrawStrategy  strategy            = null;
138 139
	static private IConfiguration configuration       = new DefaultLayerConfiguration();
......
381 382
		lastLegend = null;
382 383

  
383 384
		try {
384
			if (this.getDataSource().getColorTables()[0] != null) {
385
			//Si en la carga del proyecto se carg? una tabla de color asignamos esta
386
			if(loadedFromProject != null) {
387
				GridPalette p = new GridPalette(loadedFromProject);
388
				setLastLegend(p);
389
				ColorTableListManager ctm = new ColorTableListManager(filterManager);
390
				ctm.addColorTableFilter(p);
391
			} else 
392
				//sino ponemos la tabla asociada al raster
393
				if (this.getDataSource().getColorTables()[0] != null) {
385 394
				GridPalette p = new GridPalette(getDataSource().getColorTables()[0]);
386 395
				setLastLegend(p);
387 396
				ColorTableListManager ctm = new ColorTableListManager(filterManager);
388 397
				ctm.addColorTableFilter(p);
389 398
			} else {
390
				if (getDataType()[0] != IBuffer.TYPE_BYTE) {
399
				//sino hace lo que dice en las preferencias
400
				if (getDataType()[0] != IBuffer.TYPE_BYTE) 
391 401
					loadEnhancedOrColorTable(filterManager);
392
				}
402
				
393 403
			}
394

  
404
			loadedFromProject = null;
405
			
395 406
			getRender().setFilterList(filterList);
396 407
			// Inicializo la transparencia para el render
397 408
			getRender().setLastTransparency(gridTransparency);
......
913 924
							((StatusLayerRaster)status).setNameClass(claseStr);
914 925
							status.setXMLEntity(xml, this);
915 926
							filterArguments = status.getFilterArguments();
916
							crearColorTable();
927
							
928
							//Creamos la tabla de color
929
							ArrayList color = (ArrayList) filterArguments.clone();
930
							loadedFromProject = ColorTableListManager.createColorTableFromArray(color);
917 931
						}
918 932
					} catch (ClassNotFoundException exc) {
919 933
						throw new XMLException(exc);
......
934 948
		}
935 949
	}
936 950

  
937
	private void crearColorTable() {
938
		ArrayList color = (ArrayList) filterArguments.clone();
939
		setLastLegend(ColorTableListManager.createColorTableFromArray(color));
940
	}
941

  
942 951
	/* (non-Javadoc)
943 952
	 * @see com.iver.cit.gvsig.fmap.layers.FLayer#print(java.awt.Graphics2D, com.iver.cit.gvsig.fmap.ViewPort, com.iver.cit.gvsig.fmap.operations.Cancellable)
944 953
	 */

Also available in: Unified diff