Revision 13571 trunk/extensions/extRasterTools-SE/src/org/gvsig/fmap/raster/layers/FLyrRasterSE.java

View differences:

FLyrRasterSE.java
57 57
import org.gvsig.raster.grid.GridTransparency;
58 58
import org.gvsig.raster.grid.filter.RasterFilterList;
59 59
import org.gvsig.raster.grid.filter.RasterFilterListManager;
60
import org.gvsig.raster.grid.filter.bands.ColorTableFilter;
60 61
import org.gvsig.raster.grid.filter.bands.ColorTableListManager;
61 62
import org.gvsig.raster.grid.filter.enhancement.EnhancementListManager;
62 63
import org.gvsig.raster.grid.render.Rendering;
......
276 277
				elm.addEnhancedFilter(false, stats, 0.0, getRender().getRenderBands());
277 278
			}
278 279
		}
279

  
280
		System.out.println("initFilters.....");
280 281
		getRender().setFilterList(filterList);
281 282
	}
282 283

  
......
1107 1108
		return this.getRender().existColorTable();
1108 1109
	}
1109 1110

  
1111
	ILegend lastLegend = null;
1110 1112
	/**
1113
	 * Define la ultima leyenda valida de la capa o se pone a null para que la
1114
	 * capa busque una leyenda valida.
1115
	 * @param ct
1116
	 */
1117
	public void setLastLegend(ColorTable ct) {
1118
		lastLegend = ColorTableLegend.createLegend(ct);
1119
	}
1120

  
1121
	/**
1111 1122
	 * Devuelve la Leyenda de la capa.
1112 1123
	 * @return Leyenda.
1113 1124
	 */
1114 1125
	public ILegend getLegend() {
1126
		if (lastLegend != null)
1127
			return lastLegend;
1128

  
1115 1129
		ColorTable ct = null;
1116

  
1117
		/*ColorTableFilter colorTableFilter = (ColorTableFilter) this.getRenderFilterList().getByName(ColorTableFilter.names[0]);
1130
		ColorTableFilter colorTableFilter = (ColorTableFilter) getRenderFilterList().getByName(ColorTableFilter.names[0]);
1118 1131
		if (colorTableFilter != null) {
1119 1132
			ColorTable ct2 = new GridPalette((ColorTable) colorTableFilter.getColorTable());
1120
			if (ct2.getColorItems() != null) {
1133
			if (ct2.getColorItems() != null)
1121 1134
				ct = ct2;
1122
			}
1123 1135
		}
1124 1136
		if (ct == null)
1125
			ct = this.getMultiRasterDataset().getColorTable(0);*/
1137
			ct = this.getDataSource().getColorTables()[0];
1126 1138

  
1127
		if (ct != null)
1128
			return ColorTableLegend.createLegend(ct);
1129
		return null;
1139
		return ColorTableLegend.createLegend(ct);
1130 1140
	}
1131 1141

  
1132 1142
	/*

Also available in: Unified diff