2 package net.sf.openrocket.preset.xml;
4 import net.sf.openrocket.rocketcomponent.Transition;
6 import javax.xml.bind.annotation.XmlEnum;
9 * A mirror class to Transition.Shape to adapt that class to/from XML.
11 @XmlEnum(String.class)
12 public enum ShapeDTO {
14 CONICAL (Transition.Shape.CONICAL),
15 OGIVE (Transition.Shape.OGIVE),
16 ELLIPSOID (Transition.Shape.ELLIPSOID),
17 POWER (Transition.Shape.POWER),
18 PARABOLIC (Transition.Shape.PARABOLIC),
19 HAACK (Transition.Shape.HAACK);
21 private Transition.Shape corollary;
23 private ShapeDTO(Transition.Shape theShape) {
27 public static ShapeDTO asDTO(Transition.Shape targetShape) {
28 ShapeDTO[] values = values();
29 for (int i = 0; i < values.length; i++) {
30 ShapeDTO value = values[i];
31 if (value.corollary.equals(targetShape)) {
35 return ELLIPSOID; //default
38 public Transition.Shape getORShape() {