Merge pull request #2426 from SiboVG/fin-balsa

Set Balsa as default material for fins
This commit is contained in:
Joe Pfeiffer 2023-12-24 13:51:28 -07:00 committed by GitHub
commit 85bac6484e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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();