Updates for 0.9.5
[debian/openrocket] / src / net / sf / openrocket / database / Databases.java
index 3f4d8e20fe729adab0ff6c864e53994e7a6c61ff..efb8cd6cb36a26f48ac1fed28403edba3179228c 100644 (file)
@@ -8,7 +8,8 @@ import java.util.ArrayList;
 import net.sf.openrocket.file.GeneralMotorLoader;
 import net.sf.openrocket.material.Material;
 import net.sf.openrocket.material.MaterialStorage;
-import net.sf.openrocket.rocketcomponent.Motor;
+import net.sf.openrocket.motor.Motor;
+import net.sf.openrocket.util.ConfigurationException;
 import net.sf.openrocket.util.JarUtil;
 import net.sf.openrocket.util.MathUtil;
 import net.sf.openrocket.util.Prefs;
@@ -65,7 +66,8 @@ public class Databases {
                                MOTOR.loadDirectory(dir, ".*\\.[eE][nN][gG]$");
                        } catch (IOException e1) {
                                System.out.println("Could not read thrust curves from directory either.");
-                               throw new RuntimeException(e1);
+                               throw new ConfigurationException("Couldn't read thrust curves from either " +
+                                               "JAR file or system resource directory", e1);
                        }
                }
        }
@@ -79,6 +81,7 @@ public class Databases {
                BULK_MATERIAL.add(new Material.Bulk("Cardboard",         680, false));
                BULK_MATERIAL.add(new Material.Bulk("Carbon fiber",     1780, false));
                BULK_MATERIAL.add(new Material.Bulk("Cork",                      240, false));
+               BULK_MATERIAL.add(new Material.Bulk("Depron (XPS)",       40, false));
                BULK_MATERIAL.add(new Material.Bulk("Fiberglass",       1850, false));
                BULK_MATERIAL.add(new Material.Bulk("Kraft phenolic",950, false));
                BULK_MATERIAL.add(new Material.Bulk("Maple",             755, false));
@@ -89,6 +92,9 @@ public class Databases {
                BULK_MATERIAL.add(new Material.Bulk("Polystyrene",  1050, false));
                BULK_MATERIAL.add(new Material.Bulk("PVC",                      1390, false));
                BULK_MATERIAL.add(new Material.Bulk("Spruce",            450, false));
+               BULK_MATERIAL.add(new Material.Bulk("Styrofoam (generic EPS)", 20, false));
+//             BULK_MATERIAL.add(new Material.Bulk("Styrofoam (Blue foam, XPS)", 32, false));
+               BULK_MATERIAL.add(new Material.Bulk("Styrofoam \"Blue foam\" (XPS)", 32, false));
                BULK_MATERIAL.add(new Material.Bulk("Quantum tubing",1050, false));
                
                SURFACE_MATERIAL.add(new Material.Surface("Ripstop nylon",                      0.067, false));
@@ -141,6 +147,14 @@ public class Databases {
        }
        
        
+       /*
+        * Used just for ensuring initialization of the class.
+        */
+       public static void fakeMethod() {
+               
+       }
+       
+       
        /**
         * Find a material from the database with the specified type and name.  Returns
         * <code>null</code> if the specified material could not be found.
@@ -229,7 +243,7 @@ public class Databases {
                        boolean match = true;
                        if (type != null  &&  type != m.getMotorType())
                                match = false;
-                       else if (manufacturer != null  &&  !manufacturer.equalsIgnoreCase(m.getManufacturer()))
+                       else if (manufacturer != null  &&  !m.getManufacturer().matches(manufacturer))
                                match = false;
                        else if (designation != null  &&  !designation.equalsIgnoreCase(m.getDesignation()))
                                match = false;