2 * OpenRocketPrintable.java
4 package net.sf.openrocket.gui.print;
7 * This enumeration identifies the various types of information that may be printed.
9 public enum OpenRocketPrintable {
10 //PARTS_LIST("Parts list", true, 0),
11 PARTS_DETAIL("Parts detail", true, 1),
12 FIN_TEMPLATE("Fin templates", true, 2),
13 DESIGN_REPORT("Design Report", false, 3);
16 * The description - will be displayed in the JTree.
18 private String description;
21 * Flag that indicates if the enum value is different depending upon stage.
23 private boolean stageSpecific;
26 * The order of the item as it appears in the printed document.
33 * @param s the displayable description
34 * @param staged indicates if the printable is stage dependent
35 * @param idx the relative print order
37 OpenRocketPrintable (String s, boolean staged, int idx) {
39 stageSpecific = staged;
44 * Get the description of this printable.
46 * @return a displayable string
48 public String getDescription () {
53 * Answers if this enum value has different meaning depending upon the stage.
55 * @return true if the printable is stage dependent
57 public boolean isStageSpecific () {
62 * Answer the print order. This is relative to other enum values. No two enum values will have the same print
65 * @return a 0 based order (0 being first, or highest)
67 public int getPrintOrder () {
72 * Look up an enum value based on the description.
74 * @param target the description
76 * @return an instance of this enum class or null if not found
78 public static OpenRocketPrintable findByDescription (String target) {
79 OpenRocketPrintable[] values = values();
80 for (OpenRocketPrintable value : values) {
81 if (value.getDescription().equalsIgnoreCase(target)) {