Revision 21711 branches/v2_0_0_prep/libraries/libFMap_mapcontrol/src/org/gvsig/fmap/mapcontrol/tools/RectangleSelectionListener.java
RectangleSelectionListener.java | ||
---|---|---|
50 | 50 |
|
51 | 51 |
import org.gvsig.data.ReadException; |
52 | 52 |
import org.gvsig.data.vectorial.FeatureCollection; |
53 |
import org.gvsig.fmap.geom.primitive.Envelope; |
|
53 | 54 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
54 | 55 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
55 | 56 |
import org.gvsig.fmap.mapcontrol.MapControl; |
56 |
import org.gvsig.fmap.mapcontrol.tools.Events.RectangleEvent;
|
|
57 |
import org.gvsig.fmap.mapcontrol.tools.Events.EnvelopeEvent;
|
|
57 | 58 |
import org.gvsig.fmap.mapcontrol.tools.Listeners.RectangleListener; |
58 | 59 |
|
59 | 60 |
/** |
... | ... | |
95 | 96 |
* (non-Javadoc) |
96 | 97 |
* @see com.iver.cit.gvsig.fmap.tools.Listeners.RectangleListener#rectangle(com.iver.cit.gvsig.fmap.tools.Events.RectangleEvent) |
97 | 98 |
*/ |
98 |
public void rectangle(RectangleEvent event) throws BehaviorException {
|
|
99 |
public void rectangle(EnvelopeEvent event) throws BehaviorException {
|
|
99 | 100 |
try { |
100 | 101 |
// mapCtrl.getMapContext().selectByRect(event.getWorldCoordRect()); |
101 |
Rectangle2D rect = event.getWorldCoordRect();
|
|
102 |
Envelope rect = event.getWorldCoordRect();
|
|
102 | 103 |
FLayer[] actives = mapCtrl.getMapContext() |
103 | 104 |
.getLayers().getActives(); |
104 | 105 |
for (int i=0; i < actives.length; i++) |
... | ... | |
106 | 107 |
if (actives[i] instanceof FLyrVect) { |
107 | 108 |
FLyrVect lyrVect = (FLyrVect) actives[i]; |
108 | 109 |
FeatureCollection oldSelection = (FeatureCollection) lyrVect.getFeatureStore().getSelection(); |
109 |
FeatureCollection newSelection = (FeatureCollection) lyrVect.queryByRect(rect);
|
|
110 |
FeatureCollection newSelection = (FeatureCollection) lyrVect.queryByEnvelope(rect);
|
|
110 | 111 |
if (event.getEvent().isControlDown()){ |
111 | 112 |
//TODO |
112 | 113 |
// newBitSet.xor(oldBitSet); |
Also available in: Unified diff