root / tags / Root_Fmap_GisPlanet / libraries / libFMap / src / com / iver / cit / gvsig / fmap / operations / strategies / Strategy.java @ 1826
History | View | Annotate | Download (4.73 KB)
1 | 1100 | fjp | /* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
---|---|---|---|
2 | *
|
||
3 | * Copyright (C) 2004 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 | * For more information, contact:
|
||
20 | *
|
||
21 | * Generalitat Valenciana
|
||
22 | * Conselleria d'Infraestructures i Transport
|
||
23 | * Av. Blasco Ib??ez, 50
|
||
24 | * 46010 VALENCIA
|
||
25 | * SPAIN
|
||
26 | *
|
||
27 | * +34 963862235
|
||
28 | * gvsig@gva.es
|
||
29 | * www.gvsig.gva.es
|
||
30 | *
|
||
31 | * or
|
||
32 | *
|
||
33 | * IVER T.I. S.A
|
||
34 | * Salamanca 50
|
||
35 | * 46005 Valencia
|
||
36 | * Spain
|
||
37 | *
|
||
38 | * +34 963163400
|
||
39 | * dac@iver.es
|
||
40 | */
|
||
41 | 214 | fernando | package com.iver.cit.gvsig.fmap.operations.strategies; |
42 | |||
43 | 652 | fernando | import com.iver.cit.gvsig.fmap.DriverException; |
44 | 244 | fernando | import com.iver.cit.gvsig.fmap.ViewPort; |
45 | 305 | fjp | import com.iver.cit.gvsig.fmap.core.IGeometry; |
46 | 1825 | fjp | import com.iver.cit.gvsig.fmap.layers.FBitSet; |
47 | 244 | fernando | import com.iver.cit.gvsig.fmap.operations.Cancellable; |
48 | 229 | vcaballero | |
49 | 929 | fernando | import java.awt.Graphics2D; |
50 | 993 | fernando | import java.awt.geom.Point2D; |
51 | 929 | fernando | import java.awt.geom.Rectangle2D; |
52 | import java.awt.image.BufferedImage; |
||
53 | 239 | fjp | |
54 | 929 | fernando | import java.util.BitSet; |
55 | |||
56 | |||
57 | 228 | fernando | /**
|
58 | 1034 | vcaballero | * Interfaz estrategia.
|
59 | 228 | fernando | */
|
60 | public interface Strategy { |
||
61 | 929 | fernando | /**
|
62 | * Dibuja la capa vectorial asociada al Strategy en la imagen que se pasa
|
||
63 | * como par?metro.
|
||
64 | *
|
||
65 | 1034 | vcaballero | * @param image
|
66 | * @param g
|
||
67 | * @param viewPort
|
||
68 | 929 | fernando | * @param cancel
|
69 | *
|
||
70 | * @throws DriverException
|
||
71 | */
|
||
72 | void draw(BufferedImage image, Graphics2D g, ViewPort viewPort, |
||
73 | Cancellable cancel) throws DriverException;
|
||
74 | 216 | fernando | |
75 | 929 | fernando | /**
|
76 | 239 | fjp | * Dibujar? esta Shape en el Graphics con el s?mbolo que se pasa como
|
77 | * par?metro y despues de aplicarle la transformaci?n que se pasa tambi?n
|
||
78 | 305 | fjp | * como par?metro. Dibujar? la geometria en caso de que la IGeometry
|
79 | 239 | fjp | * intersecte o est? contenida en el rect?ngulo que se pasa como par?metro
|
80 | *
|
||
81 | 1034 | vcaballero | * @param g
|
82 | * @param viewPort
|
||
83 | * @param cancel
|
||
84 | 929 | fernando | *
|
85 | * @throws DriverException
|
||
86 | 239 | fjp | */
|
87 | 244 | fernando | void print(Graphics2D g, ViewPort viewPort, Cancellable cancel) |
88 | 652 | fernando | throws DriverException;
|
89 | 214 | fernando | |
90 | 929 | fernando | /**
|
91 | * Recorre las features de la capa vectorial invocando el m?todo visit del
|
||
92 | * visitador que se pasa como par?metro, que es el que realizar? la
|
||
93 | * operaci?n relacionada con la geometry
|
||
94 | *
|
||
95 | 1034 | vcaballero | * @param visitor
|
96 | * @param subset
|
||
97 | 929 | fernando | *
|
98 | * @throws DriverException
|
||
99 | * @throws VisitException Si el visitor lanza una excepci?n al procesar una
|
||
100 | * geometr?a de la capa
|
||
101 | */
|
||
102 | void process(FeatureVisitor visitor, BitSet subset) |
||
103 | throws DriverException, VisitException;
|
||
104 | 214 | fernando | |
105 | 929 | fernando | /**
|
106 | * Recorre las features de la capa vectorial invocando el m?todo visit del
|
||
107 | * visitador que se pasa como par?metro, que es el que realizar? la
|
||
108 | * operaci?n relacionada con la geometry
|
||
109 | *
|
||
110 | 1034 | vcaballero | * @param visitor
|
111 | 929 | fernando | *
|
112 | * @throws DriverException
|
||
113 | * @throws VisitException Si el visitor lanza una excepci?n al procesar una
|
||
114 | * geometr?a de la capa
|
||
115 | */
|
||
116 | void process(FeatureVisitor visitor) throws DriverException, VisitException; |
||
117 | 214 | fernando | |
118 | 929 | fernando | /**
|
119 | * Realiza una query por punto en coordenadas del mundo real de la capa
|
||
120 | * vectorial asociada a la estrategia
|
||
121 | *
|
||
122 | 1034 | vcaballero | * @param p
|
123 | * @param tolerance
|
||
124 | 929 | fernando | *
|
125 | 1034 | vcaballero | * @return BitSet con los ?ndices de los registros de la repuesta a la
|
126 | * consulta.
|
||
127 | 929 | fernando | *
|
128 | 1034 | vcaballero | * @throws DriverException
|
129 | 929 | fernando | */
|
130 | 1825 | fjp | FBitSet queryByPoint(Point2D p, double tolerance) throws DriverException; |
131 | 214 | fernando | |
132 | 929 | fernando | /**
|
133 | * Realiza una query por rect?ngulo en coordenadas del mundo real de la
|
||
134 | * capa vectorial asociada a la estrategia
|
||
135 | *
|
||
136 | 1034 | vcaballero | * @param rect Rect?ngulo sobre el que hacer la consulta.
|
137 | 929 | fernando | *
|
138 | 1034 | vcaballero | * @return BitSet con los ?ndices de los registros.
|
139 | 929 | fernando | *
|
140 | 1034 | vcaballero | * @throws DriverException
|
141 | 929 | fernando | */
|
142 | 1825 | fjp | FBitSet queryByRect(Rectangle2D rect) throws DriverException; |
143 | 214 | fernando | |
144 | 929 | fernando | /**
|
145 | * Realiza una query por IGeometry en coordenadas del mundo real de la capa
|
||
146 | * vectorial asociada a la estrategia
|
||
147 | *
|
||
148 | 1034 | vcaballero | * @param g
|
149 | * @param relationship
|
||
150 | 929 | fernando | *
|
151 | 1034 | vcaballero | * @return BitSet con los ?ndices de los registros.
|
152 | 929 | fernando | *
|
153 | 1034 | vcaballero | * @throws DriverException
|
154 | 929 | fernando | * @throws VisitException
|
155 | */
|
||
156 | 1825 | fjp | FBitSet queryByShape(IGeometry g, int relationship)
|
157 | 929 | fernando | throws DriverException, VisitException;
|
158 | 229 | vcaballero | |
159 | 929 | fernando | /**
|
160 | * Obtiene el rect?ngulo m?nimo que contiene todas las features
|
||
161 | * seleccionadas o null si no hay ninguna seleccionada
|
||
162 | *
|
||
163 | 1034 | vcaballero | * @return Devuelve el extent de la consulta.
|
164 | 929 | fernando | */
|
165 | Rectangle2D getSelectionBounds();
|
||
166 | |||
167 | /**
|
||
168 | * Crea un ?ndice sobre la capa vectorial de la estrategia
|
||
169 | */
|
||
170 | void createIndex();
|
||
171 | 214 | fernando | } |