gvsig-raster / org.gvsig.raster.georeferencing / trunk / org.gvsig.raster.georeferencing / org.gvsig.raster.georeferencing.swing / org.gvsig.raster.georeferencing.swing.impl / src / main / java / org / gvsig / raster / georeferencing / swing / impl / view / synchronize / GCPSynchronizationImpl.java @ 1717
History | View | Annotate | Download (16.5 KB)
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2007 IVER T.I. and Generalitat Valenciana.
|
4 |
*
|
5 |
* This program is free software; you can redistribute it and/or
|
6 |
* modify it under the terms of the GNU General Public License
|
7 |
* as published by the Free Software Foundation; either version 2
|
8 |
* of the License, or (at your option) any later version.
|
9 |
*
|
10 |
* This program is distributed in the hope that it will be useful,
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
* GNU General Public License for more details.
|
14 |
*
|
15 |
* You should have received a copy of the GNU General Public License
|
16 |
* along with this program; if not, write to the Free Software
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
18 |
*/
|
19 |
package org.gvsig.raster.georeferencing.swing.impl.view.synchronize; |
20 |
|
21 |
import java.awt.geom.Point2D; |
22 |
import java.util.List; |
23 |
|
24 |
import org.gvsig.fmap.dal.coverage.RasterLocator; |
25 |
import org.gvsig.fmap.dal.coverage.datastruct.GeoPoint; |
26 |
import org.gvsig.fmap.dal.coverage.datastruct.GeoPointList; |
27 |
import org.gvsig.gui.beans.table.exceptions.NotInitializeException; |
28 |
import org.gvsig.raster.georeferencing.swing.impl.layer.GCPsGraphicLayer; |
29 |
import org.gvsig.raster.georeferencing.swing.impl.layer.GPGraphic; |
30 |
import org.gvsig.raster.georeferencing.swing.impl.tool.PanTool; |
31 |
import org.gvsig.raster.georeferencing.swing.impl.tool.SelectPointTool; |
32 |
import org.gvsig.raster.georeferencing.swing.impl.tool.ZoomRectangleTool; |
33 |
import org.gvsig.raster.georeferencing.swing.impl.view.ViewPanelImpl; |
34 |
import org.gvsig.raster.georeferencing.swing.impl.view.ZoomPanelImpl; |
35 |
import org.gvsig.raster.georeferencing.swing.view.GeoreferencingView; |
36 |
import org.gvsig.raster.georeferencing.swing.view.IGraphicLayer; |
37 |
import org.gvsig.raster.georeferencing.swing.view.IViewRequestManager; |
38 |
import org.gvsig.raster.georeferencing.swing.view.ToolListener; |
39 |
import org.gvsig.raster.swing.pagedtable.PagedTable; |
40 |
|
41 |
/**
|
42 |
* Clase para realizar operaciones y mantener la sincronizaci?n entre las
|
43 |
* capas de puntos de las dos vistas y las dos ventanas de zoom.
|
44 |
*
|
45 |
* 04/02/2008
|
46 |
* @author Nacho Brodin (nachobrodin@gmail.com)
|
47 |
*/
|
48 |
public class GCPSynchronizationImpl { |
49 |
private ToolListener toolListener = null; |
50 |
//Vistas
|
51 |
private ViewPanelImpl viewRaster = null; |
52 |
private ViewPanelImpl viewMap = null; |
53 |
private ZoomPanelImpl zoomMap = null; |
54 |
private ZoomPanelImpl zoomRaster = null; |
55 |
|
56 |
//Capas de puntos
|
57 |
private GCPsGraphicLayer viewRasterGCPs = null; |
58 |
private GCPsGraphicLayer viewMapGCPs = null; |
59 |
private GCPsGraphicLayer viewRasterGCPsZoom = null; |
60 |
private GCPsGraphicLayer viewMapGCPsZoom = null; |
61 |
|
62 |
//Gestores de peticiones
|
63 |
private IViewRequestManager viewRasterRequestManager = null; |
64 |
private IViewRequestManager viewMapRequestManager = null; |
65 |
private IViewRequestManager zoomRasterRequestManager = null; |
66 |
private IViewRequestManager zoomMapRequestManager = null; |
67 |
|
68 |
//Herramientas de selecci?n
|
69 |
private SelectPointTool viewRasterSelectPointTool = null; |
70 |
private SelectPointTool viewMapSelectPointTool = null; |
71 |
private SelectPointTool zoomRasterSelectPointTool = null; |
72 |
private SelectPointTool zoomMapSelectPointTool = null; |
73 |
private PagedTable table = null; |
74 |
private GeoPointList geoPointList = null; |
75 |
|
76 |
public GCPSynchronizationImpl(GeoPointList gpList, ToolListener listener) {
|
77 |
this.toolListener = listener;
|
78 |
this.geoPointList = gpList;
|
79 |
} |
80 |
|
81 |
/**
|
82 |
* Asigna las vistas
|
83 |
* @param vRaster
|
84 |
* @param vMap
|
85 |
* @param zRaster
|
86 |
* @param zMap
|
87 |
*/
|
88 |
public void setViews( |
89 |
GeoreferencingView vRaster, |
90 |
GeoreferencingView vMap, |
91 |
GeoreferencingView zRaster, |
92 |
GeoreferencingView zMap, |
93 |
PagedTable table) { |
94 |
this.table = table;
|
95 |
viewRaster = (ViewPanelImpl)vRaster; |
96 |
viewMap = (ViewPanelImpl)vMap; |
97 |
zoomMap = (ZoomPanelImpl)zMap; |
98 |
zoomRaster = (ZoomPanelImpl)zRaster; |
99 |
if(zoomRaster != null) |
100 |
zoomRasterSelectPointTool = new SelectPointTool(zoomRaster.getCanvas(), toolListener);
|
101 |
if(zoomMap != null) |
102 |
zoomMapSelectPointTool = new SelectPointTool(zoomMap.getCanvas(), toolListener);
|
103 |
if(viewRaster != null) |
104 |
viewRasterSelectPointTool = new SelectPointTool(viewRaster.getCanvas(), toolListener);
|
105 |
if(viewMap != null) |
106 |
viewMapSelectPointTool = new SelectPointTool(viewMap.getCanvas(), toolListener);
|
107 |
createGCPLayers(); |
108 |
registerPointToolListener(); |
109 |
} |
110 |
|
111 |
/**
|
112 |
* Asigna los gestores de peticiones.
|
113 |
* @param vRaster
|
114 |
* @param vMap
|
115 |
* @param zRaster
|
116 |
* @param zMap
|
117 |
*/
|
118 |
public void setRequestsManager( |
119 |
IViewRequestManager vRaster, |
120 |
IViewRequestManager vMap, |
121 |
IViewRequestManager zRaster, |
122 |
IViewRequestManager zMap) { |
123 |
viewRasterRequestManager = vRaster; |
124 |
viewMapRequestManager= vMap; |
125 |
zoomRasterRequestManager = zRaster; |
126 |
zoomMapRequestManager = zMap; |
127 |
} |
128 |
|
129 |
/**
|
130 |
* Asigna las capas de puntos
|
131 |
* @param vRaster
|
132 |
* @param vMap
|
133 |
* @param zRaster
|
134 |
* @param zMap
|
135 |
*/
|
136 |
public void setLayerPoints( |
137 |
IGraphicLayer vRaster, |
138 |
IGraphicLayer vMap, |
139 |
IGraphicLayer zRaster, |
140 |
IGraphicLayer zMap) { |
141 |
viewRasterGCPs = (GCPsGraphicLayer)vRaster; |
142 |
viewMapGCPs = (GCPsGraphicLayer)vMap; |
143 |
viewRasterGCPsZoom = (GCPsGraphicLayer)zRaster; |
144 |
viewMapGCPsZoom = (GCPsGraphicLayer)zMap; |
145 |
} |
146 |
|
147 |
/**
|
148 |
* Activa o desactiva la capa de puntos
|
149 |
* @param active
|
150 |
*/
|
151 |
public void setActiveLayerZoomCursor(boolean active) { |
152 |
if(viewRaster != null && viewRaster.getZoomCursorGraphicLayer() != null) |
153 |
viewRaster.getZoomCursorGraphicLayer().setActive(active); |
154 |
if(viewMap != null && viewMap.getZoomCursorGraphicLayer() != null) |
155 |
viewMap.getZoomCursorGraphicLayer().setActive(active); |
156 |
} |
157 |
|
158 |
/**
|
159 |
* Recalcula las coordenadas de dibujado de los puntos de control
|
160 |
* y redibuja estos en todas las vistas
|
161 |
*/
|
162 |
public void redrawPoints() { |
163 |
if(viewMapGCPs != null) |
164 |
viewMapGCPs.recalcMapDrawCoordinates(); |
165 |
if(viewRasterGCPs != null) |
166 |
viewRasterGCPs.recalcPixelDrawCoordinates(); |
167 |
if(viewMapGCPsZoom != null) |
168 |
viewMapGCPsZoom.recalcMapDrawCoordinates(); |
169 |
if(viewRasterGCPsZoom != null) |
170 |
viewRasterGCPsZoom.recalcPixelDrawCoordinates(); |
171 |
repaint(); |
172 |
} |
173 |
|
174 |
/**
|
175 |
* Redibuja el canvas de todas las vistas
|
176 |
*/
|
177 |
private void repaint() { |
178 |
if(viewRaster != null) |
179 |
viewRaster.getCanvas().repaint(); |
180 |
if(viewMap != null) |
181 |
viewMap.getCanvas().repaint(); |
182 |
if(zoomMap != null) |
183 |
zoomMap.getCanvas().repaint(); |
184 |
if(zoomRaster != null) |
185 |
zoomRaster.getCanvas().repaint(); |
186 |
} |
187 |
|
188 |
/**
|
189 |
* Registra el listener para la herramienta de selecci?n de puntos de control
|
190 |
*/
|
191 |
public void registerPointToolListener() { |
192 |
if(zoomMap != null) { |
193 |
zoomMapSelectPointTool.setActive(false);
|
194 |
zoomMap.getControl().addTool(zoomMapSelectPointTool); |
195 |
zoomMap.getControl().registerToolListener(ZoomRectangleTool.class, toolListener); |
196 |
zoomMap.getControl().registerToolListener(PanTool.class, toolListener); |
197 |
} |
198 |
if(zoomRaster != null) { |
199 |
zoomRasterSelectPointTool.setActive(false);
|
200 |
zoomRaster.getControl().addTool(zoomRasterSelectPointTool); |
201 |
zoomRaster.getControl().registerToolListener(ZoomRectangleTool.class, toolListener); |
202 |
zoomRaster.getControl().registerToolListener(PanTool.class, toolListener); |
203 |
} |
204 |
if(viewRaster != null) { |
205 |
viewRasterSelectPointTool.setActive(false);
|
206 |
viewRaster.getControl().addTool(viewRasterSelectPointTool); |
207 |
viewRaster.getControl().registerToolListener(ZoomRectangleTool.class, toolListener); |
208 |
viewRaster.getControl().registerToolListener(PanTool.class, toolListener); |
209 |
} |
210 |
if(viewMap != null) { |
211 |
viewMapSelectPointTool.setActive(false);
|
212 |
viewMap.getControl().addTool(viewMapSelectPointTool); |
213 |
viewMap.getControl().registerToolListener(ZoomRectangleTool.class, toolListener); |
214 |
viewMap.getControl().registerToolListener(PanTool.class, toolListener); |
215 |
} |
216 |
} |
217 |
|
218 |
/**
|
219 |
* A?ade un punto a las capas gr?ficas
|
220 |
* @param map Coordenadas del mapa del punto
|
221 |
* @param raster Coordenadas pixel del punto
|
222 |
* @return identificador del punto a?adido
|
223 |
*/
|
224 |
public long addPoint(Point2D map, Point2D raster) { |
225 |
GeoPoint gp = RasterLocator.getManager().getDataStructFactory().createGeoPoint(raster, map); |
226 |
long id = System.currentTimeMillis(); |
227 |
|
228 |
//Esperamos al menos 5 ms para que la carga de los puntos no sea
|
229 |
//tan r?pida que coincida el id de dos puntos
|
230 |
try {
|
231 |
Thread.sleep(80); |
232 |
} catch (InterruptedException e) { |
233 |
} |
234 |
if(viewRasterGCPs != null) |
235 |
viewRasterGCPs.addPixelGeoPoint(gp, id); |
236 |
if(viewMapGCPs != null) |
237 |
viewMapGCPs.addMapGeoPoint(gp, id); |
238 |
if(viewRasterGCPsZoom != null) |
239 |
viewRasterGCPsZoom.addPixelGeoPoint(gp, id); |
240 |
if(viewMapGCPsZoom != null) |
241 |
viewMapGCPsZoom.addMapGeoPoint(gp, id); |
242 |
return id;
|
243 |
} |
244 |
|
245 |
/**
|
246 |
* Elimina todos los puntos gr?ficos de las capas
|
247 |
*
|
248 |
*/
|
249 |
public void removeAllPoints() { |
250 |
if(viewRasterGCPs != null) |
251 |
viewRasterGCPs.removeAllPoints(); |
252 |
if(viewMapGCPs != null) |
253 |
viewMapGCPs.removeAllPoints(); |
254 |
if(viewRasterGCPsZoom != null) |
255 |
viewRasterGCPsZoom.removeAllPoints(); |
256 |
if(viewMapGCPsZoom != null) |
257 |
viewMapGCPsZoom.removeAllPoints(); |
258 |
} |
259 |
|
260 |
/**
|
261 |
* Asigna las coordenadas del mundo real y raster al punto indicado en el par?metro.
|
262 |
* @param point Punto a asignar las nuevas coordenadas
|
263 |
* @param xMap Coordenada real en X
|
264 |
* @param yMap Coordenada real en Y
|
265 |
* @param xRaster Coordenada pixel en X
|
266 |
* @param yRaster Coordenada pixel en Y
|
267 |
*/
|
268 |
public void setCoordinates(int point, double xMap, double yMap, double xRaster, double yRaster) { |
269 |
setXMapCoordinate(point, xMap); |
270 |
setYMapCoordinate(point, yMap); |
271 |
setXRasterCoordinate(point, xRaster); |
272 |
setYRasterCoordinate(point, yRaster); |
273 |
redrawPoints(); |
274 |
} |
275 |
|
276 |
/**
|
277 |
* Asigna la coordenada del mundo real X
|
278 |
* @param point
|
279 |
* @param xMap
|
280 |
*/
|
281 |
public void setXMapCoordinate(int point, double xMap) { |
282 |
double oldMapY = viewRasterGCPs.getPoint(point).getGeoPoint().getMapPoint().getY();
|
283 |
viewRasterGCPs.getPoint(point).getGeoPoint().getMapPoint().setLocation(xMap, oldMapY); |
284 |
} |
285 |
|
286 |
/**
|
287 |
* Asigna la coordenada del mundo real Y
|
288 |
* @param point
|
289 |
* @param yMap
|
290 |
*/
|
291 |
public void setYMapCoordinate(int point, double yMap) { |
292 |
double oldMapX = viewRasterGCPs.getPoint(point).getGeoPoint().getMapPoint().getX();
|
293 |
viewRasterGCPs.getPoint(point).getGeoPoint().getMapPoint().setLocation(oldMapX, yMap); |
294 |
} |
295 |
|
296 |
/**
|
297 |
* Asigna la coordenada raster X
|
298 |
* @param point
|
299 |
* @param xRaster
|
300 |
*/
|
301 |
public void setXRasterCoordinate(int point, double xRaster) { |
302 |
double oldRasterY = viewRasterGCPs.getPoint(point).getGeoPoint().getPixelPoint().getY();
|
303 |
viewRasterGCPs.getPoint(point).getGeoPoint().getPixelPoint().setLocation(xRaster, oldRasterY); |
304 |
} |
305 |
|
306 |
/**
|
307 |
* Asigna la coordenada raster Y
|
308 |
* @param point
|
309 |
* @param xRaster
|
310 |
*/
|
311 |
public void setYRasterCoordinate(int point, double yRaster) { |
312 |
double oldRasterX = viewRasterGCPs.getPoint(point).getGeoPoint().getPixelPoint().getX();
|
313 |
viewRasterGCPs.getPoint(point).getGeoPoint().getPixelPoint().setLocation(oldRasterX, yRaster); |
314 |
} |
315 |
|
316 |
/**
|
317 |
* Elimina un punto de la lista a partir de su posici?n
|
318 |
* @param position
|
319 |
*/
|
320 |
public void removePoint(int position) { |
321 |
if(viewRasterGCPs != null) |
322 |
viewRasterGCPs.removePixelGeoPoint(position); |
323 |
if(viewMapGCPs != null) |
324 |
viewMapGCPs.removePixelGeoPoint(position); |
325 |
if(viewRasterGCPsZoom != null) |
326 |
viewRasterGCPsZoom.removePixelGeoPoint(position); |
327 |
if(viewMapGCPsZoom != null) |
328 |
viewMapGCPsZoom.removePixelGeoPoint(position); |
329 |
} |
330 |
|
331 |
/**
|
332 |
* Informa de si la tool de selecci?n de puntos est? activa o no
|
333 |
* @return true si est? activa y false si no lo est?
|
334 |
*/
|
335 |
public boolean isSelectPointToolSelected() { |
336 |
if(viewRaster != null) |
337 |
if(viewRaster.getControl().getToolSelected() instanceof SelectPointTool) |
338 |
return true; |
339 |
return false; |
340 |
} |
341 |
|
342 |
/**
|
343 |
* Obtiene la lista de puntos
|
344 |
* @return ArrayList
|
345 |
*/
|
346 |
public List<GPGraphic> getPointList() { |
347 |
if(viewRasterGCPs != null) |
348 |
return viewRasterGCPs.getPointList();
|
349 |
return null; |
350 |
} |
351 |
|
352 |
/**
|
353 |
* Obtiene un array con la lista de puntos
|
354 |
* @return
|
355 |
*/
|
356 |
public List<GeoPoint> getGeoPoints() { |
357 |
List<GPGraphic> pointList = getPointList();
|
358 |
for (int i = 0; i < pointList.size(); i++) |
359 |
geoPointList.add(((GPGraphic) pointList.get(i)).getGeoPoint()); |
360 |
return geoPointList;
|
361 |
} |
362 |
|
363 |
/**
|
364 |
* Activa o desactiva la visualizaci?n de un punto.
|
365 |
* @param active true para activarlo y false para desactivarlo
|
366 |
* @param position Posici?n del punto
|
367 |
*/
|
368 |
public void setVisiblePoint(boolean visible, int position) { |
369 |
if(viewRasterGCPs != null) |
370 |
((GPGraphic)viewRasterGCPs.getPointList().get(position)).setDraw(visible); |
371 |
if(viewMapGCPs != null) |
372 |
((GPGraphic)viewMapGCPs.getPointList().get(position)).setDraw(visible); |
373 |
if(viewRasterGCPsZoom != null) |
374 |
((GPGraphic)viewRasterGCPsZoom.getPointList().get(position)).setDraw(visible); |
375 |
if(viewMapGCPsZoom != null) |
376 |
((GPGraphic)viewMapGCPsZoom.getPointList().get(position)).setDraw(visible); |
377 |
} |
378 |
|
379 |
/**
|
380 |
* Asigna la numeraci?n a los puntos de control. Tanto a la tabla como
|
381 |
* a los GeoPuntos
|
382 |
* @throws NotInitializeException
|
383 |
*/
|
384 |
public void calcPointsNumeration() { |
385 |
List<GPGraphic> pointList = getPointList();
|
386 |
|
387 |
for (int i = 0; i < table.getRowCount(); i++) { |
388 |
table.setValueAt(new Integer(i), i, 1); |
389 |
long id = (long)((Long)table.getValueAt(i, table.getColumnCount() - 1)).longValue(); |
390 |
|
391 |
if(i < pointList.size()) {
|
392 |
for (int j = 0; j < pointList.size(); j++) { |
393 |
GPGraphic gpg = ((GPGraphic)pointList.get(j)); |
394 |
if(id == gpg.getId()) {
|
395 |
((GPGraphic)pointList.get(j)).getGeoPoint().setNumber(i); |
396 |
break;
|
397 |
} |
398 |
} |
399 |
} |
400 |
} |
401 |
redrawPoints(); |
402 |
} |
403 |
|
404 |
public void createGCPLayers() { |
405 |
if(viewRaster != null) { |
406 |
viewRasterGCPs = new GCPsGraphicLayer(GPGraphic.PIXEL, toolListener);
|
407 |
viewRasterGCPs.setCanvas(viewRaster.getCanvas()); |
408 |
viewRaster.addGraphicLayer(viewRasterGCPs); |
409 |
viewRasterRequestManager.setGCPsGraphicLayer(viewRasterGCPs); |
410 |
} |
411 |
|
412 |
if(zoomRaster != null) { |
413 |
viewRasterGCPsZoom = new GCPsGraphicLayer(GPGraphic.PIXEL, toolListener);
|
414 |
viewRasterGCPsZoom.setCanvas(zoomRaster.getCanvas()); |
415 |
zoomRaster.addGraphicLayer(viewRasterGCPsZoom); |
416 |
zoomRasterRequestManager.setGCPsGraphicLayer(viewRasterGCPsZoom); |
417 |
} |
418 |
|
419 |
if(viewMap != null) { |
420 |
viewMapGCPs = new GCPsGraphicLayer(GPGraphic.MAP, toolListener);
|
421 |
viewMapGCPs.setCanvas(viewMap.getCanvas()); |
422 |
viewMap.addGraphicLayer(viewMapGCPs); |
423 |
viewMapRequestManager.setGCPsGraphicLayer(viewMapGCPs); |
424 |
} |
425 |
|
426 |
if(zoomMap != null) { |
427 |
viewMapGCPsZoom = new GCPsGraphicLayer(GPGraphic.MAP, toolListener);
|
428 |
viewMapGCPsZoom.setCanvas(zoomMap.getCanvas()); |
429 |
zoomMap.addGraphicLayer(viewMapGCPsZoom); |
430 |
zoomMapRequestManager.setGCPsGraphicLayer(viewMapGCPsZoom); |
431 |
} |
432 |
} |
433 |
|
434 |
/**
|
435 |
* Activa y desactiva los n?meros de punto de las capas gr?ficas
|
436 |
* @param active
|
437 |
*/
|
438 |
public void setActiveNumberPoint(boolean active) { |
439 |
if(viewMapGCPs != null) |
440 |
viewMapGCPs.setShowNumber(active); |
441 |
if(viewRasterGCPs != null) |
442 |
viewRasterGCPs.setShowNumber(active); |
443 |
if(viewMapGCPsZoom != null) |
444 |
viewMapGCPsZoom.setShowNumber(active); |
445 |
if(viewRasterGCPsZoom != null) |
446 |
viewRasterGCPsZoom.setShowNumber(active); |
447 |
} |
448 |
|
449 |
/**
|
450 |
* Activa o desactiva la capa de puntos
|
451 |
* @param active
|
452 |
*/
|
453 |
public void setActiveLayerPoints(boolean active) { |
454 |
if(viewRasterGCPs != null) |
455 |
viewRasterGCPs.setActive(active); |
456 |
if(viewMapGCPs != null) |
457 |
viewMapGCPs.setActive(active); |
458 |
if(viewRasterGCPsZoom != null) |
459 |
viewRasterGCPsZoom.setActive(active); |
460 |
if(viewMapGCPsZoom != null) |
461 |
viewMapGCPsZoom.setActive(active); |
462 |
} |
463 |
|
464 |
/**
|
465 |
* Obtiene un punto (GeoPoint) a partir de su n?mero. Hay que tener en cuenta que el n?mero de
|
466 |
* punto puede no coincidir con su posici?n en el array.
|
467 |
* @return GeoPoint
|
468 |
*/
|
469 |
public GeoPoint getPointByNumber(int number) { |
470 |
List<GPGraphic> pointList = getPointList();
|
471 |
for (int i = 0; i < pointList.size(); i++) { |
472 |
GeoPoint p = ((GPGraphic)pointList.get(i)).getGeoPoint(); |
473 |
if(p.getNumber() == number)
|
474 |
return p;
|
475 |
} |
476 |
return null; |
477 |
} |
478 |
|
479 |
/**
|
480 |
* Obtiene la posici?n de un punto a partir de su n?mero. Hay que tener en cuenta que el n?mero de
|
481 |
* punto puede no coincidir con su posici?n en el array.
|
482 |
* @return entero con la posici?n o -1 si no existe
|
483 |
*/
|
484 |
public int getPointPositionByNumber(int number) { |
485 |
List<GPGraphic> pointList = getPointList();
|
486 |
for (int i = 0; i < pointList.size(); i++) { |
487 |
GeoPoint p = ((GPGraphic)pointList.get(i)).getGeoPoint(); |
488 |
if(p.getNumber() == number)
|
489 |
return i;
|
490 |
} |
491 |
return -1; |
492 |
} |
493 |
} |