foul-magics/Mage.Client/src/main/java/mage/client/util/ImageCaches.java
draxdyn 1999dfe5c0 Add mechanism to register image caches and flush them all on GUI size change
This should avoid the issue of having lots of unused entries in caches if the
GUI size is changed multiple times.
2016-06-23 16:21:34 +02:00

34 lines
645 B
Java

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package mage.client.util;
import java.util.Map;
import java.util.Vector;
/**
*
* @author user
*/
public class ImageCaches {
private static Vector<Map> IMAGE_CACHES;
static {
IMAGE_CACHES = new Vector<Map>();
}
public static Map register(Map map)
{
IMAGE_CACHES.add(map);
return map;
}
public static void flush()
{
for (Map map : IMAGE_CACHES) {
map.clear();
}
}
}