Revision 5753

View differences:

trunk/extensions/extGeoProcessing/src/com/iver/cit/gvsig/geoprocess/core/gui/AbstractGeoprocessPanel.java
45 45
*
46 46
* $Id$
47 47
* $Log$
48
* Revision 1.3  2006-06-02 18:21:28  azabala
48
* Revision 1.4  2006-06-08 18:22:02  azabala
49
* Arreglado pete cuando abr?amos un dialogo de geoprocessing habiendo agrupaciones en el TOC
50
*
51
* Revision 1.3  2006/06/02 18:21:28  azabala
49 52
* *** empty log message ***
50 53
*
51 54
* Revision 1.2  2006/05/25 08:21:14  jmvivo
......
81 84

  
82 85
import java.io.File;
83 86
import java.util.ArrayList;
87
import java.util.Arrays;
84 88

  
85 89
import javax.swing.JComboBox;
86 90
import javax.swing.JOptionPane;
......
120 124
		return layers;
121 125
	}
122 126
	
127
	protected FLyrVect[] getVectorialLayers(FLayers layers){
128
		FLyrVect[] solution = null;
129
		ArrayList list = new ArrayList();
130
		int numLayers = layers.getLayersCount();
131
		for(int i = 0; i < numLayers; i++){
132
			FLayer layer = layers.getLayer(i);
133
			if(layer instanceof FLyrVect)
134
				list.add(layer);
135
			else if(layer instanceof FLayers)
136
				list.addAll(Arrays.asList(getVectorialLayers((FLayers)layer)));
137
		}
138
		solution = new FLyrVect[list.size()];
139
		list.toArray(solution);
140
		return solution;
141
		
142
	}
143
	
123 144
	protected String[] getLayerNames() {
124 145
		String[] solution = null;
125 146
		int numLayers = layers.getLayersCount();
......
129 150
				FLayer layer = layers.getLayer(i);
130 151
				if(layer instanceof FLyrVect)
131 152
					list.add(layer.getName());
153
				if(layer instanceof FLayers){
154
					FLayers layers = (FLayers) layer;
155
					FLyrVect[] vectorials = getVectorialLayers(layers);
156
					for(int j = 0; j < vectorials.length; j++){
157
						list.add(vectorials[j].getName());
158
					}
159
				}
132 160
			}//for
133 161
			solution = new String[list.size()];
134 162
			list.toArray(solution);

Also available in: Unified diff