Improve default materials for fins and nose cone

This commit is contained in:
SiboVG 2023-12-24 14:35:51 +01:00
parent c136436284
commit 78593a6749
3 changed files with 8 additions and 2 deletions

View File

@ -217,7 +217,7 @@ public abstract class Material implements Comparable<Material> {
/**
* Return a material defined by the provided string.
*
* @param str the material storage string.
* @param str the material storage string, formatted as "{type}|{name}|{density}".
* @param userDefined whether the created material is user-defined.
* @return a new <code>Material</code> object.
* @throws IllegalArgumentException if <code>str</code> is invalid or null.

View File

@ -21,11 +21,13 @@ import java.util.prefs.BackingStoreException;
import java.util.prefs.Preferences;
import net.sf.openrocket.communication.AssetHandler.UpdatePlatform;
import net.sf.openrocket.database.Databases;
import net.sf.openrocket.rocketcomponent.BodyComponent;
import net.sf.openrocket.rocketcomponent.FinSet;
import net.sf.openrocket.rocketcomponent.InternalComponent;
import net.sf.openrocket.rocketcomponent.LaunchLug;
import net.sf.openrocket.rocketcomponent.MassObject;
import net.sf.openrocket.rocketcomponent.NoseCone;
import net.sf.openrocket.rocketcomponent.ParallelStage;
import net.sf.openrocket.rocketcomponent.PodSet;
import net.sf.openrocket.rocketcomponent.RailButton;
@ -783,7 +785,10 @@ public class SwingPreferences extends net.sf.openrocket.startup.Preferences impl
//// Material storage
public void loadDefaultComponentMaterials() {
setDefaultComponentMaterial(FinSet.class, Databases.findMaterial(Material.Type.BULK, "Balsa"));
setDefaultComponentMaterial(NoseCone.class, Databases.findMaterial(Material.Type.BULK, "Polystyrene"));
}
/**
* Add a user-defined material to the preferences. The preferences are

View File

@ -214,6 +214,7 @@ public class SwingStartup {
// Load defaults
((SwingPreferences) Application.getPreferences()).loadDefaultUnits();
((SwingPreferences) Application.getPreferences()).loadDefaultComponentMaterials();
Databases.fakeMethod();