41 |
41 |
package org.gvsig.remotesensing.mosaic.gui;
|
42 |
42 |
|
43 |
43 |
import java.awt.BorderLayout;
|
44 |
|
import java.awt.Color;
|
45 |
44 |
import java.awt.Dimension;
|
46 |
|
import java.awt.FlowLayout;
|
47 |
45 |
import java.awt.GridBagConstraints;
|
48 |
46 |
import java.awt.GridBagLayout;
|
49 |
47 |
import java.awt.event.ActionEvent;
|
50 |
48 |
import java.awt.event.ActionListener;
|
|
49 |
import java.util.ArrayList;
|
|
50 |
import java.util.Iterator;
|
51 |
51 |
|
52 |
52 |
import javax.swing.BorderFactory;
|
53 |
53 |
import javax.swing.ButtonGroup;
|
... | ... | |
60 |
60 |
import javax.swing.border.EmptyBorder;
|
61 |
61 |
import javax.swing.border.TitledBorder;
|
62 |
62 |
|
|
63 |
import org.gvsig.fmap.raster.grid.roi.VectorialROI;
|
|
64 |
import org.gvsig.fmap.raster.layers.FLyrRasterSE;
|
63 |
65 |
import org.gvsig.gui.beans.table.TableContainer;
|
|
66 |
import org.gvsig.gui.beans.table.models.IModel;
|
64 |
67 |
|
65 |
68 |
import com.iver.andami.PluginServices;
|
|
69 |
import com.iver.cit.gvsig.fmap.core.FShape;
|
|
70 |
import com.iver.cit.gvsig.fmap.core.IGeometry;
|
|
71 |
import com.iver.cit.gvsig.fmap.layers.FLayers;
|
|
72 |
import com.iver.cit.gvsig.project.documents.view.gui.View;
|
66 |
73 |
import com.iver.utiles.swing.JComboBox;
|
67 |
74 |
|
68 |
75 |
/**
|
... | ... | |
89 |
96 |
private JRadioButton rButtomEdge = null;
|
90 |
97 |
private JRadioButton rButtomCutLine = null;
|
91 |
98 |
private JPanel panelCombo= null;
|
|
99 |
private View view= null;
|
92 |
100 |
|
93 |
101 |
/**
|
94 |
102 |
* Constructor
|
... | ... | |
96 |
104 |
* en el proceso de mosaico//setBorder(topBorder);
|
97 |
105 |
*
|
98 |
106 |
* */
|
99 |
|
public MethodMosaicPanel(String[] nameLayersAviable){
|
|
107 |
public MethodMosaicPanel(String[] nameLayersAviable, View view){
|
100 |
108 |
nameLayers=nameLayersAviable;
|
|
109 |
this.view = view;
|
101 |
110 |
initUI();
|
102 |
111 |
updateCombo();
|
|
112 |
|
103 |
113 |
}
|
104 |
114 |
|
105 |
115 |
/**
|
... | ... | |
118 |
128 |
}
|
119 |
129 |
|
120 |
130 |
|
|
131 |
/**Asignaci?n de la vista donde se encuentran cargadas las capas que conformacr?n el mosaico*/
|
|
132 |
public void setView(View view){
|
|
133 |
|
|
134 |
}
|
|
135 |
|
121 |
136 |
/**
|
122 |
137 |
* @return panel de histogram_matchig
|
123 |
138 |
* */
|
... | ... | |
313 |
328 |
tableContainer.getTable().getJTable().getColumnModel().getColumn(2).setMaxWidth(0);
|
314 |
329 |
tableContainer.setEnabled(false);
|
315 |
330 |
|
|
331 |
// Cargar las rois definidas en las capas seleccionadas para el mosaico
|
|
332 |
FLyrRasterSE raster=null;
|
|
333 |
VectorialROI roi= null;
|
|
334 |
IGeometry geometry=null;
|
|
335 |
boolean load= true;
|
|
336 |
int countGeometries= 0;
|
|
337 |
|
|
338 |
for(int i=0; i<nameLayers.length; i++){
|
|
339 |
raster= (FLyrRasterSE)view.getMapControl().getMapContext().getLayers().getLayer(nameLayers[i]);
|
|
340 |
ArrayList roisArray = raster.getRois();
|
|
341 |
if(roisArray!=null){
|
|
342 |
for (Iterator iter = roisArray.iterator(); iter.hasNext();) {
|
|
343 |
roi= (VectorialROI)iter.next();;
|
|
344 |
for (Iterator iterator = roi.getGeometries()
|
|
345 |
.iterator(); iterator.hasNext();) {
|
|
346 |
countGeometries=roi.getGeometries().size();
|
|
347 |
geometry = (IGeometry) iterator.next();
|
|
348 |
switch(geometry.getGeometryType()){
|
|
349 |
case FShape.POINT:
|
|
350 |
load= false;
|
|
351 |
break;
|
|
352 |
case FShape.POLYGON:
|
|
353 |
load=false;
|
|
354 |
break;
|
|
355 |
}
|
|
356 |
if(load && countGeometries==1){
|
|
357 |
Object row [] = ((IModel)tableContainer.getTable().getTableModel()).getNewLine();
|
|
358 |
row[1]= roi.getName(); row[0]= new Boolean(true);
|
|
359 |
tableContainer.getTable().addRow(row);
|
|
360 |
}
|
|
361 |
load=true;
|
|
362 |
|
|
363 |
}
|
|
364 |
|
|
365 |
}
|
|
366 |
}
|
|
367 |
}
|
316 |
368 |
}
|
317 |
369 |
return tableContainer;
|
318 |
370 |
}
|