Revision 11180
trunk/extensions/extRasterTools-SE/src/org/gvsig/rastertools/properties/dialog/ButtonsPanel.java | ||
---|---|---|
18 | 18 |
*/ |
19 | 19 |
package org.gvsig.rastertools.properties.dialog; |
20 | 20 |
|
21 |
import javax.swing.JPanel; |
|
22 |
import javax.swing.JButton; |
|
23 | 21 |
import java.awt.FlowLayout; |
24 | 22 |
|
23 |
import javax.swing.JButton; |
|
24 |
import javax.swing.JPanel; |
|
25 |
|
|
25 | 26 |
/** |
26 | 27 |
* Panel con los controles de bot?n de aplicar, aceptar y cancelar. |
27 | 28 |
* |
trunk/extensions/extRasterTools-SE/src/org/gvsig/rastertools/properties/panels/BandSetupFileList.java | ||
---|---|---|
25 | 25 |
|
26 | 26 |
import java.awt.BorderLayout; |
27 | 27 |
import java.awt.FlowLayout; |
28 |
|
|
29 | 28 |
import java.util.Vector; |
30 | 29 |
|
31 | 30 |
import javax.swing.JButton; |
trunk/extensions/extRasterTools-SE/src/org/gvsig/rastertools/histogram/ui/HistogramPanel.java | ||
---|---|---|
37 | 37 |
import org.gvsig.gui.beans.graphic.GraphicContainer; |
38 | 38 |
import org.gvsig.gui.beans.table.TableContainer; |
39 | 39 |
import org.gvsig.gui.beans.table.exceptions.NotInitializeException; |
40 |
import org.gvsig.raster.RasterLibrary; |
|
40 | 41 |
import org.gvsig.raster.util.Histogram; |
41 | 42 |
import org.gvsig.raster.util.IHistogramable; |
42 |
import org.gvsig.raster.util.RasterUtilities; |
|
43 | 43 |
import org.gvsig.rastertools.histogram.HistogramPanelListener; |
44 | 44 |
/** |
45 | 45 |
* <code>HistogramPanel</code>. Interfaz de usuario para la representaci?n de |
... | ... | |
370 | 370 |
currentValues[1] = getGraphicContainer().getX1(); |
371 | 371 |
switch (dataType){ |
372 | 372 |
case RasterBuf.TYPE_BYTE: |
373 |
v[0] = (currentValues[0] * RasterUtilities.MAX_BYTE_BIT_VALUE) / 100;
|
|
374 |
v[1] = (currentValues[1] * RasterUtilities.MAX_BYTE_BIT_VALUE) / 100;
|
|
373 |
v[0] = (currentValues[0] * 255) / 100;
|
|
374 |
v[1] = (currentValues[1] * 255) / 100;
|
|
375 | 375 |
break; |
376 |
case RasterBuf.TYPE_SHORT:
|
|
377 |
v[0] = (currentValues[0] * RasterUtilities.MAX_SHORT_BIT_VALUE) / 100;
|
|
378 |
v[1] = (currentValues[1] * RasterUtilities.MAX_SHORT_BIT_VALUE) / 100;
|
|
376 |
default:
|
|
377 |
v[0] = (currentValues[0] * RasterLibrary.defaultNumberOfClasses) / 100;
|
|
378 |
v[1] = (currentValues[1] * RasterLibrary.defaultNumberOfClasses) / 100;
|
|
379 | 379 |
break; |
380 |
case RasterBuf.TYPE_FLOAT: |
|
381 |
case RasterBuf.TYPE_DOUBLE: |
|
382 |
v[0] = (currentValues[0] * 63) / 100; |
|
383 |
v[1] = (currentValues[1] * 63) / 100; |
|
384 |
break; |
|
385 | 380 |
} |
386 | 381 |
return v; |
387 | 382 |
} |
trunk/extensions/extRasterTools-SE/src/org/gvsig/rastertools/histogram/HistogramPanelListener.java | ||
---|---|---|
19 | 19 |
package org.gvsig.rastertools.histogram; |
20 | 20 |
|
21 | 21 |
import java.awt.Color; |
22 |
import java.awt.Component; |
|
22 | 23 |
import java.awt.event.ActionEvent; |
23 | 24 |
import java.awt.event.ActionListener; |
24 | 25 |
import java.beans.PropertyChangeEvent; |
... | ... | |
26 | 27 |
import java.io.File; |
27 | 28 |
import java.io.IOException; |
28 | 29 |
import java.io.RandomAccessFile; |
30 |
import java.nio.channels.FileChannel; |
|
29 | 31 |
import java.nio.channels.WritableByteChannel; |
30 | 32 |
import java.util.ArrayList; |
31 | 33 |
|
34 |
import javax.swing.JButton; |
|
32 | 35 |
import javax.swing.JComboBox; |
36 |
import javax.swing.JFileChooser; |
|
37 |
import javax.swing.JOptionPane; |
|
33 | 38 |
import javax.swing.table.DefaultTableModel; |
34 | 39 |
|
35 | 40 |
import org.gvsig.gui.beans.graphic.GraphicEvent; |
... | ... | |
39 | 44 |
import org.gvsig.raster.util.HistogramClass; |
40 | 45 |
import org.gvsig.raster.util.IHistogramable; |
41 | 46 |
import org.gvsig.rastertools.histogram.ui.HistogramPanel; |
47 |
|
|
48 |
import com.hardcode.driverManager.DriverLoadException; |
|
49 |
import com.hardcode.gdbms.driver.exceptions.ReadDriverException; |
|
50 |
import com.hardcode.gdbms.engine.data.DataSource; |
|
51 |
import com.hardcode.gdbms.engine.data.DataSourceFactory; |
|
52 |
import com.hardcode.gdbms.engine.data.NoSuchTableException; |
|
53 |
import com.hardcode.gdbms.engine.values.Value; |
|
54 |
import com.hardcode.gdbms.engine.values.ValueFactory; |
|
55 |
import com.iver.andami.PluginServices; |
|
56 |
import com.iver.cit.gvsig.ProjectExtension; |
|
57 |
import com.iver.cit.gvsig.fmap.drivers.shp.DbaseFileHeaderNIO; |
|
58 |
import com.iver.cit.gvsig.fmap.drivers.shp.DbaseFileWriterNIO; |
|
59 |
import com.iver.cit.gvsig.fmap.edition.EditableAdapter; |
|
60 |
import com.iver.cit.gvsig.fmap.layers.LayerFactory; |
|
61 |
import com.iver.cit.gvsig.fmap.layers.SelectableDataSource; |
|
62 |
import com.iver.cit.gvsig.project.ProjectFactory; |
|
63 |
import com.iver.cit.gvsig.project.documents.table.ProjectTable; |
|
64 |
import com.iver.cit.gvsig.project.documents.table.gui.Table; |
|
42 | 65 |
/** |
43 | 66 |
* Listener para eventos del panel de histograma |
44 | 67 |
* |
... | ... | |
121 | 144 |
|
122 | 145 |
//-------------------------------------- |
123 | 146 |
// Boton Crear Tabla |
124 |
/* |
|
147 |
|
|
125 | 148 |
JButton table = getHistogramPanel().getBCreateTable(); |
126 | 149 |
if (e.getSource() == table) { |
127 | 150 |
try { |
... | ... | |
142 | 165 |
DbaseFileHeaderNIO myHeader; |
143 | 166 |
Value[] record; |
144 | 167 |
|
145 |
long histogram[][]= getLastHistogram().getHistogram();
|
|
168 |
HistogramClass[][] histogram = getLastHistogram().getHistogram();
|
|
146 | 169 |
int numBands = histogram.length; |
147 | 170 |
int numRecors = histogram[0].length; |
148 | 171 |
|
... | ... | |
170 | 193 |
for (int j = 0; j < numRecors; j++) { |
171 | 194 |
record[0] = ValueFactory.createValue(j); |
172 | 195 |
for (int r = 0; r < numBands; r++) { |
173 |
record[r+1] = ValueFactory.createValue(histogram[r][j]); |
|
196 |
record[r+1] = ValueFactory.createValue(histogram[r][j].getValue());
|
|
174 | 197 |
} |
175 | 198 |
|
176 | 199 |
dbfWrite.write(record); |
... | ... | |
207 | 230 |
JOptionPane.showMessageDialog((Component)PluginServices.getMainFrame(),getHistogramPanel().getName() + " " + PluginServices.getText(this,"table_not_create")); |
208 | 231 |
} |
209 | 232 |
} |
210 |
*/ |
|
233 |
|
|
211 | 234 |
} |
212 | 235 |
|
213 | 236 |
/** |
... | ... | |
258 | 281 |
for (int iBand=0; iBand < histogramClass.length; iBand++) { |
259 | 282 |
for (int i=0; i<histogramClass[iBand].length; i++) { |
260 | 283 |
datos[iBand][i][0] = histogramClass[iBand][i].getMin(); |
261 |
datos[iBand][i][1] = histogramClass[iBand][i].getNPixels();
|
|
284 |
datos[iBand][i][1] = histogramClass[iBand][i].getValue();
|
|
262 | 285 |
} |
263 | 286 |
} |
264 | 287 |
|
Also available in: Unified diff