Moved the ComponentPresetChooserDialog from the BodyTubeConfig temporary button to...
[debian/openrocket] / core / src / net / sf / openrocket / preset / ComponentPreset.java
index 3da15e2642baf76cb0d73ed622bbbfd28b5ea050..97a02226253f51e1977ea424a5889131cb7c505a 100644 (file)
@@ -36,29 +36,48 @@ public class ComponentPreset implements Comparable<ComponentPreset> {
        private String digest = "";
 
        public enum Type {
-               BODY_TUBE,
-               NOSE_CONE;
+               BODY_TUBE( new TypedKey<?>[] {
+                               ComponentPreset.MANUFACTURER,
+                               ComponentPreset.PARTNO,
+                               ComponentPreset.OUTER_DIAMETER,
+                               ComponentPreset.INNER_DIAMETER,
+                               ComponentPreset.LENGTH} ),
+                               
+               NOSE_CONE( new TypedKey<?>[] {
+                               ComponentPreset.MANUFACTURER,
+                               ComponentPreset.PARTNO,
+                               ComponentPreset.OUTER_DIAMETER,
+                               ComponentPreset.INNER_DIAMETER,
+                               ComponentPreset.LENGTH} ) ;
 
                Type[] compatibleTypes;
+               TypedKey<?>[] displayedColumns;
 
-               Type () {
+               Type( TypedKey<?>[] displayedColumns) {
                        compatibleTypes = new Type[1];
                        compatibleTypes[0] = this;
+                       this.displayedColumns = displayedColumns;
                }
 
-               Type( Type ... t ) {
+               Type( Type[] t, TypedKey<?>[] displayedColumns ) {
 
                        compatibleTypes = new Type[t.length+1];
                        compatibleTypes[0] = this;
                        for( int i=0; i<t.length; i++ ) {
                                compatibleTypes[i+1] = t[i];
                        }
+
+                       this.displayedColumns = displayedColumns;
                }
 
                public Type[] getCompatibleTypes() {
                        return compatibleTypes;
                }
 
+               public TypedKey<?>[] getDisplayedColumns() {
+                       return displayedColumns;
+               }
+
        }
 
        public final static TypedKey<Manufacturer> MANUFACTURER = new TypedKey<Manufacturer>("Manufacturer", Manufacturer.class);