Package com.lightcrafts.jai.utils

Examples of com.lightcrafts.jai.utils.LCTileCache$TileReaper


    }

    public synchronized void update(Observable possibleSunTileCache,
                                    Object possibleCachedTile) {

        LCTileCache lc_tile_cache = null;
        CachedTile cached_tile = null;
        int cache_event = -1;

        // check SunTileCache
        if ( possibleSunTileCache instanceof LCTileCache ) {
            lc_tile_cache = (LCTileCache) possibleSunTileCache;
        } else {
            return;
        }

        // check cached tile
        if ( (possibleCachedTile != null) &&
             (possibleCachedTile instanceof CachedTile) ) {
            cached_tile = (CachedTile) possibleCachedTile;
            cache_event = cached_tile.getAction();

            if ( cache_event == CACHE_EVENT_ABOUT_TO_REMOVE_TILE ) {
                return;
            }
        } else {
            return;
        }

        // collect information
        RenderedImage image  = (RenderedImage) cached_tile.getOwner();

        final long tileSize    = cached_tile.getTileSize();
        final long timeStamp   = cached_tile.getTileTimeStamp();
        final long cacheHits   = lc_tile_cache.getCacheHitCount();
        final long cacheMisses = lc_tile_cache.getCacheMissCount();
        final long tileCount   = lc_tile_cache.getCacheTileCount();

        float memoryCapacity = (float) lc_tile_cache.getMemoryCapacity();
        float memoryUsage    = (float) lc_tile_cache.getCacheMemoryUsed();
        final int percentTCM = (int) ((100.0F * memoryUsage / memoryCapacity) + 0.5F);

        String jai_op;

        // image can be null if it was garbage collected
View Full Code Here


            } else {
                // System.out.println("slow repaint done");
            }
            TileCache tileCache = JAI.getDefaultInstance().getTileCache();
            if (tileCache instanceof LCTileCache) {
                LCTileCache tc = (LCTileCache) tileCache;
                if (tilesRead != tc.tilesRead() || tilesWritten != tc.tilesWritten() || tilesOnDisk != tc.tilesOnDisk()) {
                    tilesRead = tc.tilesRead();
                    tilesWritten = tc.tilesWritten();
                    tilesOnDisk = tc.tilesOnDisk();
                    System.out.println("Tile Cache Statistics r: " + tilesRead + ", w: " + tilesWritten + ", on disk: " + tilesOnDisk);
                }
            }

            for (Preview preview : previews) {
View Full Code Here

TOP

Related Classes of com.lightcrafts.jai.utils.LCTileCache$TileReaper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.