Reformatted

This commit is contained in:
7u83 2018-12-04 15:31:34 +01:00
parent 6bb6d88371
commit 03fbd9cd25

View File

@ -219,8 +219,9 @@ public class Globals {
asset_types.add(a); asset_types.add(a);
}); });
if (!sort) if (!sort) {
return asset_types; return asset_types;
}
asset_types.sort(new Comparator<Class<AbstractAsset>>() { asset_types.sort(new Comparator<Class<AbstractAsset>>() {
@Override @Override
@ -260,6 +261,9 @@ public class Globals {
Collection<Class> lafs; Collection<Class> lafs;
// lafs = opensesim.util.XClassLoader.getClassesList(urllist, LookAndFeel.class); // lafs = opensesim.util.XClassLoader.getClassesList(urllist, LookAndFeel.class);
lafs = class_cache.getClassCollection(LookAndFeel.class); lafs = class_cache.getClassCollection(LookAndFeel.class);
if (lafs == null) {
return;
}
ClassLoader currentThreadClassLoader ClassLoader currentThreadClassLoader
= Thread.currentThread().getContextClassLoader(); = Thread.currentThread().getContextClassLoader();
@ -300,7 +304,6 @@ public class Globals {
prefs = Preferences.userNodeForPackage(c); prefs = Preferences.userNodeForPackage(c);
// world = new World(); // world = new World();
// initialize urllist used by class loader // initialize urllist used by class loader
updateUrlList(); updateUrlList();
@ -342,15 +345,16 @@ public class Globals {
return new JSONObject(assets_json); return new JSONObject(assets_json);
} }
static public final void putAssets(JSONObject assets){ static public final void putAssets(JSONObject assets) {
prefs.put(PrefKeys.ASSETS, assets.toString()); prefs.put(PrefKeys.ASSETS, assets.toString());
} }
static public final JSONObject getExchanges(){ static public final JSONObject getExchanges() {
String json = prefs.get(PrefKeys.EXCHANGES, "{}"); String json = prefs.get(PrefKeys.EXCHANGES, "{}");
return new JSONObject(json); return new JSONObject(json);
} }
static public final void putExchanges(JSONObject e){
static public final void putExchanges(JSONObject e) {
prefs.put(PrefKeys.EXCHANGES, e.toString()); prefs.put(PrefKeys.EXCHANGES, e.toString());
} }
@ -361,8 +365,6 @@ public class Globals {
return traders; return traders;
} }
static public final JSONObject getStrategies() { static public final JSONObject getStrategies() {
String cfglist = Globals.prefs.get(PrefKeys.STRATEGIES, "{}"); String cfglist = Globals.prefs.get(PrefKeys.STRATEGIES, "{}");
JSONObject cfgs = new JSONObject(cfglist); JSONObject cfgs = new JSONObject(cfglist);
@ -445,7 +447,6 @@ public class Globals {
} }
public static void clearAll() { public static void clearAll() {
putStrategies(new JSONObject()); putStrategies(new JSONObject());
putTraders(new JSONArray()); putTraders(new JSONArray());
@ -461,8 +462,7 @@ public class Globals {
} }
public static JSONObject getWorld() {
public static JSONObject getWorld(){
JSONObject cfg = new JSONObject(); JSONObject cfg = new JSONObject();
cfg.put(World.JKEYS.ASSETS, getAssets()); cfg.put(World.JKEYS.ASSETS, getAssets());
cfg.put(World.JKEYS.EXCHANGES, getExchanges()); cfg.put(World.JKEYS.EXCHANGES, getExchanges());