Ticket #1954: WMS Invalidate.patch

File WMS Invalidate.patch, 2.2 KB (added by xeen, 17 years ago)

Delete cached copy whenever there are changes being made to GeoRefImage.image

  • src/wmsplugin/Grabber.java

     
    5252        g.setColor(Color.BLACK);
    5353        g.drawString(tr("Exception occurred"), 10, height()/2);
    5454        image.image = img;
     55        image.flushedResizedCachedInstance();
    5556        image.failed = true;
    5657        g.setFont(font);
    5758    }
  • src/wmsplugin/WMSGrabber.java

     
    5555            image.min = proj.latlon2eastNorth(b.min);
    5656            image.max = proj.latlon2eastNorth(b.max);
    5757
    58             if(image.isVisible(mv)) //don't download, if the image isn't visible already
     58            if(image.isVisible(mv)) { //don't download, if the image isn't visible already
    5959                image.image = grab(url);
     60                image.flushedResizedCachedInstance();
     61            }
    6062            image.downloadingStarted = false;
    6163        } catch(Exception e) {
    6264            throw new Exception(e.getMessage() + "\nImage couldn't be fetched: " + (url != null ? url.toString() : ""));
  • src/wmsplugin/WMSLayer.java

     
    171171                if(!img.paint(g, mv, dx, dy) && !img.downloadingStarted){
    172172                    img.downloadingStarted = true;
    173173                    img.image = null;
     174                    img.flushedResizedCachedInstance();
    174175                    Grabber gr = WMSPlugin.getGrabber(baseURL, XYtoBounds(x,y), Main.main.proj, pixelPerDegree, img, mv, this);
    175176                    executor.submit(gr);
    176177            }
     
    249250                for (int y = 0; y < day; ++y) {
    250251                    GeorefImage img = images[modulo(x,dax)][modulo(y,day)];
    251252                    img.image = null;
     253                    img.flushedResizedCachedInstance();
    252254                    img.downloadingStarted = false;
    253255                    img.failed = false;
    254256                    mv.repaint();