42 |
42 |
|
43 |
43 |
import java.awt.BorderLayout;
|
44 |
44 |
import java.awt.Dimension;
|
|
45 |
import java.util.ArrayList;
|
|
46 |
import java.util.Iterator;
|
45 |
47 |
|
46 |
48 |
import javax.swing.JPanel;
|
47 |
49 |
import javax.swing.JTabbedPane;
|
... | ... | |
52 |
54 |
import org.gvsig.gui.beans.buttonspanel.ButtonsPanel;
|
53 |
55 |
import org.gvsig.gui.beans.defaultbuttonspanel.DefaultButtonsPanel;
|
54 |
56 |
import org.gvsig.gui.beans.graphic.GraphicChartPanel;
|
|
57 |
import org.gvsig.raster.grid.roi.ROI;
|
55 |
58 |
|
56 |
59 |
import com.iver.andami.PluginServices;
|
57 |
60 |
import com.iver.cit.gvsig.fmap.MapControl;
|
|
61 |
import com.iver.cit.gvsig.fmap.core.FShape;
|
|
62 |
import com.iver.cit.gvsig.fmap.core.IGeometry;
|
|
63 |
import com.iver.cit.gvsig.fmap.core.SymbologyFactory;
|
|
64 |
import com.iver.cit.gvsig.fmap.core.symbols.ILineSymbol;
|
|
65 |
import com.iver.cit.gvsig.fmap.core.symbols.ISymbol;
|
58 |
66 |
import com.iver.cit.gvsig.fmap.layers.GraphicLayer;
|
|
67 |
import com.iver.cit.gvsig.fmap.rendering.FGraphic;
|
59 |
68 |
|
60 |
69 |
/**
|
61 |
70 |
* Clase que define el panel donde aparece el grafico del perfil espectral de los puntos que seleccione el
|
... | ... | |
174 |
183 |
mapControl.rePaintDirtyLayers();
|
175 |
184 |
nextActiveChart = PANELLINEPROFILE;
|
176 |
185 |
|
177 |
|
// Hacer un pintado de todas las rois.
|
|
186 |
// Se pintan todas las rois que existan en la tabla
|
178 |
187 |
}
|
179 |
188 |
|
180 |
189 |
else if(nextActiveChart == PANELLINEPROFILE){
|
... | ... | |
191 |
200 |
roi.setBandToOperate(getLineOptionsPanel().getComboBands().getSelectedIndex());
|
192 |
201 |
getLineOptionsPanel().getTable().setSelectedIndex(0);
|
193 |
202 |
getLineOptionsPanel().getTable().updateUI();
|
|
203 |
|
|
204 |
// Se pintan las rois que existen en la tabla
|
|
205 |
ArrayList roisArray = getLineOptionsPanel().getROIs();
|
|
206 |
if (roisArray != null) {
|
|
207 |
ISymbol symbol = null;
|
|
208 |
FGraphic fGraphic = null;
|
|
209 |
|
|
210 |
for (Iterator iter = roisArray.iterator(); iter.hasNext();) {
|
|
211 |
ROI roiline = (ROI) iter.next();
|
|
212 |
VectorialROI vectorialROI = (VectorialROI) roiline;
|
|
213 |
for (Iterator iterator = vectorialROI.getGeometries()
|
|
214 |
.iterator(); iterator.hasNext();) {
|
|
215 |
IGeometry geometry = (IGeometry) iterator.next();
|
|
216 |
switch (geometry.getGeometryType()) {
|
|
217 |
case FShape.POINT:
|
|
218 |
break;
|
|
219 |
case FShape.POLYGON:
|
|
220 |
break;
|
|
221 |
case FShape.LINE:
|
|
222 |
symbol = SymbologyFactory.createDefaultLineSymbol();
|
|
223 |
((ILineSymbol) symbol).setLineColor(roiline.getColor());
|
|
224 |
break;
|
|
225 |
}
|
|
226 |
fGraphic = new FGraphic(geometry, graphicLayer
|
|
227 |
.addSymbol(symbol));
|
|
228 |
graphicLayer.addGraphic(fGraphic);
|
|
229 |
getLineOptionsPanel().getRoiGraphics(roiline.getName()).add(fGraphic);
|
|
230 |
}
|
|
231 |
|
|
232 |
}
|
|
233 |
getMapControl().drawGraphics();
|
|
234 |
}
|
194 |
235 |
|
195 |
236 |
|
196 |
237 |
} catch (Exception e1) {
|
197 |
238 |
// TODO: handle exception
|
198 |
239 |
}
|
199 |
240 |
|
200 |
|
graphicLayer.clearSymbolsGraphics();
|
201 |
|
mapControl.rePaintDirtyLayers();
|
202 |
241 |
nextActiveChart= PANELZPROFILE;
|
203 |
242 |
|
204 |
243 |
}
|