70 |
70 |
import com.iver.andami.PluginServices;
|
71 |
71 |
import com.iver.cit.gvsig.fmap.core.FShape;
|
72 |
72 |
import com.iver.cit.gvsig.fmap.core.IGeometry;
|
|
73 |
import com.iver.cit.gvsig.fmap.core.SymbologyFactory;
|
|
74 |
import com.iver.cit.gvsig.fmap.core.symbols.ILineSymbol;
|
|
75 |
import com.iver.cit.gvsig.fmap.core.symbols.IMarkerSymbol;
|
|
76 |
import com.iver.cit.gvsig.fmap.core.symbols.ISymbol;
|
|
77 |
import com.iver.cit.gvsig.fmap.layers.GraphicLayer;
|
|
78 |
import com.iver.cit.gvsig.fmap.rendering.FGraphic;
|
73 |
79 |
import com.iver.cit.gvsig.project.documents.view.gui.View;
|
74 |
80 |
import com.iver.utiles.swing.JComboBox;
|
75 |
81 |
|
... | ... | |
98 |
104 |
private JRadioButton rButtomCutLine = null;
|
99 |
105 |
private JPanel panelCombo= null;
|
100 |
106 |
private View view= null;
|
101 |
|
|
|
107 |
private ArrayList cutLineRois = null;
|
102 |
108 |
/**
|
103 |
109 |
* Constructor
|
104 |
110 |
* param nameLayersAviable array con los nombres de las capas que intervendran
|
... | ... | |
267 |
273 |
getTableContainer().getTable().setEnabled(getCheckFeathering().isSelected() || getRButtomCutLine().isSelected());
|
268 |
274 |
updateUI();
|
269 |
275 |
}
|
|
276 |
|
|
277 |
if(e.getSource().equals(getRButtomCutLine())){
|
|
278 |
if(getRButtomCutLine().isSelected()){
|
|
279 |
drawRoi();
|
|
280 |
updateUI();
|
|
281 |
}
|
|
282 |
}
|
|
283 |
if(e.getSource().equals(getRButtomEdge())){
|
|
284 |
view.getMapControl().getMapContext().getGraphicsLayer().clearAllGraphics();
|
|
285 |
view.getMapControl().rePaintDirtyLayers();
|
|
286 |
}
|
|
287 |
|
|
288 |
|
270 |
289 |
}
|
271 |
290 |
|
272 |
291 |
|
... | ... | |
344 |
363 |
if(rButtomCutLine==null){
|
345 |
364 |
rButtomCutLine= new JRadioButton(PluginServices.getText(this,"cut_line_Feathering"));
|
346 |
365 |
rButtomCutLine.setEnabled(false);
|
|
366 |
rButtomCutLine.addActionListener(this);
|
347 |
367 |
}
|
348 |
368 |
return rButtomCutLine;
|
349 |
369 |
}
|
... | ... | |
357 |
377 |
if(rButtomEdge==null){
|
358 |
378 |
rButtomEdge= new JRadioButton(PluginServices.getText(this,"edge_Feathering"));
|
359 |
379 |
rButtomEdge.setEnabled(false);
|
|
380 |
rButtomEdge.addActionListener(this);
|
360 |
381 |
}
|
361 |
382 |
return rButtomEdge;
|
362 |
383 |
}
|
... | ... | |
383 |
404 |
|
384 |
405 |
// Borrado de todas las rois cargadas en la tabla
|
385 |
406 |
try {
|
386 |
|
getTableContainer().removeAllRows();
|
|
407 |
if(getTableContainer().getRowCount()>0)
|
|
408 |
getTableContainer().getTable().removeAllRows();
|
387 |
409 |
} catch (NotInitializeException e) {
|
388 |
410 |
RasterToolsUtil.messageBoxError("tabla_no_inicializada", this, e);
|
389 |
411 |
}
|
... | ... | |
393 |
415 |
IGeometry geometry=null;
|
394 |
416 |
boolean load= true;
|
395 |
417 |
int countGeometries= 0;
|
396 |
|
|
|
418 |
cutLineRois = new ArrayList();
|
397 |
419 |
for(int i=0; i<nameLayers.length; i++){
|
398 |
420 |
raster= (FLyrRasterSE)view.getMapControl().getMapContext().getLayers().getLayer(nameLayers[i]);
|
399 |
421 |
ArrayList roisArray = raster.getRois();
|
... | ... | |
411 |
433 |
case FShape.POLYGON:
|
412 |
434 |
load=false;
|
413 |
435 |
break;
|
414 |
|
}
|
|
436 |
}
|
415 |
437 |
if(load && countGeometries==1){
|
416 |
438 |
Object row [] = ((IModel)tableContainer.getTable().getTableModel()).getNewLine();
|
417 |
439 |
row[1]= roi.getName()+"-"+raster.getName(); row[0]= new Boolean(true);
|
418 |
440 |
tableContainer.getTable().addRow(row);
|
419 |
|
}
|
|
441 |
cutLineRois.add(roi);
|
|
442 |
}
|
420 |
443 |
load=true;
|
|
444 |
|
421 |
445 |
}
|
422 |
446 |
|
423 |
447 |
}
|
424 |
448 |
}
|
425 |
449 |
}
|
|
450 |
// drawRoi();
|
426 |
451 |
updateUI();
|
427 |
452 |
}
|
428 |
453 |
|
|
454 |
|
|
455 |
public void drawRoi(){
|
|
456 |
|
|
457 |
VectorialROI roi = null;
|
|
458 |
ISymbol symbol = null;
|
|
459 |
FGraphic fGraphic = null;
|
|
460 |
IGeometry geometry=null;
|
|
461 |
view.getMapControl().rePaintDirtyLayers();
|
|
462 |
GraphicLayer graphicLayer = view.getMapControl().getMapContext().getGraphicsLayer();
|
|
463 |
|
|
464 |
for (Iterator iter = cutLineRois.iterator(); iter.hasNext();) {
|
|
465 |
roi= (VectorialROI)iter.next();;
|
|
466 |
for (Iterator iterator = roi.getGeometries()
|
|
467 |
.iterator(); iterator.hasNext();) {
|
|
468 |
geometry = (IGeometry) iterator.next();
|
|
469 |
switch (geometry.getGeometryType()) {
|
|
470 |
case FShape.LINE:
|
|
471 |
symbol = SymbologyFactory.createDefaultLineSymbol();
|
|
472 |
((ILineSymbol) symbol).setLineColor(roi.getColor());
|
|
473 |
break;
|
|
474 |
}
|
|
475 |
fGraphic = new FGraphic(geometry, graphicLayer.addSymbol(symbol));
|
|
476 |
//graphicLayer.addGraphic(fGraphic);
|
|
477 |
|
|
478 |
view.getMapControl().getMapContext().getGraphicsLayer().addGraphic(fGraphic);
|
|
479 |
}
|
|
480 |
}
|
|
481 |
view.getMapControl().drawGraphics();
|
|
482 |
}
|
|
483 |
|
|
484 |
|
|
485 |
|
429 |
486 |
}
|