Revision 19831 trunk/extensions/extRemoteSensing/src/org/gvsig/remotesensing/profiles/listener/LineProfileOptionsListener.java
LineProfileOptionsListener.java | ||
---|---|---|
70 | 70 |
import org.gvsig.raster.grid.roi.ROI; |
71 | 71 |
import org.gvsig.remotesensing.profiles.gui.LineProfileOptionsPanel; |
72 | 72 |
|
73 |
import sun.rmi.runtime.GetThreadPoolAction; |
|
74 |
|
|
73 | 75 |
import com.iver.cit.gvsig.fmap.core.SymbologyFactory; |
74 | 76 |
import com.iver.cit.gvsig.fmap.core.symbols.ISymbol; |
75 | 77 |
import com.iver.cit.gvsig.fmap.layers.GraphicLayer; |
... | ... | |
157 | 159 |
} |
158 | 160 |
} |
159 | 161 |
} |
160 |
|
|
161 | 162 |
// Actualizacion del grafico |
162 | 163 |
optionsPanel.UpdateChart(); |
163 | 164 |
optionsPanel.getJPanelChart().setNewChart(series, names); |
... | ... | |
194 | 195 |
} |
195 | 196 |
|
196 | 197 |
public void valueChanged(ListSelectionEvent e) { |
197 |
// TODO Auto-generated method stub |
|
198 |
|
|
199 |
|
|
200 |
try { |
|
201 |
if(optionsPanel.getTable().getSelectedRow()!=-1){ |
|
202 |
|
|
203 |
ROI roi =(VectorialROI)optionsPanel.getROIs().get(optionsPanel.getTable().getSelectedRow()); |
|
204 |
String[] names = new String[1]; |
|
205 |
names[0]="Serie0"; |
|
206 |
roi.setBandToOperate(optionsPanel.getComboBands().getSelectedIndex()); |
|
207 |
int[][] series = new int[1][roi.getValues()]; |
|
208 |
int k=0; |
|
209 |
|
|
210 |
if(roi.getGrid().getDataType() == RasterBuffer.TYPE_BYTE){ |
|
211 |
for (int i = 0; i < roi.getNX(); i++){ |
|
212 |
for (int j = 0; j < roi.getNY(); j++){ |
|
213 |
series[0][k] = (int) roi.getCellValueAsByte(i,j); |
|
214 |
k++; |
|
215 |
} |
|
216 |
} |
|
217 |
} |
|
218 |
else if(roi.getGrid().getDataType() == RasterBuffer.TYPE_SHORT){ |
|
219 |
for (int i = 0; i < roi.getNX(); i++){ |
|
220 |
for (int j = 0; j < roi.getNY(); j++){ |
|
221 |
series[0][k] = (int) roi.getCellValueAsShort(i,j); |
|
222 |
k++; |
|
223 |
} |
|
224 |
} |
|
225 |
} |
|
226 |
else if(roi.getGrid().getDataType() == RasterBuffer.TYPE_INT){ |
|
227 |
for (int i = 0; i < roi.getNX(); i++){ |
|
228 |
for (int j = 0; j < roi.getNY(); j++){ |
|
229 |
series[0][k] = (int) roi.getCellValueAsInt(i,j); |
|
230 |
k++; |
|
231 |
} |
|
232 |
} |
|
233 |
} |
|
234 |
|
|
235 |
|
|
236 |
// Actualizacion del grafico |
|
237 |
optionsPanel.getJPanelChart().getChart().getChart().getXYPlot().getRenderer().setSeriesPaint(0, roi.getColor()); |
|
238 |
optionsPanel.getJPanelChart().setNewChart(series, names); |
|
239 |
optionsPanel.updateUI(); |
|
240 |
} |
|
241 |
|
|
242 |
} catch (GridException e1) { |
|
243 |
e1.printStackTrace(); |
|
244 |
} catch (NotInitializeException e3) { |
|
245 |
|
|
246 |
e3.printStackTrace(); |
|
247 |
} |
|
248 |
|
|
198 | 249 |
} |
199 | 250 |
|
200 | 251 |
public void actionButtonPressed(ButtonsPanelEvent e) { |
Also available in: Unified diff