X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=core%2Fsrc%2Fnet%2Fsf%2Fopenrocket%2Fpreset%2Floader%2FLineMaterialColumnParser.java;h=42a79722a983c5f55306e2decec2e262a25f00e9;hb=4095cb0dd61a75b7b6b0bd811f8e803af5b27919;hp=eace7f3fb7dd1d5070ef4b046d6ed5888efaa7d0;hpb=4da92a4e994992a78d62a7ca21c88d6c41292d6f;p=debian%2Fopenrocket diff --git a/core/src/net/sf/openrocket/preset/loader/LineMaterialColumnParser.java b/core/src/net/sf/openrocket/preset/loader/LineMaterialColumnParser.java index eace7f3f..42a79722 100644 --- a/core/src/net/sf/openrocket/preset/loader/LineMaterialColumnParser.java +++ b/core/src/net/sf/openrocket/preset/loader/LineMaterialColumnParser.java @@ -1,13 +1,14 @@ package net.sf.openrocket.preset.loader; +import net.sf.openrocket.database.Databases; import net.sf.openrocket.material.Material; import net.sf.openrocket.preset.TypedKey; import net.sf.openrocket.preset.TypedPropertyMap; public class LineMaterialColumnParser extends BaseColumnParser { - + private final MaterialHolder materialMap; - + private final TypedKey param; public LineMaterialColumnParser(MaterialHolder materialMap, String columnName, TypedKey param) { @@ -16,19 +17,19 @@ public class LineMaterialColumnParser extends BaseColumnParser { this.materialMap = materialMap; } - + @Override protected void doParse(String columnData, String[] data, TypedPropertyMap props) { - - if ( columnData == null || "".equals(columnData.trim())) { + + if (columnData == null || "".equals(columnData.trim())) { return; } - Material.Line myMaterial = (Material.Line) Material.newUserMaterial(Material.Type.LINE, columnData, 0.0); - + Material.Line myMaterial = (Material.Line) Databases.findMaterial(Material.Type.LINE, columnData, 0.0); + Material.Line m = materialMap.getLineMaterial(myMaterial); - props.put(param, m!=null? m : myMaterial); - + props.put(param, m != null ? m : myMaterial); + } - + }