Revision 3603
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/operations/strategies/DiskShapeInfo.java | ||
---|---|---|
1 |
/* 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 |
package com.iver.cit.gvsig.fmap.operations.strategies; |
|
42 |
|
|
43 |
import java.awt.geom.Rectangle2D; |
|
44 |
|
|
45 |
public class DiskShapeInfo implements ShapeInfo { |
|
46 |
|
|
47 |
/** |
|
48 |
* @see com.iver.cit.gvsig.fmap.operations.strategies.ShapeInfo#addShapeInfo(java.awt.geom.Rectangle2D, int) |
|
49 |
*/ |
|
50 |
public void addShapeInfo(Rectangle2D boundingBox, int type) { |
|
51 |
} |
|
52 |
|
|
53 |
/** |
|
54 |
* @see com.iver.cit.gvsig.fmap.operations.strategies.ShapeInfo#getBoundingBox(int) |
|
55 |
*/ |
|
56 |
public Rectangle2D getBoundingBox(int index) { |
|
57 |
return null; |
|
58 |
} |
|
59 |
|
|
60 |
/** |
|
61 |
* @see com.iver.cit.gvsig.fmap.operations.strategies.ShapeInfo#getType(int) |
|
62 |
*/ |
|
63 |
public int getType(int index) { |
|
64 |
return 0; |
|
65 |
} |
|
66 |
|
|
67 |
/** |
|
68 |
* @see com.iver.cit.gvsig.fmap.operations.strategies.ShapeInfo#addShapeInfo(int, java.awt.geom.Rectangle2D, int) |
|
69 |
*/ |
|
70 |
public void addShapeInfo(int index, Rectangle2D boundingBox, int type) throws ArrayIndexOutOfBoundsException { |
|
71 |
} |
|
72 |
|
|
73 |
/** |
|
74 |
* @see com.iver.cit.gvsig.fmap.operations.strategies.ShapeInfo#setShapeInfo(int, java.awt.geom.Rectangle2D, int) |
|
75 |
*/ |
|
76 |
public void setShapeInfo(int index, Rectangle2D boundingBox, int type) throws ArrayIndexOutOfBoundsException { |
|
77 |
} |
|
78 |
} |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/operations/strategies/OptimiceStrategy.java | ||
---|---|---|
1 |
/* 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 |
package com.iver.cit.gvsig.fmap.operations.strategies; |
|
42 |
|
|
43 |
import com.hardcode.gdbms.engine.data.DataSource; |
|
44 |
|
|
45 |
import com.iver.cit.gvsig.fmap.DriverException; |
|
46 |
import com.iver.cit.gvsig.fmap.ViewPort; |
|
47 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
|
48 |
import com.iver.cit.gvsig.fmap.core.v02.FSymbol; |
|
49 |
import com.iver.cit.gvsig.fmap.drivers.DriverIOException; |
|
50 |
import com.iver.cit.gvsig.fmap.drivers.VectorialFileDriver; |
|
51 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
|
52 |
import com.iver.cit.gvsig.fmap.layers.VectorialAdapter; |
|
53 |
import com.iver.cit.gvsig.fmap.layers.layerOperations.AlphanumericData; |
|
54 |
import com.iver.cit.gvsig.fmap.layers.layerOperations.ClassifiableVectorial; |
|
55 |
import com.iver.cit.gvsig.fmap.layers.layerOperations.SingleLayer; |
|
56 |
import com.iver.cit.gvsig.fmap.operations.Cancellable; |
|
57 |
import com.iver.cit.gvsig.fmap.rendering.VectorialLegend; |
|
58 |
import com.iver.cit.gvsig.fmap.rendering.styling.FStyle2D; |
|
59 |
|
|
60 |
import org.apache.log4j.Logger; |
|
61 |
|
|
62 |
import java.awt.Graphics2D; |
|
63 |
import java.awt.geom.AffineTransform; |
|
64 |
import java.awt.geom.Rectangle2D; |
|
65 |
import java.awt.image.BufferedImage; |
|
66 |
|
|
67 |
|
|
68 |
/** |
|
69 |
* Extiende DefaultStrategy de forma optimizada. |
|
70 |
* |
|
71 |
* @author Vicente Caballero Navarro |
|
72 |
*/ |
|
73 |
public class OptimiceStrategy extends DefaultStrategy { |
|
74 |
private static Logger logger = Logger.getLogger(OptimiceStrategy.class.getName()); |
|
75 |
|
|
76 |
/** |
|
77 |
* Crea una nueva OptimiceStrategy. |
|
78 |
* |
|
79 |
* @param capa |
|
80 |
*/ |
|
81 |
public OptimiceStrategy(FLayer capa) { |
|
82 |
super(capa); |
|
83 |
} |
|
84 |
|
|
85 |
/** |
|
86 |
* @see com.iver.cit.gvsig.fmap.operations.LayerOperations#draw(java.awt.image.BufferedImage, |
|
87 |
* java.awt.Graphics2D, FStyle2D) |
|
88 |
*/ |
|
89 |
public void draw(BufferedImage image, Graphics2D g, ViewPort viewPort, |
|
90 |
Cancellable cancel) throws DriverException { |
|
91 |
try { |
|
92 |
VectorialAdapter adapter = ((SingleLayer) getCapa()).getSource(); |
|
93 |
DataSource ds = ((AlphanumericData) getCapa()).getRecordset(); |
|
94 |
// ShapeInfo shapeinfo = adapter.getShapeInfo(); |
|
95 |
logger.debug("adapter.start()"); |
|
96 |
adapter.start(); |
|
97 |
logger.debug("ds.start()"); |
|
98 |
ds.start(); |
|
99 |
|
|
100 |
VectorialFileDriver driver = (VectorialFileDriver) adapter.getDriver(); |
|
101 |
int sc; |
|
102 |
long t1 = System.currentTimeMillis(); |
|
103 |
Rectangle2D extent = viewPort.getAdjustedExtent(); |
|
104 |
AffineTransform at = viewPort.getAffineTransform(); |
|
105 |
|
|
106 |
sc = adapter.getShapeCount(); |
|
107 |
|
|
108 |
for (int i = 0; i < sc; i++) { |
|
109 |
if (cancel.isCanceled()) { |
|
110 |
break; |
|
111 |
} |
|
112 |
|
|
113 |
IGeometry geom = adapter.getShape(i); |
|
114 |
VectorialLegend l = (VectorialLegend) ((ClassifiableVectorial) getCapa()).getLegend(); |
|
115 |
|
|
116 |
// TODO Falta rematar esta parte. |
|
117 |
// if (shapeinfo.getBoundingBox(sc).intersects(extent)) { |
|
118 |
FSymbol symbol = l.getSymbol(i); |
|
119 |
geom.draw(g, viewPort, symbol); |
|
120 |
// } |
|
121 |
} |
|
122 |
|
|
123 |
long t2 = System.currentTimeMillis(); |
|
124 |
logger.debug("adapter.stop()"); |
|
125 |
adapter.stop(); |
|
126 |
logger.debug("ds.stop()"); |
|
127 |
ds.stop(); |
|
128 |
|
|
129 |
System.out.println(t2 - t1); |
|
130 |
} catch (DriverIOException e) { |
|
131 |
throw new DriverException(e); |
|
132 |
} catch (com.hardcode.gdbms.engine.data.driver.DriverException e) { |
|
133 |
throw new DriverException(e); |
|
134 |
} |
|
135 |
} |
|
136 |
} |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/operations/strategies/ProjectionVisitor.java | ||
---|---|---|
1 |
/* 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 |
package com.iver.cit.gvsig.fmap.operations.strategies; |
|
42 |
|
|
43 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
|
44 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
|
45 |
|
|
46 |
public class ProjectionVisitor implements FeatureVisitor { |
|
47 |
|
|
48 |
/** |
|
49 |
* @see com.iver.cit.gvsig.fmap.operations.strategies.FeatureVisitor#visit(com.iver.cit.gvsig.fmap.fshape.IGeometry, int) |
|
50 |
*/ |
|
51 |
public void visit(IGeometry g, int index) { |
|
52 |
} |
|
53 |
|
|
54 |
/** |
|
55 |
* @see com.iver.cit.gvsig.fmap.operations.strategies.FeatureVisitor#stop() |
|
56 |
*/ |
|
57 |
public void stop(FLayer layer) { |
|
58 |
} |
|
59 |
|
|
60 |
/** |
|
61 |
* @see com.iver.cit.gvsig.fmap.operations.strategies.FeatureVisitor#start() |
|
62 |
*/ |
|
63 |
public boolean start(FLayer layer) { |
|
64 |
return true; |
|
65 |
} |
|
66 |
} |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/operations/strategies/BoundingBoxVisitor.java | ||
---|---|---|
1 |
/* 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 |
package com.iver.cit.gvsig.fmap.operations.strategies; |
|
42 |
|
|
43 |
import java.awt.geom.Rectangle2D; |
|
44 |
|
|
45 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
|
46 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
|
47 |
|
|
48 |
public class BoundingBoxVisitor implements FeatureVisitor { |
|
49 |
/** |
|
50 |
* Recibe las geometr?as a medida que se van recorriendo en la estrategia |
|
51 |
*/ |
|
52 |
public void visit(IGeometry g, int index){ } |
|
53 |
|
|
54 |
public Rectangle2D getBoundingBox() { |
|
55 |
//TODO implementar esto bien |
|
56 |
return null; |
|
57 |
} |
|
58 |
|
|
59 |
/** |
|
60 |
* @see com.iver.cit.gvsig.fmap.operations.strategies.FeatureVisitor#stop() |
|
61 |
*/ |
|
62 |
public void stop(FLayer layer) { |
|
63 |
} |
|
64 |
|
|
65 |
/** |
|
66 |
* @see com.iver.cit.gvsig.fmap.operations.strategies.FeatureVisitor#start() |
|
67 |
*/ |
|
68 |
public boolean start(FLayer layer) { |
|
69 |
return true; |
|
70 |
} |
|
71 |
} |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/operations/strategies/IndexedStrategy.java | ||
---|---|---|
1 |
/* 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 |
package com.iver.cit.gvsig.fmap.operations.strategies; |
|
42 |
|
|
43 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
|
44 |
|
|
45 |
|
|
46 |
/** |
|
47 |
* Estrategia que har? uso de ?ndices para implementar Strategy |
|
48 |
*/ |
|
49 |
public class IndexedStrategy extends DefaultStrategy { |
|
50 |
/** |
|
51 |
* Crea una nueva IndexedStrategy. |
|
52 |
* |
|
53 |
* @param capa |
|
54 |
*/ |
|
55 |
public IndexedStrategy(FLayer capa) { |
|
56 |
super(capa); |
|
57 |
} |
|
58 |
} |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/operations/strategies/SelectByPointVisitor.java | ||
---|---|---|
1 |
/* 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 |
package com.iver.cit.gvsig.fmap.operations.strategies; |
|
42 |
|
|
43 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
|
44 |
import com.iver.cit.gvsig.fmap.layers.layerOperations.Selectable; |
|
45 |
|
|
46 |
|
|
47 |
/** |
|
48 |
* Visitor de selecci?n por punto. |
|
49 |
* |
|
50 |
* @author Vicente Caballero Navarro |
|
51 |
*/ |
|
52 |
public class SelectByPointVisitor extends QueryByPointVisitor { |
|
53 |
/** |
|
54 |
* Inicializa el visitor. |
|
55 |
* |
|
56 |
* @param layer Capa. |
|
57 |
* |
|
58 |
* @return True si se inicializa correctamente. |
|
59 |
*/ |
|
60 |
public boolean start(FLayer layer) { |
|
61 |
super.start(layer); |
|
62 |
|
|
63 |
return layer instanceof Selectable; |
|
64 |
} |
|
65 |
|
|
66 |
/** |
|
67 |
* Finaliza el visitor. |
|
68 |
* |
|
69 |
* @param layer Capa. |
|
70 |
*/ |
|
71 |
public void stop(FLayer layer) { |
|
72 |
super.stop(layer); |
|
73 |
((Selectable) layer).setSelection(getBitSet()); |
|
74 |
} |
|
75 |
} |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/operations/strategies/FeatureDataVisitor.java | ||
---|---|---|
1 |
/* 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 |
package com.iver.cit.gvsig.fmap.operations.strategies; |
|
42 |
|
|
43 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
|
44 |
import com.iver.cit.gvsig.fmap.operations.selection.Record; |
|
45 |
|
|
46 |
public interface FeatureDataVisitor { |
|
47 |
/** |
|
48 |
* M?todo invocado al finalizar las visitas con el fin de que se puedan liberar los recursos reservados en start |
|
49 |
*/ |
|
50 |
void stop(); |
|
51 |
|
|
52 |
/** |
|
53 |
* M?todo invocado antes de las visitas para que el visitor pueda reservar alg?n tipo de recurso que sea necesario |
|
54 |
*/ |
|
55 |
void start(); |
|
56 |
|
|
57 |
/** |
|
58 |
* Recibe las geometr?as a medida que se van recorriendo en la estrategia |
|
59 |
*/ |
|
60 |
void visit(IGeometry g, Record r); |
|
61 |
} |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/operations/strategies/SelectByRectVisitor.java | ||
---|---|---|
1 |
/* 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 |
package com.iver.cit.gvsig.fmap.operations.strategies; |
|
42 |
|
|
43 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
|
44 |
import com.iver.cit.gvsig.fmap.layers.layerOperations.Selectable; |
|
45 |
|
|
46 |
|
|
47 |
/** |
|
48 |
* Visitor de slecci?n por rect?ngulo. |
|
49 |
* |
|
50 |
* @author Vicente Caballero Navarro |
|
51 |
*/ |
|
52 |
public class SelectByRectVisitor extends QueryByRectVisitor { |
|
53 |
/** |
|
54 |
* Inicializa el visitor. |
|
55 |
* |
|
56 |
* @param layer Capa. |
|
57 |
* |
|
58 |
* @return True si se inicializa correctamente. |
|
59 |
*/ |
|
60 |
public boolean start(FLayer layer) { |
|
61 |
return super.start(layer) && layer instanceof Selectable; |
|
62 |
} |
|
63 |
|
|
64 |
/** |
|
65 |
* Finaliza el visitor. |
|
66 |
* |
|
67 |
* @param layer Capa. |
|
68 |
*/ |
|
69 |
public void stop(FLayer layer) { |
|
70 |
super.stop(layer); |
|
71 |
((Selectable) layer).setSelection(super.getBitSet()); |
|
72 |
} |
|
73 |
} |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/FMap.java | ||
---|---|---|
47 | 47 |
import java.awt.geom.Rectangle2D; |
48 | 48 |
import java.awt.image.BufferedImage; |
49 | 49 |
import java.util.ArrayList; |
50 |
import java.util.Iterator; |
|
51 | 50 |
|
52 |
import javax.swing.SwingUtilities; |
|
53 |
|
|
54 | 51 |
import org.cresques.cts.ICoordTrans; |
55 | 52 |
import org.cresques.cts.IProjection; |
56 | 53 |
import org.cresques.geo.Projected; |
57 | 54 |
|
58 | 55 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
59 | 56 |
import com.iver.cit.gvsig.fmap.layers.CancelationException; |
60 |
import com.iver.cit.gvsig.fmap.layers.FBitSet; |
|
61 | 57 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
62 | 58 |
import com.iver.cit.gvsig.fmap.layers.FLayers; |
63 |
import com.iver.cit.gvsig.fmap.layers.FLyrVect; |
|
64 | 59 |
import com.iver.cit.gvsig.fmap.layers.GraphicLayer; |
65 | 60 |
import com.iver.cit.gvsig.fmap.layers.LayerCollectionEvent; |
66 | 61 |
import com.iver.cit.gvsig.fmap.layers.LayerCollectionListener; |
... | ... | |
70 | 65 |
import com.iver.cit.gvsig.fmap.layers.XMLException; |
71 | 66 |
import com.iver.cit.gvsig.fmap.layers.layerOperations.Classifiable; |
72 | 67 |
import com.iver.cit.gvsig.fmap.layers.layerOperations.Selectable; |
73 |
import com.iver.cit.gvsig.fmap.layers.layerOperations.VectorialData; |
|
74 | 68 |
import com.iver.cit.gvsig.fmap.operations.Cancellable; |
75 | 69 |
import com.iver.cit.gvsig.fmap.operations.selection.Record; |
76 | 70 |
import com.iver.cit.gvsig.fmap.operations.strategies.FeatureVisitor; |
77 |
import com.iver.cit.gvsig.fmap.operations.strategies.SelectByPointVisitor; |
|
78 |
import com.iver.cit.gvsig.fmap.operations.strategies.SelectByRectVisitor; |
|
79 | 71 |
import com.iver.cit.gvsig.fmap.operations.strategies.SelectedZoomVisitor; |
80 | 72 |
import com.iver.cit.gvsig.fmap.operations.strategies.VisitException; |
81 |
import com.iver.cit.gvsig.fmap.rendering.styling.FStyle2D; |
|
82 | 73 |
import com.iver.utiles.XMLEntity; |
83 |
import com.sun.java.swing.SwingUtilities2; |
|
84 | 74 |
|
85 | 75 |
|
86 | 76 |
/** |
Also available in: Unified diff