Revision 1003
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/NewMapControl.java | ||
---|---|---|
3 | 3 |
import com.iver.cit.gvsig.fmap.layers.LayerEvent; |
4 | 4 |
import com.iver.cit.gvsig.fmap.operations.Cancellable; |
5 | 5 |
import com.iver.cit.gvsig.fmap.tools.Behavior.MapTool; |
6 |
import com.iver.cit.gvsig.fmap.tools.Behavior.PointMapTool; |
|
7 |
import com.iver.cit.gvsig.fmap.tools.Behavior.StatusMapTool; |
|
6 | 8 |
import com.iver.cit.gvsig.fmap.tools.BehaviorException; |
9 |
import com.iver.cit.gvsig.fmap.tools.Listeners.PointListener; |
|
7 | 10 |
import com.iver.cit.gvsig.fmap.tools.Listeners.ToolListener; |
8 | 11 |
|
9 | 12 |
import com.iver.utiles.exceptionHandling.ExceptionHandlingSupport; |
... | ... | |
14 | 17 |
import org.cresques.cts.IProjection; |
15 | 18 |
import org.cresques.cts.ProjectionPool; |
16 | 19 |
|
17 |
import java.awt.Color; |
|
18 | 20 |
import java.awt.Dimension; |
19 | 21 |
import java.awt.Graphics; |
20 | 22 |
import java.awt.Graphics2D; |
... | ... | |
52 | 54 |
private HashMap namesMapToolsNames = new HashMap(); |
53 | 55 |
private HashMap nameListener = new HashMap(); |
54 | 56 |
private MapTool currentMapTool = null; |
57 |
private MapTool alwaysMapTool = null; |
|
55 | 58 |
private int status = ACTUALIZADO; |
56 | 59 |
private BufferedImage image = null; |
57 | 60 |
private String currentTool; |
... | ... | |
113 | 116 |
vp = mapContext.getViewPort(); |
114 | 117 |
|
115 | 118 |
// vp.setImageSize(new Dimension(getWidth(), getHeight())); |
116 |
// System.err.println("Viewport en setMapContext:" + vp);
|
|
119 |
//System.err.println("Viewport en setMapContext:" + vp); |
|
117 | 120 |
} |
118 | 121 |
|
119 | 122 |
mapContext.addAtomicEventListener(mapContextListener); |
... | ... | |
176 | 179 |
/** |
177 | 180 |
* DOCUMENT ME! |
178 | 181 |
* |
182 |
* @param pl DOCUMENT ME! |
|
183 |
*/ |
|
184 |
public void setAlwaysMapTool(ToolListener pl) { |
|
185 |
StatusMapTool pmt = new StatusMapTool(); |
|
186 |
pmt.setListener(pl); |
|
187 |
alwaysMapTool = pmt; |
|
188 |
} |
|
189 |
|
|
190 |
/** |
|
191 |
* DOCUMENT ME! |
|
192 |
* |
|
179 | 193 |
* @param toolName DOCUMENT ME! |
180 | 194 |
*/ |
181 | 195 |
public void setTool(String toolName) { |
... | ... | |
231 | 245 |
* @see javax.swing.JComponent#paintComponent(java.awt.Graphics) |
232 | 246 |
*/ |
233 | 247 |
protected void paintComponent(Graphics g) { |
234 |
if (status == ACTUALIZADO) { |
|
248 |
if (status == ACTUALIZADO) {
|
|
235 | 249 |
logger.debug("Dibujando la imagen obtenida"); |
236 | 250 |
|
237 | 251 |
/* |
... | ... | |
432 | 446 |
*/ |
433 | 447 |
public void mouseEntered(MouseEvent e) { |
434 | 448 |
try { |
449 |
alwaysMapTool.mouseEntered(e); |
|
435 | 450 |
currentMapTool.mouseEntered(e); |
436 | 451 |
} catch (BehaviorException t) { |
437 | 452 |
throwException(t); |
... | ... | |
498 | 513 |
*/ |
499 | 514 |
public void mouseMoved(MouseEvent e) { |
500 | 515 |
try { |
516 |
alwaysMapTool.mouseMoved(e); |
|
501 | 517 |
currentMapTool.mouseMoved(e); |
502 | 518 |
} catch (BehaviorException t) { |
503 | 519 |
throwException(t); |
... | ... | |
511 | 527 |
* @author Fernando Gonz?lez Cort?s |
512 | 528 |
*/ |
513 | 529 |
public class MapContextListener implements AtomicEventListener { |
530 |
|
|
514 | 531 |
/** |
515 | 532 |
* @see com.iver.cit.gvsig.fmap.AtomicEventListener#atomicEvent(com.iver.cit.gvsig.fmap.AtomicEvent) |
516 | 533 |
*/ |
... | ... | |
523 | 540 |
redraw = true; |
524 | 541 |
} |
525 | 542 |
} |
526 |
|
|
527 | 543 |
if (e.getColorEvents().length > 0) { |
528 | 544 |
redraw = true; |
529 | 545 |
} |
530 |
|
|
531 | 546 |
if (e.getExtentEvents().length > 0) { |
532 | 547 |
redraw = true; |
533 | 548 |
} |
Also available in: Unified diff