From: kruland2607 Date: Tue, 3 Apr 2012 03:38:14 +0000 (+0000) Subject: Add units. X-Git-Tag: upstream/12.09^2~390 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=cfbabb5439eb242e812f0e7137ed78c60a94332e;p=debian%2Fopenrocket Add units. git-svn-id: https://openrocket.svn.sourceforge.net/svnroot/openrocket/trunk@507 180e2498-e6e9-4542-8430-84ac67f01cd8 --- diff --git a/core/src/net/sf/openrocket/preset/ComponentPreset.java b/core/src/net/sf/openrocket/preset/ComponentPreset.java index e3406577..79e5eb4a 100644 --- a/core/src/net/sf/openrocket/preset/ComponentPreset.java +++ b/core/src/net/sf/openrocket/preset/ComponentPreset.java @@ -7,6 +7,7 @@ import net.sf.openrocket.material.Material; import net.sf.openrocket.motor.Manufacturer; import net.sf.openrocket.rocketcomponent.BodyTube; import net.sf.openrocket.rocketcomponent.ExternalComponent.Finish; +import net.sf.openrocket.unit.UnitGroup; import net.sf.openrocket.util.BugException; @@ -33,14 +34,14 @@ public class ComponentPreset { public final static TypedKey MANUFACTURER = new TypedKey("Manufacturer", Manufacturer.class); public final static TypedKey PARTNO = new TypedKey("PartNo",String.class); public final static TypedKey TYPE = new TypedKey("Type",Type.class); - public final static TypedKey LENGTH = new TypedKey("Length", Double.class); - public final static TypedKey INNER_DIAMETER = new TypedKey("InnerDiameter", Double.class); - public final static TypedKey OUTER_DIAMETER = new TypedKey("OuterDiameter", Double.class); + public final static TypedKey LENGTH = new TypedKey("Length", Double.class, UnitGroup.UNITS_LENGTH); + public final static TypedKey INNER_DIAMETER = new TypedKey("InnerDiameter", Double.class, UnitGroup.UNITS_LENGTH); + public final static TypedKey OUTER_DIAMETER = new TypedKey("OuterDiameter", Double.class, UnitGroup.UNITS_LENGTH); public final static TypedKey MATERIAL = new TypedKey("Material", Material.class); public final static TypedKey FINISH = new TypedKey("Finish", Finish.class); - public final static TypedKey THICKNESS = new TypedKey("Thickness", Double.class); + public final static TypedKey THICKNESS = new TypedKey("Thickness", Double.class, UnitGroup.UNITS_LENGTH); public final static TypedKey FILLED = new TypedKey("Filled", Boolean.class); - public final static TypedKey MASS = new TypedKey("Mass", Double.class); + public final static TypedKey MASS = new TypedKey("Mass", Double.class, UnitGroup.UNITS_MASS); public final static Map> keyMap = new HashMap>(); static {