X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altosuilib%2FAltosUIPreferences.java;h=c8ae9a7d5cc8884b52d19a8af080f3db40fc5041;hb=e3b30d4bd6faf68c885791fb87229558cc1157a6;hp=ecab20d4ee7e54846660002fe4a5775dad110b5d;hpb=bd440afc2a6e37b74fffcf1b977e149485095316;p=fw%2Faltos diff --git a/altosuilib/AltosUIPreferences.java b/altosuilib/AltosUIPreferences.java index ecab20d4..c8ae9a7d 100644 --- a/altosuilib/AltosUIPreferences.java +++ b/altosuilib/AltosUIPreferences.java @@ -3,7 +3,8 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of @@ -15,13 +16,13 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_3; +package org.altusmetrum.altosuilib_11; import java.io.*; import java.util.*; import java.awt.Component; import javax.swing.*; -import org.altusmetrum.altoslib_5.*; +import org.altusmetrum.altoslib_11.*; public class AltosUIPreferences extends AltosPreferences { @@ -55,10 +56,6 @@ public class AltosUIPreferences extends AltosPreferences { public static int position = AltosUILib.position_top_left; - static LinkedList map_cache_listeners; - - public static int map_cache = 9; - public static void init() { AltosPreferences.init(new AltosUIPreferencesBackend()); @@ -75,9 +72,6 @@ public class AltosUIPreferences extends AltosPreferences { position = backend.getInt(positionPreference, AltosUILib.position_top_left); position_listeners = new LinkedList(); - - map_cache = backend.getInt(mapCachePreference, 9); - map_cache_listeners = new LinkedList(); } static { init(); } @@ -225,32 +219,4 @@ public class AltosUIPreferences extends AltosPreferences { 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; - } - } }