DGP - merged printing support from branch
[debian/openrocket] / src / net / sf / openrocket / rocketcomponent / BodyComponent.java
index 9eb970c610ab8c2f1c11b93d27dfe54861cea4ec..97a12406f4e764d00cce6abf580b796f14d56b0e 100644 (file)
@@ -13,7 +13,7 @@ package net.sf.openrocket.rocketcomponent;
  */
 
 public abstract class BodyComponent extends ExternalComponent {
-
+       
        /**
         * Default constructor.  Sets the relative position to POSITION_RELATIVE_AFTER,
         * i.e. body components come after one another.
@@ -33,7 +33,7 @@ public abstract class BodyComponent extends ExternalComponent {
         * @return  Distance to the outer edge of the object
         */
        public abstract double getRadius(double x, double theta);
-
+       
        
        /**
         * Get the inner radius of the component at cylindrical coordinate (x,theta).
@@ -45,7 +45,7 @@ public abstract class BodyComponent extends ExternalComponent {
         * @return  Distance to the inner edge of the object
         */
        public abstract double getInnerRadius(double x, double theta);
-
+       
        
 
        /**
@@ -54,26 +54,13 @@ public abstract class BodyComponent extends ExternalComponent {
        public void setLength(double length) {
                if (this.length == length)
                        return;
-               this.length = Math.max(length,0);
+               this.length = Math.max(length, 0);
                fireComponentChangeEvent(ComponentChangeEvent.BOTH_CHANGE);
        }
        
-       
-       /**
-        * Check whether the given type can be added to this component.  BodyComponents allow any
-        * InternalComponents or ExternalComponents, excluding BodyComponents, to be added.
-        * 
-        * @param type  The RocketComponent class type to add.
-        * @return      Whether such a component can be added.
-        */
        @Override
-       public boolean isCompatible(Class<? extends RocketComponent> type) {
-               if (InternalComponent.class.isAssignableFrom(type))
-                       return true;
-               if (ExternalComponent.class.isAssignableFrom(type) &&
-                       !BodyComponent.class.isAssignableFrom(type))
-                       return true;
-               return false;
+       public boolean allowsChildren() {
+               return true;
        }
     
     /**