Revision 563 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/FMap.java
FMap.java | ||
---|---|---|
20 | 20 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
21 | 21 |
import com.iver.cit.gvsig.fmap.drivers.DriverIOException; |
22 | 22 |
import com.iver.cit.gvsig.fmap.layers.CancelationException; |
23 |
import com.iver.cit.gvsig.fmap.layers.CommonOperations; |
|
24 | 23 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
25 | 24 |
import com.iver.cit.gvsig.fmap.layers.FLayers; |
26 |
import com.iver.cit.gvsig.fmap.layers.FLyrVect; |
|
27 | 25 |
import com.iver.cit.gvsig.fmap.layers.LayerChangeSupport; |
28 | 26 |
import com.iver.cit.gvsig.fmap.layers.LayerCollectionEvent; |
29 | 27 |
import com.iver.cit.gvsig.fmap.layers.LayerCollectionListener; |
30 | 28 |
import com.iver.cit.gvsig.fmap.layers.LayerFactory; |
31 |
import com.iver.cit.gvsig.fmap.layers.LayerListener; |
|
32 | 29 |
import com.iver.cit.gvsig.fmap.layers.LayerPositionEvent; |
30 |
import com.iver.cit.gvsig.fmap.layers.LegendListener; |
|
33 | 31 |
import com.iver.cit.gvsig.fmap.layers.VectorialAdapter; |
34 | 32 |
import com.iver.cit.gvsig.fmap.layers.XMLException; |
33 |
import com.iver.cit.gvsig.fmap.layers.layerOperations.Classifiable; |
|
35 | 34 |
import com.iver.cit.gvsig.fmap.operations.Cancellable; |
36 | 35 |
import com.iver.cit.gvsig.fmap.operations.QueriedPoint; |
37 | 36 |
import com.iver.cit.gvsig.fmap.operations.selection.Record; |
38 | 37 |
import com.iver.cit.gvsig.fmap.operations.strategies.FeatureVisitor; |
38 |
import com.iver.cit.gvsig.fmap.operations.strategies.QueryByPointVisitor; |
|
39 |
import com.iver.cit.gvsig.fmap.operations.strategies.SelectByRectVisitor; |
|
39 | 40 |
import com.iver.cit.gvsig.fmap.rendering.LegendChangedEvent; |
40 | 41 |
import com.iver.cit.gvsig.fmap.rendering.styling.FStyle2D; |
41 | 42 |
import com.iver.utiles.XMLEntity; |
... | ... | |
84 | 85 |
* |
85 | 86 |
* @param listener DOCUMENT ME! |
86 | 87 |
*/ |
87 |
public void addLayerListener(LayerListener listener) {
|
|
88 |
public void addLayerListener(LegendListener listener) {
|
|
88 | 89 |
layerChangeSupport.addLayerListener(listener); |
89 | 90 |
} |
90 | 91 |
|
... | ... | |
102 | 103 |
* |
103 | 104 |
* @param listener DOCUMENT ME! |
104 | 105 |
*/ |
105 |
public void removeLayerListener(LayerListener listener) {
|
|
106 |
public void removeLayerListener(LegendListener listener) {
|
|
106 | 107 |
layerChangeSupport.removeLayerListener(listener); |
107 | 108 |
} |
108 | 109 |
|
... | ... | |
201 | 202 |
* |
202 | 203 |
* @param vectorial DOCUMENT ME! |
203 | 204 |
*/ |
204 |
public void addToTrackLayer(FLyrVect vectorial) {
|
|
205 |
public void addToTrackLayer(FLayer vectorial) {
|
|
205 | 206 |
} |
206 | 207 |
|
207 | 208 |
/** |
... | ... | |
290 | 291 |
QueriedPoint qp = new QueriedPoint(p.getX(), p.getY()); |
291 | 292 |
Point2D mapPoint = viewPort.toMapPoint((int) p.getX(), (int) p.getY()); |
292 | 293 |
qp.setRealCoords(mapPoint.getX(), mapPoint.getY()); |
293 |
layers.selectByPoint(qp, tolerance); |
|
294 |
QueryByPointVisitor visitor = new QueryByPointVisitor(); |
|
295 |
visitor.setQueriedPoint(qp); |
|
296 |
layers.process(visitor); |
|
294 | 297 |
fireInvalidEvent(); |
295 | 298 |
} |
296 | 299 |
|
... | ... | |
304 | 307 |
* @see com.iver.cit.gvsig.fmap.operations.strategies.Strategy#selectByRect(java.awt.geom.Rectangle2D) |
305 | 308 |
*/ |
306 | 309 |
public void selectByRect(Rectangle2D rect) throws DriverIOException { |
307 |
layers.selectByRect(rect); |
|
310 |
SelectByRectVisitor visitor = new SelectByRectVisitor(); |
|
311 |
visitor.setRect(rect); |
|
312 |
layers.process(visitor); |
|
308 | 313 |
fireInvalidEvent(); |
309 | 314 |
} |
310 | 315 |
|
... | ... | |
553 | 558 |
* |
554 | 559 |
* @author Fernando Gonz?lez Cort?s |
555 | 560 |
*/ |
556 |
public class LegendChanges implements LayerListener {
|
|
561 |
public class LegendChanges implements LegendListener {
|
|
557 | 562 |
private ArrayList events = new ArrayList(); |
558 | 563 |
|
559 | 564 |
/** |
... | ... | |
570 | 575 |
} |
571 | 576 |
|
572 | 577 |
/** |
573 |
* @see com.iver.cit.gvsig.fmap.layers.LayerListener#legendChanged(com.iver.cit.gvsig.fmap.rendering.LegendChangedEvent)
|
|
578 |
* @see com.iver.cit.gvsig.fmap.layers.LegendListener#legendChanged(com.iver.cit.gvsig.fmap.rendering.LegendChangedEvent)
|
|
574 | 579 |
*/ |
575 | 580 |
public void legendChanged(LegendChangedEvent e) { |
576 | 581 |
events.add(e); |
... | ... | |
607 | 612 |
//Registramos al FMap como listener del legend de las capas |
608 | 613 |
FLayer lyr = e.getAffectedLayer(); |
609 | 614 |
|
610 |
if (lyr instanceof CommonOperations) {
|
|
611 |
CommonOperations c = (CommonOperations) lyr;
|
|
612 |
c.addLayerListener(legendChanges);
|
|
615 |
if (lyr instanceof Classifiable) {
|
|
616 |
Classifiable c = (Classifiable) lyr;
|
|
617 |
c.addLegendListener(legendChanges);
|
|
613 | 618 |
} |
614 | 619 |
} |
615 | 620 |
|
... | ... | |
625 | 630 |
public void layerRemoved(LayerCollectionEvent e) { |
626 | 631 |
FLayer lyr = e.getAffectedLayer(); |
627 | 632 |
|
628 |
if (lyr instanceof CommonOperations) {
|
|
629 |
CommonOperations c = (CommonOperations) lyr;
|
|
630 |
c.removeLayerListener(legendChanges);
|
|
633 |
if (lyr instanceof Classifiable) {
|
|
634 |
Classifiable c = (Classifiable) lyr;
|
|
635 |
c.removeLegendListener(legendChanges);
|
|
631 | 636 |
} |
632 | 637 |
} |
633 | 638 |
|
Also available in: Unified diff