Revision 30187 branches/v2_0_0_prep/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/layers/FLayers.java

View differences:

FLayers.java
873 873
	 * (non-Javadoc)
874 874
	 * @see com.iver.cit.gvsig.fmap.layers.layerOperations.InfoByPoint#getInfo(java.awt.Point, double, com.iver.utiles.swing.threads.Cancellable)
875 875
	 */
876
	public XMLItem[] getInfo(Point p, double tolerance, Cancellable cancel) throws LoadLayerException, DataException {
876
//	public XMLItem[] getInfo(Point p, double tolerance, Cancellable cancel) throws LoadLayerException, DataException {
877
//		int i;
878
//		Vector items = new Vector();
879
//		FLayer layer;
880
//		XMLItem[] aux;
881
//		for (i = 0; i < this.layers.size(); i++){
882
//			layer = (FLayer)layers.get(i);
883
//			if (layer instanceof InfoByPoint){
884
//				InfoByPoint queryable_layer = (InfoByPoint) layer;
885
//				aux = queryable_layer.getInfo(p, tolerance, null);
886
//				if (!(queryable_layer instanceof FLayers)){
887
//					for(int j = 0; j < aux.length; j++){
888
//						items.add(aux[j]);
889
//					}
890
//				}
891
//			}
892
//		}
893
//		return (XMLItem[])items.toArray(new XMLItem[0]);
894
//
895
//	}
896
	public Iterator getInfo(Point p, double tolerance,
897
			Cancellable cancel) throws LoadLayerException, DataException {
877 898
		int i;
878
		Vector items = new Vector();
879 899
		FLayer layer;
880
		XMLItem[] aux;
900
		ArrayList res = new ArrayList();
881 901
		for (i = 0; i < this.layers.size(); i++){
882 902
			layer = (FLayer)layers.get(i);
883 903
			if (layer instanceof InfoByPoint){
884 904
				InfoByPoint queryable_layer = (InfoByPoint) layer;
885
				aux = queryable_layer.getInfo(p, tolerance, null);
886
				if (!(queryable_layer instanceof FLayers)){
887
					for(int j = 0; j < aux.length; j++){
888
						items.add(aux[j]);
889
					}
890
				}
905
				Iterator it = queryable_layer.getInfo(p, tolerance, null);
906
				// Please be careful we add iterators, not the Dynobjects
907
				// we don't make the list flat so trees are supported
908
				res.add(it);
891 909
			}
892 910
		}
893
		return (XMLItem[])items.toArray(new XMLItem[0]);
894

  
911
		return res.iterator();
912
		
895 913
	}
896

  
914
	
915
	
897 916
	/*
898 917
	 * (non-Javadoc)
899 918
	 * @see com.iver.cit.gvsig.fmap.layers.FLyrDefault#getTocImageIcon()

Also available in: Unified diff