Changeset 19239 in osm for applications
- Timestamp:
- 2009-12-30T14:16:56+01:00 (15 years ago)
- Location:
- applications/editors/josm/plugins/wmsplugin/src/wmsplugin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/wmsplugin/src/wmsplugin/Grabber.java
r18942 r19239 73 73 image.flushedResizedCachedInstance(); 74 74 image.failed = true; 75 image.downloadingStarted = false; 76 g.setFont(font); 77 } 78 79 protected void grabNotInCache(){ // report not in cache 80 BufferedImage img = new BufferedImage(width(), height(), BufferedImage.TYPE_INT_ARGB); 81 Graphics g = img.getGraphics(); 82 g.setColor(Color.GRAY); 83 g.fillRect(0, 0, width(), height()); 84 Font font = g.getFont(); 85 Font tempFont = font.deriveFont(Font.PLAIN).deriveFont(36.0f); 86 g.setFont(tempFont); 87 g.setColor(Color.BLACK); 88 g.drawString(tr("Not in cache"), 10, height()/2); 89 image.image = img; 90 image.flushedResizedCachedInstance(); 91 image.failed = true; 92 image.downloadingStarted = false; 75 93 g.setFont(font); 76 94 } -
applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSGrabber.java
r18761 r19239 66 66 67 67 if(image.isVisible(mv, layer.getDx(), layer.getDy())) { //don't download, if the image isn't visible already 68 image.image = grab(url); 68 BufferedImage img = grab(url); 69 if(img == null)return; 70 image.image = img; 69 71 image.flushedResizedCachedInstance(); 70 72 } … … 154 156 protected BufferedImage grab(URL url) throws IOException, OsmTransferException { 155 157 BufferedImage cached = cache.getImg(url.toString()); 156 if(cached != null) return cached; 158 if(!layer.hasAutoDownload() || cached != null){ 159 if(cached == null) grabNotInCache(); 160 return cached; 161 } 157 162 158 163 System.out.println("Grabbing WMS " + url); -
applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSLayer.java
r18949 r19239 96 96 } 97 97 resolution = mv.getDist100PixelText(); 98 pixelPerDegree = getPPD();99 98 100 99 executor = Executors.newFixedThreadPool(3); … … 113 112 } 114 113 114 public boolean hasAutoDownload(){ 115 return startstop.isSelected(); 116 } 117 115 118 public double getDx(){ 116 119 return dx; … … 177 180 if (usesInvalidUrl && !isInvalidUrlConfirmed) return; 178 181 179 if( !startstop.isSelected() || (pixelPerDegree / getPPD() > minZoom)){ //don't download when it's too outzoomed182 if(pixelPerDegree / getPPD() > minZoom){ //don't download when it's too outzoomed 180 183 for(int x = 0; x<dax; ++x) { 181 184 for(int y = 0; y<day; ++y) { … … 461 464 } 462 465 Main.pref.put("wmsplugin.url."+ i +".url",baseURL ); 463 Main.pref.put("wmsplugin.url."+String.valueOf(i)+".name", baseName + "#" + getPPD() ); 466 Main.pref.put("wmsplugin.url."+String.valueOf(i)+".name", baseName + "#PPD=" + getPPD() ); 464 467 WMSPlugin.refreshMenu(); 465 468 }
Note:
See TracChangeset
for help on using the changeset viewer.