2 package net.sf.openrocket.preset.xml;
4 import net.sf.openrocket.preset.ComponentPreset;
6 import javax.xml.bind.annotation.XmlAccessType;
7 import javax.xml.bind.annotation.XmlAccessorType;
8 import javax.xml.bind.annotation.XmlElement;
9 import javax.xml.bind.annotation.XmlRootElement;
12 * Centering ring preset XML handler.
14 @XmlRootElement(name = "CenteringRing")
15 @XmlAccessorType(XmlAccessType.FIELD)
16 public class CenteringRingDTO extends BaseComponentDTO {
18 @XmlElement(name = "InsideDiameter")
19 private double insideDiameter;
20 @XmlElement(name = "OutsideDiameter")
21 private double outsideDiameter;
22 @XmlElement(name = "Length")
23 private double length;
26 * Default constructor.
28 public CenteringRingDTO() {
32 * Most-useful constructor that maps a CenteringRing preset to a CenteringRingDTO.
34 * @param thePreset the preset
36 * @throws net.sf.openrocket.util.BugException thrown if the expected centering ring keys are not in the preset
38 public CenteringRingDTO(final ComponentPreset thePreset) {
40 setInsideDiameter(thePreset.get(ComponentPreset.INNER_DIAMETER));
41 setOutsideDiameter(thePreset.get(ComponentPreset.OUTER_DIAMETER));
42 setLength(thePreset.get(ComponentPreset.LENGTH));
45 public double getInsideDiameter() {
46 return insideDiameter;
49 public void setInsideDiameter(final double theInsideDiameter) {
50 insideDiameter = theInsideDiameter;
53 public double getOutsideDiameter() {
54 return outsideDiameter;
57 public void setOutsideDiameter(final double theOutsideDiameter) {
58 outsideDiameter = theOutsideDiameter;
61 public double getLength() {
65 public void setLength(final double theLength) {