DGP - added isCompatible checks for all Rocksim components
[debian/openrocket] / src / net / sf / openrocket / file / rocksim / TransitionHandler.java
index 1f3b02e1572621623c5f80edfcf262c22ff38cb9..54ea3237a2f60e4f7e21c9bf4698fb2f2769f989 100644 (file)
@@ -31,13 +31,16 @@ class TransitionHandler extends BaseHandler<Transition> {
      * Constructor.
      *
      * @param c the parent component
+     * @param warnings  the warning set
      * @throws IllegalArgumentException thrown if <code>c</code> is null
      */
-    public TransitionHandler(RocketComponent c) throws IllegalArgumentException {
+    public TransitionHandler(RocketComponent c, WarningSet warnings) throws IllegalArgumentException {
         if (c == null) {
             throw new IllegalArgumentException("The parent of a transition may not be null.");
         }
-        c.addChild(transition);
+        if (isCompatible(c, Transition.class, warnings)) {
+            c.addChild(transition);
+        }
     }
 
     @Override