svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.plugin / org.gvsig.editing.app / org.gvsig.editing.app.mainplugin / src / main / java / org / gvsig / editing / gui / graphictools / VisitorSelectGraphicByPoint.java @ 40557
History | View | Annotate | Download (2.18 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2013 gvSIG Association.
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 3
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
* For any additional information, do not hesitate to contact us
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
23 |
*/
|
24 |
package org.gvsig.editing.gui.graphictools; |
25 |
|
26 |
import java.awt.geom.Point2D; |
27 |
import java.awt.geom.Rectangle2D; |
28 |
|
29 |
import org.gvsig.fmap.geom.Geometry; |
30 |
//import org.gvsig.fmap.mapcontext.layers.FBitSet;
|
31 |
|
32 |
import com.vividsolutions.jts.index.ItemVisitor; |
33 |
|
34 |
/**
|
35 |
* @author fjp
|
36 |
*
|
37 |
* @deprecated Use queryByRect
|
38 |
*/
|
39 |
public class VisitorSelectGraphicByPoint implements ItemVisitor{ |
40 |
|
41 |
private Point2D mapPoint; |
42 |
private double tol; |
43 |
// private FBitSet selection = new FBitSet();
|
44 |
private int numReg; |
45 |
Rectangle2D recPoint;
|
46 |
|
47 |
public VisitorSelectGraphicByPoint(Point2D mapPoint, double tolerance) |
48 |
{ |
49 |
this.mapPoint = mapPoint;
|
50 |
this.tol = tolerance;
|
51 |
this.numReg = 0; |
52 |
|
53 |
recPoint = new Rectangle2D.Double(mapPoint.getX() - (tolerance / 2), |
54 |
mapPoint.getY() - (tolerance / 2), tolerance, tolerance);
|
55 |
|
56 |
} |
57 |
|
58 |
/* (non-Javadoc)
|
59 |
* @see com.vividsolutions.jts.index.ItemVisitor#visitItem(java.lang.Object)
|
60 |
* TODO: VENDRIA BIEN SABER EL NUMERO DE REGISTRO PARA PODER MARCARLO COMO SELECCIONADO
|
61 |
*/
|
62 |
public void visitItem(Object item) { |
63 |
// FGraphic graf = (FGraphic) item;
|
64 |
// Geometry geom = graf.getGeom();
|
65 |
// if (geom.intersects(recPoint))
|
66 |
// {
|
67 |
// selection.set(numReg);
|
68 |
// }
|
69 |
// numReg++;
|
70 |
|
71 |
} |
72 |
|
73 |
// public FBitSet getSelection() {
|
74 |
// return selection;
|
75 |
// }
|
76 |
|
77 |
} |
78 |
|
79 |
|