Ignore:
Timestamp:
2017-08-22T22:26:32+02:00 (7 years ago)
Author:
Don-vip
Message:

see #15182 - deprecate all Main logging methods and introduce suitable replacements in Logging for most of them

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ThumbsLoader.java

    r12460 r12620  
    2222import org.openstreetmap.josm.data.cache.JCSCacheManager;
    2323import org.openstreetmap.josm.tools.ExifReader;
     24import org.openstreetmap.josm.tools.Logging;
    2425
    2526/**
    2627 * Loads thumbnail previews for a list of images from a {@link GeoImageLayer}.
    27  * 
     28 *
    2829 * Thumbnails are loaded in the background and cached on disk for the next session.
    2930 */
     
    6970                        Main.pref.getCacheDirectory().getPath() + File.separator + "geoimage-thumbnails");
    7071            } catch (IOException e) {
    71                 Main.warn("Failed to initialize cache for geoimage-thumbnails");
    72                 Main.warn(e);
     72                Logging.warn("Failed to initialize cache for geoimage-thumbnails");
     73                Logging.warn(e);
    7374            }
    7475        }
     
    7778    @Override
    7879    public void run() {
    79         Main.debug("Load Thumbnails");
     80        Logging.debug("Load Thumbnails");
    8081        tracker = new MediaTracker(Main.map.mapView);
    8182        for (ImageEntry entry : data) {
     
    104105                BufferedImageCacheEntry cacheEntry = cache.get(cacheIdent);
    105106                if (cacheEntry != null && cacheEntry.getImage() != null) {
    106                     Main.debug(" from cache");
     107                    Logging.debug(" from cache");
    107108                    return cacheEntry.getImage();
    108109                }
    109110            } catch (IOException e) {
    110                 Main.warn(e);
     111                Logging.warn(e);
    111112            }
    112113        }
     
    117118            tracker.waitForID(0);
    118119        } catch (InterruptedException e) {
    119             Main.error(" InterruptedException while loading thumb");
     120            Logging.error(" InterruptedException while loading thumb");
    120121            Thread.currentThread().interrupt();
    121122            return null;
    122123        }
    123124        if (tracker.isErrorID(1) || img.getWidth(null) <= 0 || img.getHeight(null) <= 0) {
    124             Main.error(" Invalid image");
     125            Logging.error(" Invalid image");
    125126            return null;
    126127        }
     
    154155                Thread.sleep(10);
    155156            } catch (InterruptedException e) {
    156                 Main.warn("InterruptedException while drawing thumb");
     157                Logging.warn("InterruptedException while drawing thumb");
    157158                Thread.currentThread().interrupt();
    158159            }
     
    162163
    163164        if (scaledBI.getWidth() <= 0 || scaledBI.getHeight() <= 0) {
    164             Main.error(" Invalid image");
     165            Logging.error(" Invalid image");
    165166            return null;
    166167        }
     
    171172                cache.put(cacheIdent, new BufferedImageCacheEntry(output.toByteArray()));
    172173            } catch (IOException e) {
    173                 Main.warn("Failed to save geoimage thumb to cache");
    174                 Main.warn(e);
     174                Logging.warn("Failed to save geoimage thumb to cache");
     175                Logging.warn(e);
    175176            }
    176177        }
Note: See TracChangeset for help on using the changeset viewer.