Merge branches/froyo_12.03 to head.
[debian/openrocket] / android / src / net / sf / openrocket / android / Application.java
index 43e6254221dac01080b4567cd472733b204e23c0..9661f400dd3e84f0b534f5d608397d48252fd4ad 100644 (file)
@@ -1,30 +1,17 @@
 package net.sf.openrocket.android;\r
 \r
-import java.io.File;\r
-import java.io.IOException;\r
 import java.util.Locale;\r
 \r
-import net.sf.openrocket.aerodynamics.WarningSet;\r
 import net.sf.openrocket.android.util.AndroidLogWrapper;\r
 import net.sf.openrocket.database.ComponentPresetDatabase;\r
-import net.sf.openrocket.document.OpenRocketDocument;\r
-import net.sf.openrocket.document.Simulation;\r
-import net.sf.openrocket.file.openrocket.OpenRocketSaver;\r
 import net.sf.openrocket.l10n.DebugTranslator;\r
 import net.sf.openrocket.l10n.ResourceBundleTranslator;\r
 import net.sf.openrocket.l10n.Translator;\r
-import net.sf.openrocket.rocketcomponent.Rocket;\r
 import android.content.pm.ApplicationInfo;\r
-import android.net.Uri;\r
 import android.preference.PreferenceManager;\r
 \r
 public class Application extends android.app.Application {\r
 \r
-       private OpenRocketDocument rocketDocument;\r
-       private Uri fileUri;\r
-\r
-       private WarningSet warnings;\r
-\r
        // Big B boolean so I can synchronize on it.\r
        private static Boolean initialized = false;\r
 \r
@@ -41,7 +28,12 @@ public class Application extends android.app.Application {
 \r
                        net.sf.openrocket.startup.Application.setPreferences( new PreferencesAdapter() );\r
 \r
-                       net.sf.openrocket.startup.Application.setComponentPresetDao( new ComponentPresetDatabase() );\r
+                       net.sf.openrocket.startup.Application.setComponentPresetDao( new ComponentPresetDatabase(){\r
+                               @Override\r
+                               protected void load() {\r
+                                       // We don't need components\r
+                               } \r
+                       } );\r
 \r
                        MotorDatabaseAdapter db = new MotorDatabaseAdapter(this);\r
 \r
@@ -74,69 +66,4 @@ public class Application extends android.app.Application {
                PreferencesActivity.initializePreferences(this, PreferenceManager.getDefaultSharedPreferences(this));\r
        }\r
 \r
-       private RocketChangedEventHandler handler;\r
-       \r
-       public void setHandler( RocketChangedEventHandler handler ) {\r
-               this.handler = handler;\r
-       }\r
-       \r
-       /**\r
-        * @return the rocketDocument\r
-        */\r
-       public OpenRocketDocument getRocketDocument() {\r
-               return rocketDocument;\r
-       }\r
-\r
-       public void addNewSimulation() {\r
-               Rocket rocket = rocketDocument.getRocket();\r
-               Simulation newSim = new Simulation(rocket);\r
-               newSim.setName(rocketDocument.getNextSimulationName());\r
-               rocketDocument.addSimulation(newSim);\r
-               if ( handler != null ) {\r
-                       handler.simsChangedMessage();\r
-               }\r
-       }\r
-       \r
-       public void deleteSimulation( int simulationPos ) {\r
-               rocketDocument.removeSimulation( simulationPos );\r
-               if ( handler != null ) {\r
-                       handler.simsChangedMessage();\r
-               }\r
-       }\r
-       \r
-       public String addNewMotorConfig() {\r
-               String configId = rocketDocument.getRocket().newMotorConfigurationID();\r
-               if ( handler != null ) {\r
-                       handler.configsChangedMessage();\r
-               }\r
-               return configId;\r
-       }\r
-       /**\r
-        * @param rocketDocument the rocketDocument to set\r
-        */\r
-       public void setRocketDocument(OpenRocketDocument rocketDocument) {\r
-               this.rocketDocument = rocketDocument;\r
-       }\r
-\r
-       public WarningSet getWarnings() {\r
-               return warnings;\r
-       }\r
-\r
-       public void setWarnings(WarningSet warnings) {\r
-               this.warnings = warnings;\r
-       }\r
-\r
-       public Uri getFileUri() {\r
-               return fileUri;\r
-       }\r
-\r
-       public void setFileUri(Uri fileUri) {\r
-               this.fileUri = fileUri;\r
-       }\r
-\r
-       public void saveOpenRocketDocument() throws IOException {\r
-               OpenRocketSaver saver = new OpenRocketSaver();\r
-               saver.save(new File(fileUri.getPath()),rocketDocument);\r
-\r
-       }\r
 }\r