Revision 2300 org.gvsig.raster.mosaic/trunk/org.gvsig.raster.mosaic/org.gvsig.raster.mosaic.swing/org.gvsig.raster.mosaic.swing.impl/src/test/java/org/gvsig/raster/mosaic/TestAddFilesPanel.java
TestAddFilesPanel.java | ||
---|---|---|
7 | 7 |
import javax.swing.JFrame; |
8 | 8 |
|
9 | 9 |
import org.gvsig.fmap.dal.coverage.dataset.Buffer; |
10 |
import org.gvsig.fmap.dal.coverage.datastruct.NoData; |
|
10 | 11 |
import org.gvsig.raster.mosaic.swing.impl.main.AddFilesPanelImpl; |
11 | 12 |
import org.gvsig.raster.mosaic.swing.main.AddFilesEvent; |
12 | 13 |
import org.gvsig.raster.mosaic.swing.main.AddFilesListener; |
... | ... | |
24 | 25 |
list.add("ecw"); |
25 | 26 |
desc = new AddFilesPanelImpl("file", "/tmp", list); |
26 | 27 |
desc.addListener(this); |
27 |
double nodata = -99999.0;
|
|
28 |
NoData nodata = new NoDataImplement();
|
|
28 | 29 |
desc.addSrcFile(null, "capa 1", 3, Buffer.TYPE_BYTE, 0.5, nodata); |
29 | 30 |
desc.addSrcFile(null, "capa 2", 4, Buffer.TYPE_BYTE, 0.5, nodata); |
30 | 31 |
desc.addSrcFile(null, "capa 3", 5, Buffer.TYPE_BYTE, 0.5, nodata); |
... | ... | |
47 | 48 |
|
48 | 49 |
public void actionAddFiles(AddFilesEvent e) { |
49 | 50 |
File[] fList = e.getFileList(); |
50 |
double nodata = -99999.0;
|
|
51 |
NoData nodata = new NoDataImplement();
|
|
51 | 52 |
for (int i = 0; i < fList.length; i++) { |
52 | 53 |
desc.addDstFile(null, fList[i].toString(), 3, Buffer.TYPE_BYTE, 0.5, nodata); |
53 | 54 |
} |
... | ... | |
55 | 56 |
|
56 | 57 |
public void actionAddFolder(AddFilesEvent e) { |
57 | 58 |
File[] folderList = e.getFileList(); |
58 |
double nodata = -99999.0;
|
|
59 |
NoData nodata = new NoDataImplement();
|
|
59 | 60 |
for (int i = 0; i < folderList.length; i++) { |
60 | 61 |
desc.addDstFile(null, folderList[i].toString(), 3, Buffer.TYPE_BYTE, 0.5, nodata); |
61 | 62 |
} |
62 | 63 |
} |
64 |
|
|
65 |
public class NoDataImplement implements NoData { |
|
63 | 66 |
|
67 |
public Number getValue() { |
|
68 |
return -99999.0; |
|
69 |
} |
|
70 |
|
|
71 |
public void setValue(Number noData) { |
|
72 |
// TODO Auto-generated method stub |
|
73 |
|
|
74 |
} |
|
75 |
|
|
76 |
public boolean isDefined() { |
|
77 |
// TODO Auto-generated method stub |
|
78 |
return false; |
|
79 |
} |
|
80 |
|
|
81 |
public void save() { |
|
82 |
// TODO Auto-generated method stub |
|
83 |
|
|
84 |
} |
|
85 |
|
|
86 |
public void load() { |
|
87 |
// TODO Auto-generated method stub |
|
88 |
|
|
89 |
} |
|
90 |
|
|
91 |
public void delete() { |
|
92 |
// TODO Auto-generated method stub |
|
93 |
|
|
94 |
} |
|
95 |
|
|
96 |
public void restore() { |
|
97 |
// TODO Auto-generated method stub |
|
98 |
|
|
99 |
} |
|
100 |
|
|
101 |
public Number getNativeValue() { |
|
102 |
// TODO Auto-generated method stub |
|
103 |
return null; |
|
104 |
} |
|
105 |
|
|
106 |
public void setNativeValue(Number nativeNoDataValue) { |
|
107 |
// TODO Auto-generated method stub |
|
108 |
|
|
109 |
} |
|
110 |
|
|
111 |
public void setFileName(String fileName) { |
|
112 |
// TODO Auto-generated method stub |
|
113 |
|
|
114 |
} |
|
115 |
|
|
116 |
public boolean isNoDataTransparent() { |
|
117 |
// TODO Auto-generated method stub |
|
118 |
return false; |
|
119 |
} |
|
120 |
|
|
121 |
public void setNoDataTransparent(boolean noDataAsTransparent) { |
|
122 |
// TODO Auto-generated method stub |
|
123 |
|
|
124 |
} |
|
125 |
|
|
126 |
public int getDataType() { |
|
127 |
// TODO Auto-generated method stub |
|
128 |
return 0; |
|
129 |
} |
|
130 |
|
|
131 |
public void setDataType(int datatype) { |
|
132 |
// TODO Auto-generated method stub |
|
133 |
|
|
134 |
} |
|
135 |
|
|
136 |
public boolean compare(NoData noData) { |
|
137 |
return false; |
|
138 |
} |
|
139 |
|
|
140 |
public Number getValueByBand(int nBand) { |
|
141 |
return null; |
|
142 |
} |
|
143 |
|
|
144 |
public int getBandCount() { |
|
145 |
return 0; |
|
146 |
} |
|
147 |
|
|
148 |
public void setBandCount(int bandCount) { |
|
149 |
|
|
150 |
} |
|
151 |
|
|
152 |
public void setValueByBand(Number noDataValue, int nBand) { |
|
153 |
|
|
154 |
} |
|
155 |
|
|
156 |
public Object clone() { |
|
157 |
return null; |
|
158 |
} |
|
159 |
} |
|
160 |
|
|
64 | 161 |
} |
Also available in: Unified diff