Changeset 4306 in josm for trunk/src/org
- Timestamp:
- 2011-08-10T16:51:15+02:00 (13 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java
r4301 r4306 337 337 TileSource source = getTileSource(info); 338 338 if (source == null) 339 throw new IllegalStateException(" cannot create TMSLayer with non-TMS ImageryInfo");339 throw new IllegalStateException("Cannot create TMSLayer with non-TMS ImageryInfo"); 340 340 initTileSource(source); 341 341 … … 379 379 public void actionPerformed(ActionEvent ae) { 380 380 if (clickedTile != null) { 381 loadTile(clickedTile );381 loadTile(clickedTile, true); 382 382 redraw(); 383 383 } … … 413 413 public void actionPerformed(ActionEvent ae) { 414 414 loadAllTiles(true); 415 redraw(); 416 } 417 })); 418 419 tileOptionMenu.add(new JMenuItem(new AbstractAction( 420 tr("Load All Error Tiles")) { 421 @Override 422 public void actionPerformed(ActionEvent ae) { 423 loadAllErrorTiles(true); 415 424 redraw(); 416 425 } … … 644 653 } 645 654 646 synchronized boolean loadTile(Tile tile )655 synchronized boolean loadTile(Tile tile, boolean force) 647 656 { 648 657 if (tile == null) 649 658 return false; 650 if (tile.hasError()) 651 return false; 652 if (tile.isLoaded()) 659 if (!force && (tile.hasError() || tile.isLoaded())) 653 660 return false; 654 661 if (tile.isLoading()) … … 672 679 // load all tiles! 673 680 if (ts.tooLarge()) { 674 System.out.println("Not downloading all tiles because there is more than 18 tiles on an axis!");681 Main.warn("Not downloading all tiles because there is more than 18 tiles on an axis!"); 675 682 return; 676 683 } 677 684 ts.loadAllTiles(force); 685 } 686 687 void loadAllErrorTiles(boolean force) { 688 MapView mv = Main.map.mapView; 689 EastNorth topLeft = mv.getEastNorth(0, 0); 690 EastNorth botRight = mv.getEastNorth(mv.getWidth(), mv.getHeight()); 691 692 TileSet ts = new TileSet(topLeft, botRight, currentZoomLevel); 693 694 ts.loadAllErrorTiles(force); 678 695 } 679 696 … … 1014 1031 void loadAllTiles(boolean force) 1015 1032 { 1016 List<Tile> tiles = this.allTiles(true);1017 1033 if (!autoLoad && !force) 1018 1034 return; 1019 int nr_queued = 0; 1020 for (Tile t : tiles) { 1021 if (loadTile(t)) { 1022 nr_queued++; 1035 for (Tile t : this.allTiles(true)) { 1036 loadTile(t, false); 1037 } 1038 } 1039 1040 void loadAllErrorTiles(boolean force) 1041 { 1042 if (!autoLoad && !force) 1043 return; 1044 for (Tile t : this.allTiles(true)) { 1045 if (t.hasError()) { 1046 loadTile(t, true); 1023 1047 } 1024 1048 } 1025 /*if (debug)1026 if (nr_queued > 0) {1027 Main.debug("queued to load: " + nr_queued + "/" + tiles.size() + " tiles at zoom: " + zoom);1028 }*/1029 1049 } 1030 1050 } -
trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
r4146 r4306 802 802 String toolbar = (String) tb; 803 803 Action r = actions.get(toolbar); 804 if(r != null && r != action) {804 if(r != null && r != action && !toolbar.startsWith("imagery_")) { 805 805 System.out.println(tr("Toolbar action {0} overwritten: {1} gets {2}", 806 806 toolbar, r.getClass().getName(), action.getClass().getName()));
Note:
See TracChangeset
for help on using the changeset viewer.