1 package net.sf.openrocket.preset.xml;
3 import net.sf.openrocket.preset.ComponentPreset;
5 import javax.xml.bind.annotation.XmlAccessType;
6 import javax.xml.bind.annotation.XmlAccessorType;
7 import javax.xml.bind.annotation.XmlElement;
8 import javax.xml.bind.annotation.XmlRootElement;
11 * A NoseCone preset XML handler.
13 @XmlRootElement(name = "NoseCone")
14 @XmlAccessorType(XmlAccessType.FIELD)
15 public class NoseConeDTO extends BaseComponentDTO {
17 @XmlElement(name = "Shape")
18 private ShapeDTO shape;
19 @XmlElement(name = "OutsideDiameter")
20 private double outsideDiameter;
21 @XmlElement(name = "ShoulderDiameter")
22 private double shoulderDiameter;
23 @XmlElement(name = "Length")
24 private double length;
27 * Default constructor.
29 public NoseConeDTO() {
37 * @throws net.sf.openrocket.util.BugException thrown if the expected body tube keys are not in the preset
39 public NoseConeDTO(final ComponentPreset thePreset) {
41 setShape(ShapeDTO.asDTO(thePreset.get(ComponentPreset.SHAPE)));
42 setOutsideDiameter(thePreset.get(ComponentPreset.AFT_OUTER_DIAMETER));
43 setShoulderDiameter(thePreset.get(ComponentPreset.AFT_SHOULDER_DIAMETER));
44 setLength(thePreset.get(ComponentPreset.LENGTH));
47 public ShapeDTO getShape() {
51 public void setShape(final ShapeDTO theShape) {
55 public double getOutsideDiameter() {
56 return outsideDiameter;
59 public void setOutsideDiameter(final double theOutsideDiameter) {
60 outsideDiameter = theOutsideDiameter;
63 public double getShoulderDiameter() {
64 return shoulderDiameter;
67 public void setShoulderDiameter(final double theShoulderDiameter) {
68 shoulderDiameter = theShoulderDiameter;
71 public double getLength() {
75 public void setLength(final double theLength) {