Ignore:
Timestamp:
2010-07-12T16:53:14+02:00 (14 years ago)
Author:
stoecker
Message:

better handling of grey tiles

Location:
applications/editors/josm/plugins/wmsplugin/src/wmsplugin
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/wmsplugin/src/wmsplugin/GeorefImage.java

    r19626 r22286  
    2525        public boolean downloadingStarted;
    2626        public boolean failed = false;
     27        public boolean infotext = false;
    2728
    2829        public GeorefImage(boolean downloadingStarted) {
  • applications/editors/josm/plugins/wmsplugin/src/wmsplugin/Grabber.java

    r19240 r22286  
    8989        image.image = img;
    9090        image.flushedResizedCachedInstance();
    91         image.failed = true;
     91        image.infotext = true;
    9292        image.downloadingStarted = false;
    9393        g.setFont(font);
     
    114114    }
    115115
    116     abstract public boolean loadFromCache();
     116    abstract public boolean loadFromCache(boolean real);
    117117}
  • applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSGrabber.java

    r20891 r22286  
    155155
    156156    @Override
    157         public boolean loadFromCache(){
     157        public boolean loadFromCache(boolean real){
    158158        URL url = null;
    159159        try{
     
    166166        }
    167167        BufferedImage cached = cache.getImg(url.toString());
    168         if(!layer.hasAutoDownload() || cached != null){
     168        if((!real && !layer.hasAutoDownload()) || cached != null){
    169169           image.min = b.min;
    170170           image.max = b.max;
  • applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSLayer.java

    r21796 r22286  
    198198            }
    199199        } else {
    200             downloadAndPaintVisible(g, mv);
     200            downloadAndPaintVisible(g, mv, false);
    201201        }
    202202    }
     
    236236    }
    237237
    238     protected void downloadAndPaintVisible(Graphics g, final MapView mv){
     238    protected void downloadAndPaintVisible(Graphics g, final MapView mv,
     239    boolean real){
    239240        if (usesInvalidUrl)
    240241            return;
     
    249250            for(int y = bminy; y<bmaxy; ++y){
    250251                GeorefImage img = images[modulo(x,dax)][modulo(y,day)];
    251                 if(!img.paint(g, mv, dx, dy) && !img.downloadingStarted){
     252                if((!img.paint(g, mv, dx, dy) || img.infotext) && !img.downloadingStarted){
    252253                    img.downloadingStarted = true;
    253254                    img.image = null;
    254255                    img.flushedResizedCachedInstance();
    255256                    Grabber gr = WMSPlugin.getGrabber(XYtoBounds(x,y), img, mv, this);
    256                     if(!gr.loadFromCache()){
     257                    if(!gr.loadFromCache(real)){
    257258                        gr.setPriority(1);
    258259                        executor.submit(gr);
     
    320321                );
    321322            } else {
    322                 downloadAndPaintVisible(mv.getGraphics(), mv);
     323                downloadAndPaintVisible(mv.getGraphics(), mv, true);
    323324            }
    324325        }
Note: See TracChangeset for help on using the changeset viewer.