DGP - added isCompatible checks for all Rocksim components
[debian/openrocket] / src / net / sf / openrocket / file / rocksim / LaunchLugHandler.java
index 969cfdbf3ef6883657c49444ca52206dc1d91fc6..049feedd8579b4fd05f6a629938a1bde28cf9428 100644 (file)
@@ -27,14 +27,18 @@ class LaunchLugHandler extends PositionDependentHandler<LaunchLug> {
      * Constructor.
      *
      * @param c the parent
+     * @param warnings  the warning set
+     * 
      * @throws IllegalArgumentException thrown if <code>c</code> is null
      */
-    public LaunchLugHandler(RocketComponent c) throws IllegalArgumentException {
+    public LaunchLugHandler(RocketComponent c, WarningSet warnings) throws IllegalArgumentException {
         if (c == null) {
             throw new IllegalArgumentException("The parent component of a launch lug may not be null.");
         }
         lug = new LaunchLug();
-        c.addChild(lug);
+        if (isCompatible(c, LaunchLug.class, warnings)) {
+            c.addChild(lug);
+        }
     }
 
     @Override