Revision 490 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/NewMapControl.java
NewMapControl.java | ||
---|---|---|
4 | 4 |
import com.hardcode.gdbms.engine.data.DriverException; |
5 | 5 |
import com.iver.cit.gvsig.fmap.drivers.DriverIOException; |
6 | 6 |
import com.iver.cit.gvsig.fmap.operations.Cancellable; |
7 |
import com.iver.cit.gvsig.fmap.tools.OpenDialogListener; |
|
8 | 7 |
import com.iver.cit.gvsig.fmap.tools.Behavior.MapTool; |
9 | 8 |
import com.iver.cit.gvsig.fmap.tools.Listeners.ToolListener; |
10 | 9 |
|
... | ... | |
58 | 57 |
private ViewPort vp; |
59 | 58 |
private Color backColor = Color.WHITE; |
60 | 59 |
private Drawer drawer; |
61 |
private OpenDialogListener odl; |
|
60 |
|
|
62 | 61 |
private MapToolListener mapToolListener = new MapToolListener(); |
63 | 62 |
|
63 |
private MapContextListener mapContextListener = new MapContextListener(); |
|
64 |
|
|
64 | 65 |
private static Logger logger = Logger.getLogger(NewMapControl.class.getName()); |
65 | 66 |
/** |
66 | 67 |
* Crea un nuevo NewMapControl. |
... | ... | |
129 | 130 |
* @param model DOCUMENT ME! |
130 | 131 |
*/ |
131 | 132 |
public void setMapContext(FMap model) { |
133 |
if (mapContext != null){ |
|
134 |
mapContext.removeInvalidationListener(mapContextListener); |
|
135 |
} |
|
136 |
|
|
132 | 137 |
mapContext = model; |
133 | 138 |
if (mapContext.getViewPort()==null){ |
134 | 139 |
mapContext.setViewPort(vp); |
135 | 140 |
}else{ |
136 | 141 |
vp = mapContext.getViewPort(); |
137 | 142 |
} |
138 |
// mapContext.setViewPort(vp); |
|
143 |
|
|
144 |
mapContext.addInvalidationListener(mapContextListener); |
|
139 | 145 |
} |
140 | 146 |
|
141 | 147 |
/** |
... | ... | |
319 | 325 |
public void setBackColor(Color backColor) { |
320 | 326 |
this.backColor = backColor; |
321 | 327 |
} |
322 |
public void setOpenDialogListener(OpenDialogListener odl){ |
|
323 |
this.odl=odl; |
|
324 |
} |
|
328 |
|
|
325 | 329 |
/** |
326 | 330 |
* DOCUMENT ME! |
327 | 331 |
* |
... | ... | |
492 | 496 |
} |
493 | 497 |
} |
494 | 498 |
} |
499 |
|
|
500 |
public class MapContextListener implements InvalidationListener{ |
|
501 |
|
|
502 |
/** |
|
503 |
* @see com.iver.cit.gvsig.fmap.InvalidationListener#invalid() |
|
504 |
*/ |
|
505 |
public void invalid() { |
|
506 |
NewMapControl.this.drawMap(); |
|
507 |
} |
|
508 |
|
|
509 |
} |
|
495 | 510 |
} |
Also available in: Unified diff