Example #1
0
 /** Used to load and cache tilesets loaded via {@link #loadTileSet}. */
 protected UniformTileSet loadCachedTileSet(String bundle, String imgPath, int width, int height) {
   String key = bundle + "::" + imgPath;
   SoftReference<UniformTileSet> ref = _handcache.get(key);
   UniformTileSet uts = (ref == null) ? null : ref.get();
   if (uts == null) {
     uts = new UniformTileSet();
     uts.setImageProvider(_defaultProvider);
     uts.setImagePath(imgPath);
     uts.setWidth(width);
     uts.setHeight(height);
     _handcache.put(key, new SoftReference<UniformTileSet>(uts));
   }
   return uts;
 }