import javax.swing.Timer;
import javax.swing.ToolTipManager;
+import net.sf.openrocket.arch.SystemInfo;
+import net.sf.openrocket.arch.SystemInfo.Platform;
import net.sf.openrocket.communication.UpdateInfo;
import net.sf.openrocket.communication.UpdateInfoRetriever;
import net.sf.openrocket.database.ComponentPresetDatabase;
VersionHelper.checkVersion();
VersionHelper.checkOpenJDK();
+ // If running on a MAC set up OSX UI Elements.
+ if ( SystemInfo.getPlatform() == Platform.MAC_OS ){
+ OSXStartup.setupOSX();
+ }
+
// Run the actual startup method in the EDT since it can use progress dialogs etc.
log.info("Moving startup to EDT");
SwingUtilities.invokeAndWait(new Runnable() {
Splash.init();
// Must be done after localization is initialized
- ComponentPresetDatabase componentPresetDao = new ComponentPresetDatabase();
- ConcurrentComponentPresetDatabaseLoader presetLoader = new ConcurrentComponentPresetDatabaseLoader( componentPresetDao );
- presetLoader.load();
-
+ ComponentPresetDatabase componentPresetDao = new ComponentPresetDatabase(true) {
+
+ @Override
+ protected void load() {
+ ConcurrentComponentPresetDatabaseLoader presetLoader = new ConcurrentComponentPresetDatabaseLoader( this );
+ presetLoader.load();
+ try {
+ presetLoader.await();
+ } catch ( InterruptedException iex) {
+
+ }
+ }
+
+ };
Application.setComponentPresetDao( componentPresetDao );
+
+ componentPresetDao.startLoading();
// Setup the uncaught exception handler
log.info("Registering exception handler");
// Load motors etc.
log.info("Loading databases");
- ConcurrentLoadingThrustCurveMotorSetDatabase motorLoader = new ConcurrentLoadingThrustCurveMotorSetDatabase(THRUSTCURVE_DIRECTORY);
- motorLoader.startLoading();
- Application.setMotorSetDatabase(motorLoader);
-
+ loadMotor();
+
Databases.fakeMethod();
- try {
- presetLoader.await();
- } catch ( InterruptedException iex) {
-
- }
// Starting action (load files or open new document)
log.info("Opening main application window");
}
+ /**
+ * this method is useful for the python bindings.
+ */
+ public static void loadMotor() {
+ ConcurrentLoadingThrustCurveMotorSetDatabase motorLoader = new ConcurrentLoadingThrustCurveMotorSetDatabase(THRUSTCURVE_DIRECTORY);
+ motorLoader.startLoading();
+ Application.setMotorSetDatabase(motorLoader);
+ }
/**
* Check that the JRE is not running headless.