, , , . (, PLIST ~/Library Mac OS X, gconf Gnome, Windows), java.util.prefs.Preferences - /. , Preferences , , , . , :
public class AnimationSettings {
private static final String VELOCITY_KEY = "velocity";
private static final double VELOCITY_DEFAULT = 5.0;
public static double getVelocity() {
return getPrefs().getDouble(VELOCITY_KEY, VELOCITY_DEFAULT);
}
public static void setVelocity(int velocity) {
getPrefs().putDouble(VELOCITY_KEY, velocity);
}
public static void sync() {
getPrefs().sync();
}
private static Preferences getPrefs() {
if (preferences_ == null) {
preferences_ = Preferences.userNodeForPackage(AnimationSettings.class);
}
return preferences_;
}
private static Preferences preferences_ = null;
};
double velocity = AnimationSettings.getVelocity();
, Preferences , . XML/*.properties , . XML , , , , , (, ), , , .. .