Revision 31496 branches/v2_0_0_prep/applications/appgvSIG/src/org/gvsig/app/project/documents/view/toolListeners/InfoListener.java
InfoListener.java | ||
---|---|---|
132 | 132 |
|
133 | 133 |
Point2D pReal = mapCtrl.getMapContext().getViewPort().toMapPoint( |
134 | 134 |
event.getPoint()); |
135 |
Point imagePoint = new Point((int) event.getPoint().getX(), (int) event |
|
136 |
.getPoint().getY()); |
|
135 |
// Point imagePoint = new Point((int) event.getPoint().getX(), (int) event
|
|
136 |
// .getPoint().getY());
|
|
137 | 137 |
|
138 | 138 |
FInfoDialogXML dlgXML = new FInfoDialogXML(); |
139 | 139 |
int numLayersInfoable = 0; |
... | ... | |
143 | 143 |
final XMLItem[] items = new XMLItem[sel.length]; |
144 | 144 |
|
145 | 145 |
for (int i = 0; i < sel.length; i++) { |
146 |
FLayer laCapa = sel[i];
|
|
146 |
FLayer layer = sel[i];
|
|
147 | 147 |
|
148 |
if (laCapa instanceof FLyrVect)
|
|
148 |
if (layer instanceof FLyrVect)
|
|
149 | 149 |
{ |
150 |
FLyrVect lyrVect = (FLyrVect) laCapa;
|
|
150 |
FLyrVect layerVect = (FLyrVect) layer;
|
|
151 | 151 |
FeatureSet newSelection = null; |
152 | 152 |
// try { |
153 | 153 |
try { |
154 |
newSelection = lyrVect.queryByPoint(pReal, tol,lyrVect.getFeatureStore().getDefaultFeatureType());
|
|
154 |
newSelection = layerVect.queryByPoint(pReal, tol,layerVect.getFeatureStore().getDefaultFeatureType());
|
|
155 | 155 |
} catch (DataException e) { |
156 |
throw new BehaviorException(laCapa.getName(),e);
|
|
156 |
throw new BehaviorException(layer.getName(),e);
|
|
157 | 157 |
} |
158 |
items[i] = new VectorialXMLItem(newSelection, laCapa);
|
|
158 |
items[i] = new VectorialXMLItem(newSelection, layer);
|
|
159 | 159 |
numLayersInfoable++; |
160 | 160 |
// } catch (ReadException e) { |
161 | 161 |
// e.printStackTrace(); |
... | ... | |
163 | 163 |
// } |
164 | 164 |
|
165 | 165 |
} |
166 |
// TODO: PROVISIONAL PARA LA CAPA WMS
|
|
166 |
// T O D O: PROVISIONAL PARA LA CAPA WMS
|
|
167 | 167 |
/* |
168 | 168 |
else if (laCapa instanceof RasterOperations) { |
169 | 169 |
RasterOperations layer = (RasterOperations) laCapa; |
... | ... | |
224 | 224 |
} |
225 | 225 |
} |
226 | 226 |
*/ |
227 |
else if (laCapa instanceof InfoByPoint) { |
|
228 |
// TODO Hecho para el WMS. No deberia hacer falta
|
|
229 |
String text; |
|
230 |
try { |
|
231 |
InfoByPoint layer = (InfoByPoint) laCapa; |
|
227 |
// else if (laCapa instanceof InfoByPoint) {
|
|
228 |
// T O D O Hecho para el WMS. No deberia hacer falta
|
|
229 |
// String text;
|
|
230 |
// try {
|
|
231 |
// InfoByPoint layer = (InfoByPoint) laCapa;
|
|
232 | 232 |
// text = layer.getInfo(imagePoint, tol); |
233 | 233 |
// items[i] = new StringXMLItem(text); |
234 | 234 |
|
235 |
//TODO:jcarrasco Adapt this to the new infoByPoint
|
|
235 |
//T O D O:jcarrasco Adapt this to the new infoByPoint
|
|
236 | 236 |
// items[i] = layer.getInfo(imagePoint, tol, null)[0]; |
237 | 237 |
// numLayersInfoable++; |
238 | 238 |
// } catch (DataException e) { |
... | ... | |
241 | 241 |
// } catch (LoadLayerException e) { |
242 | 242 |
// throw new BehaviorException("No se pudo procesar la capa", |
243 | 243 |
// e); |
244 |
} finally {} |
|
245 |
} |
|
244 |
// } finally {}
|
|
245 |
// }
|
|
246 | 246 |
} |
247 | 247 |
|
248 | 248 |
if (numLayersInfoable > 0) { |
... | ... | |
308 | 308 |
*/ |
309 | 309 |
public void point2(PointEvent event) throws BehaviorException { |
310 | 310 |
|
311 |
Point imagePoint = new Point((int) event.getPoint().getX(), (int) event |
|
312 |
.getPoint().getY()); |
|
311 |
// Point imagePoint = new Point((int) event.getPoint().getX(), (int) event
|
|
312 |
// .getPoint().getY());
|
|
313 | 313 |
|
314 | 314 |
FInfoDialogXML dlgXML = new FInfoDialogXML(); |
315 | 315 |
int numLayersInfoable = 0; |
316 |
double tol = mapCtrl.getViewPort().toMapDistance(3); |
|
316 |
// double tol = mapCtrl.getViewPort().toMapDistance(3);
|
|
317 | 317 |
|
318 | 318 |
FLayer[] sel = mapCtrl.getMapContext().getLayers().getActives(); |
319 | 319 |
Vector itemsVector = new Vector(); |
Also available in: Unified diff