Some refactoring / removed current test classes

This commit is contained in:
2018-12-03 00:03:44 +01:00
parent 59998baa08
commit c30524b388
30 changed files with 245 additions and 526 deletions

View File

@ -30,8 +30,8 @@ import java.awt.Window;
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import opensesim.AbstractAsset;
import opensesim.World;
import opensesim.world.AbstractAsset;
import opensesim.world.World;
import opensesim.gui.util.EscDialog;
import opensesim.gui.Globals;

View File

@ -33,7 +33,7 @@ import javax.swing.ComboBoxModel;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JDialog;
import javax.swing.JPanel;
import opensesim.AbstractAsset;
import opensesim.world.AbstractAsset;
import opensesim.gui.Globals;
import opensesim.gui.util.Json.Export;
import opensesim.gui.util.Json.Import;

View File

@ -30,8 +30,8 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
import opensesim.AbstractAsset;
import opensesim.World;
import opensesim.world.AbstractAsset;
import opensesim.world.World;
import opensesim.gui.Globals;
import org.json.JSONObject;

View File

@ -31,7 +31,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.ComboBoxModel;
import javax.swing.DefaultComboBoxModel;
import opensesim.AbstractAsset;
import opensesim.world.AbstractAsset;
import opensesim.gui.Globals;
import opensesim.gui.util.EscDialog;

View File

@ -1,8 +1,8 @@
package opensesim.gui.AssetPairEditor;
import java.util.Collection;
import opensesim.AbstractAsset;
import opensesim.World;
import opensesim.world.AbstractAsset;
import opensesim.world.World;
import opensesim.gui.Globals;
/*

View File

@ -25,7 +25,7 @@
*/
package opensesim.gui.AssetPairEditor;
import opensesim.World;
import opensesim.world.World;
import opensesim.gui.util.EscDialog;
import opensesim.gui.Globals;

View File

@ -47,8 +47,8 @@ import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.LookAndFeel;
import javax.swing.UIManager;
import opensesim.AbstractAsset;
import opensesim.World;
import opensesim.world.AbstractAsset;
import opensesim.world.World;
import opensesim.gui.AssetEditor.AssetEditorPanel;
import org.json.JSONArray;
import org.json.JSONObject;
@ -299,7 +299,7 @@ public class Globals {
prefs = Preferences.userNodeForPackage(c);
world = new World();
// world = new World();
// initialize urllist used by class loader
updateUrlList();
@ -444,6 +444,13 @@ public class Globals {
putTraders(traders);
}
public static JSONObject getWorld(){
JSONObject world = new JSONObject();
world.put(PrefKeys.ASSETS, getAssets());
world.put(PrefKeys.EXCHANGES, getExchanges());
return world;
}
public static void clearAll() {
putStrategies(new JSONObject());

View File

@ -597,6 +597,12 @@ public class SeSimApplication extends javax.swing.JFrame {
}
void startSim() {
// World = new World();
resetSim();
JSONObject jo = new JSONObject(Globals.prefs.get("Exchange", "{}"));
@ -990,10 +996,11 @@ public class SeSimApplication extends javax.swing.JFrame {
Class<?> c = opensesim.gui.SeSimApplication.class;
Globals.initGlobals(c);
String world_source = Globals.prefs.get("world", "{}");
/* String world_source = Globals.prefs.get("world", "{}");
JSONObject world = new org.json.JSONObject(world_source);
Globals.world.putConfig(world);
*/
//Globals.installLookAndFeels();

View File

@ -25,8 +25,8 @@
*/
package opensesim.gui.exchangeeditor;
import opensesim.Exchange;
import opensesim.World;
import opensesim.world.Exchange;
import opensesim.world.World;
import opensesim.gui.Globals;
import opensesim.gui.util.Json.Export;
import opensesim.gui.util.Json.Import;

View File

@ -27,9 +27,9 @@ package opensesim.gui.exchangeeditor;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
import opensesim.World;
import opensesim.world.World;
import opensesim.gui.Globals;
import opensesim.Exchange;
import opensesim.world.Exchange;
import org.json.JSONObject;
/**