Revision 4253
branches/v05/extensions/extWMS/src/com/iver/cit/gvsig/fmap/layers/FLyrWMS.java | ||
---|---|---|
50 | 50 |
import java.awt.geom.Point2D; |
51 | 51 |
import java.awt.geom.Rectangle2D; |
52 | 52 |
import java.awt.image.BufferedImage; |
53 |
import java.awt.image.DataBuffer; |
|
53 | 54 |
import java.io.File; |
54 | 55 |
import java.io.IOException; |
55 | 56 |
import java.lang.reflect.Constructor; |
... | ... | |
144 | 145 |
*/ |
145 | 146 |
private int width = 0, height = 0; |
146 | 147 |
private double minX = 0D, minY = 0D, maxX = 0D, maxY = 0D; |
148 |
private int bandCount = 0; |
|
149 |
private int dataType = DataBuffer.TYPE_UNDEFINED; |
|
147 | 150 |
} |
148 | 151 |
|
149 | 152 |
|
... | ... | |
663 | 666 |
if(this.stackManager != null) |
664 | 667 |
raster.setStackManager(this.stackManager); |
665 | 668 |
|
669 |
if(visualStatus != null){ |
|
670 |
visualStatus.bandCount = raster.getBandCount(); |
|
671 |
visualStatus.dataType = raster.getDataType(); |
|
672 |
} |
|
673 |
|
|
666 | 674 |
raster.draw(g, vpData); |
667 | 675 |
|
668 | 676 |
//En el primer pxRaster de una imagen obtenemos el Stack Manager para poder modificarlo |
... | ... | |
899 | 907 |
public ArrayList getAttributes() { |
900 | 908 |
if(rasterFile != null){ |
901 | 909 |
ArrayList attr = new ArrayList(); |
902 |
/* String dataType = "Byte";
|
|
910 |
String dataType = "Byte"; |
|
903 | 911 |
if (rasterFile.getDataType() == DataBuffer.TYPE_BYTE) dataType = "Byte"; |
904 |
else if (rasterFile.getDataType() == DataBuffer.TYPE_SHORT)
|
|
912 |
else if (visualStatus.dataType == DataBuffer.TYPE_SHORT)
|
|
905 | 913 |
dataType = "Short"; |
906 |
else if (rasterFile.getDataType() == DataBuffer.TYPE_USHORT)
|
|
914 |
else if (visualStatus.dataType == DataBuffer.TYPE_USHORT)
|
|
907 | 915 |
dataType = "Unsigned Short"; |
908 |
else if (rasterFile.getDataType() == DataBuffer.TYPE_INT)
|
|
916 |
else if (visualStatus.dataType == DataBuffer.TYPE_INT)
|
|
909 | 917 |
dataType = "Integer"; |
910 |
else if (rasterFile.getDataType() == DataBuffer.TYPE_FLOAT)
|
|
918 |
else if (visualStatus.dataType == DataBuffer.TYPE_FLOAT)
|
|
911 | 919 |
dataType = "Float"; |
912 |
else if (rasterFile.getDataType() == DataBuffer.TYPE_DOUBLE)
|
|
920 |
else if (visualStatus.dataType == DataBuffer.TYPE_DOUBLE)
|
|
913 | 921 |
dataType = "Double"; |
914 | 922 |
else |
915 | 923 |
dataType = "Unknown"; |
916 |
*/ |
|
924 |
|
|
917 | 925 |
Object [][] a = { |
918 | 926 |
{"Filename",rasterFile.getName().substring(rasterFile.getName().lastIndexOf("/")+1, rasterFile.getName().length())}, |
919 |
{"Filesize",new Long(rasterFile.getFileSize())},
|
|
920 |
{"Width",new Integer(rasterFile.getWidth())},
|
|
921 |
{"Height", new Integer(rasterFile.getHeight())},
|
|
922 |
{"Bands", new Integer(rasterFile.getBandCount())}
|
|
923 |
//{"BandDataType", dataType}
|
|
927 |
{"Filesize",new Long(0)},
|
|
928 |
{"Width",new Integer((int)this.getWidth())},
|
|
929 |
{"Height", new Integer((int)this.getHeight())},
|
|
930 |
{"Bands", new Integer(visualStatus.bandCount)},
|
|
931 |
{"BandDataType", dataType} |
|
924 | 932 |
}; |
925 |
for (int i=0; i<a.length; i++){ |
|
926 |
System.out.println("===> "+a[i][0]+" "+a[i][1]); |
|
933 |
for (int i=0; i<a.length; i++) |
|
927 | 934 |
attr.add(a[i]); |
928 |
} |
|
935 |
|
|
929 | 936 |
return attr; |
930 | 937 |
} |
931 | 938 |
return null; |
Also available in: Unified diff