Changeset 4017 in josm for trunk/src/org/openstreetmap/josm/gui
- Timestamp:
- 2011-04-06T15:34:02+02:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java
r3921 r4017 435 435 @Override 436 436 public void run() { 437 Main.map.mapView.addMouseListener(new MouseAdapter() {437 final MouseAdapter adapter = new MouseAdapter() { 438 438 @Override 439 439 public void mouseClicked(MouseEvent e) { 440 if (!isVisible()) return; 440 441 if (e.getButton() == MouseEvent.BUTTON3) { 441 442 clickedTile = getTileForPixelpos(e.getX(), e.getY()); … … 466 467 } 467 468 } 468 }); 469 }; 470 Main.map.mapView.addMouseListener(adapter); 469 471 470 472 MapView.addLayerChangeListener(new LayerChangeListener() { … … 481 483 @Override 482 484 public void layerRemoved(Layer oldLayer) { 483 MapView.removeLayerChangeListener(this); 485 if (oldLayer == TMSLayer.this) { 486 Main.map.mapView.removeMouseListener(adapter); 487 MapView.removeLayerChangeListener(this); 488 } 484 489 } 485 490 });
Note:
See TracChangeset
for help on using the changeset viewer.