Revision 2370

View differences:

org.gvsig.raster/branches/org.gvsig.raster_dataaccess_refactoring/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/RasterStoreProperties.java
150 150
	 */
151 151
	public ColorInterpretation getColorInterpretation();
152 152
	
153
	public void setColorInterpretation(ColorInterpretation ci);
154
	
153 155
	/**
154 156
	 * Gets the object with the metadata
155 157
	 * @return
org.gvsig.raster/branches/org.gvsig.raster_dataaccess_refactoring/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/AbstractRasterDataParameters.java
87 87
		.setMandatory(false)
88 88
		.setHidden(true);
89 89
		
90
		definition.addDynFieldObject(FIELD_CRS)
90
		/*definition.addDynFieldObject(FIELD_CRS)
91 91
		.setDescription("CRS")
92 92
		.setMandatory(false)
93
		.setHidden(true);
93
		.setHidden(true);*/
94 94
	}
95 95
	
96 96
	public void assignFields(RasterDataParameters par, RasterDataServerExplorer explorer) {
org.gvsig.raster/branches/org.gvsig.raster_dataaccess_refactoring/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/DataStoreColorInterpretation.java
138 138
	}
139 139
	
140 140
	public boolean hasInterpretation() {
141
		if(colorInterpretation == null || colorInterpretation.length < 3)
141
		if(colorInterpretation == null)
142 142
			return false;
143 143
		for (int i = 0; i < colorInterpretation.length; i++) {
144 144
			if(	colorInterpretation[i].equals(RED_BAND) || 
org.gvsig.raster/branches/org.gvsig.raster_dataaccess_refactoring/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/DefaultRasterStore.java
540 540
	public ColorInterpretation getColorInterpretation() {
541 541
		return provider.getColorInterpretation();
542 542
	}
543
	
544
	public void setColorInterpretation(ColorInterpretation ci) {
545
		provider.setColorInterpretation(ci);
546
	}
543 547

  
544 548
	public boolean isReproyectable() {
545 549
		if(provider != null)
org.gvsig.raster.multifile/branches/org.gvsig.raster.multifile_dataaccess_refactoring/org.gvsig.raster.multifile.app.multifileclient/src/main/java/org/gvsig/raster/multifile/app/panel/BandSelectorPropertiesListener.java
30 30
import org.gvsig.andami.PluginServices;
31 31
import org.gvsig.andami.ui.mdiManager.WindowInfo;
32 32
import org.gvsig.fmap.dal.DALLocator;
33
import org.gvsig.fmap.dal.coverage.RasterLibrary;
33 34
import org.gvsig.fmap.dal.coverage.RasterLocator;
34 35
import org.gvsig.fmap.dal.coverage.exception.InvalidSourceException;
35 36
import org.gvsig.fmap.dal.coverage.exception.RmfSerializerException;
......
111 112
		}
112 113

  
113 114
		if (e.getSource().equals(bandSetupPanel.getSaveButton())) {
114
			int rBand = bandSetupPanel.getColorInterpretationByColorBandBand(RasterDataStore.RED_BAND);
115
			int gBand = bandSetupPanel.getColorInterpretationByColorBandBand(RasterDataStore.GREEN_BAND);
116
			int bBand = bandSetupPanel.getColorInterpretationByColorBandBand(RasterDataStore.BLUE_BAND);
117
			int aBand = bandSetupPanel.getColorInterpretationByColorBandBand(RasterDataStore.ALPHA_BAND);
115
			int numBandToRed = bandSetupPanel.getColorInterpretationByColorBandBand(RasterDataStore.RED_BAND);
116
			int numBandToGreen = bandSetupPanel.getColorInterpretationByColorBandBand(RasterDataStore.GREEN_BAND);
117
			int numBandToBlue = bandSetupPanel.getColorInterpretationByColorBandBand(RasterDataStore.BLUE_BAND);
118
			int numBandToAlpha = bandSetupPanel.getColorInterpretationByColorBandBand(RasterDataStore.ALPHA_BAND);
118 119

  
119
			if (!isCorrectAssignedBand(rBand, gBand, bBand, aBand)) {
120
			if (!isCorrectAssignedBand(numBandToRed, numBandToGreen, numBandToBlue, numBandToAlpha)) {
120 121
				RasterSwingLibrary.messageBoxError(Messages.getText("combinacion_no_asignable"), bandSetupPanel);
121 122
				return;
122 123
			}
......
128 129
				return;
129 130
			}
130 131

  
131
			ColorInterpretation ci = dataSource.getColorInterpretation();
132
			//ColorInterpretation ci = dataSource.getColorInterpretation();
132 133
			try {
134
				String[] bands = new String[bandSetupPanel.getARGBTable().getRowCount()];
135
				ColorInterpretation ci = RasterLocator.getManager().getDataStructFactory().createColorInterpretation(bands);
136
				
133 137
				// Combinaci?n GRAY
134
				if ((rBand == gBand) && (rBand == bBand) && (rBand >= 0)) {
138
				if ((numBandToRed == numBandToGreen) && (numBandToRed == numBandToBlue) && (numBandToRed >= 0)) {
135 139
					for (int iBand = 0; iBand < bandSetupPanel.getARGBTable().getRowCount(); iBand++) {
136 140
						ci.setColorInterpValue(iBand, ColorInterpretation.UNDEF_BAND);
137 141
					}
138
					ci.setColorInterpValue(rBand, ColorInterpretation.GRAY_BAND);
139
					ci.setColorInterpValue(aBand, ColorInterpretation.ALPHA_BAND);
142
					ci.setColorInterpValue(0, ColorInterpretation.GRAY_BAND);
143
					ci.setColorInterpValue(numBandToAlpha, ColorInterpretation.ALPHA_BAND);
140 144
				} else {
141 145
					// Combinaci?n RGB
142 146
					for (int iBand = 0; iBand < bandSetupPanel.getARGBTable().getRowCount(); iBand++)
143 147
						ci.setColorInterpValue(iBand, bandSetupPanel.getColorInterpretationByBand(iBand));
144 148
				}
145 149
				String fileName = fLayer.getDataStore().getName();
150
				dataSource.setColorInterpretation(ci);
146 151
				RasterLocator.getManager().getProviderServices().saveObjectToRmfFile(fileName, ci);
147 152
			} catch (RmfSerializerException exc) {
148 153
				RasterSwingLibrary.messageBoxError(Messages.getText("error_salvando_rmf"), bandSetupPanel, exc);

Also available in: Unified diff