* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-package org.altusmetrum.altosuilib_7;
+package org.altusmetrum.altosuilib_9;
import java.io.*;
import java.util.*;
import java.awt.Component;
import javax.swing.*;
-import org.altusmetrum.altoslib_7.*;
+import org.altusmetrum.altoslib_9.*;
public class AltosUIPreferences extends AltosPreferences {
public static int position = AltosUILib.position_top_left;
- static LinkedList<AltosUIMapCacheListener> map_cache_listeners;
-
- public static int map_cache = 9;
-
public static void init() {
AltosPreferences.init(new AltosUIPreferencesBackend());
position = backend.getInt(positionPreference, AltosUILib.position_top_left);
position_listeners = new LinkedList<AltosPositionListener>();
-
- map_cache = backend.getInt(mapCachePreference, 9);
- map_cache_listeners = new LinkedList<AltosUIMapCacheListener>();
}
static { init(); }
return position;
}
}
-
- public static void register_map_cache_listener(AltosUIMapCacheListener l) {
- synchronized(backend) {
- map_cache_listeners.add(l);
- }
- }
-
- public static void unregister_map_cache_listener(AltosUIMapCacheListener l) {
- synchronized (backend) {
- map_cache_listeners.remove(l);
- }
- }
-
- public static void set_map_cache(int new_map_cache) {
- synchronized(backend) {
- map_cache = new_map_cache;
- backend.putInt(mapCachePreference, map_cache);
- flush_preferences();
- for (AltosUIMapCacheListener l: map_cache_listeners)
- l.map_cache_changed(map_cache);
- }
- }
-
- public static int map_cache() {
- synchronized(backend) {
- return map_cache;
- }
- }
}