DGP - merged printing support from branch
[debian/openrocket] / src / net / sf / openrocket / rocketcomponent / Rocket.java
index 7ba088b9fad1a452c8b9e89cf9cf400525a7fc9e..509c9ff545e98e869b6f1f7601dd771d280a53a7 100644 (file)
@@ -1,17 +1,5 @@
 package net.sf.openrocket.rocketcomponent;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.UUID;
-
-import javax.swing.event.ChangeListener;
-import javax.swing.event.EventListenerList;
-
 import net.sf.openrocket.gui.main.ExceptionHandler;
 import net.sf.openrocket.logging.LogHelper;
 import net.sf.openrocket.motor.Motor;
@@ -21,6 +9,17 @@ import net.sf.openrocket.util.Coordinate;
 import net.sf.openrocket.util.MathUtil;
 import net.sf.openrocket.util.UniqueID;
 
+import javax.swing.event.ChangeListener;
+import javax.swing.event.EventListenerList;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.UUID;
+
 
 /**
  * Base for all rocket components.  This is the "starting point" for all rocket trees.
@@ -135,7 +134,6 @@ public class Rocket extends RocketComponent {
        }
        
        
-
        /**
         * Return the non-negative modification ID of this rocket.  The ID is changed
         * every time any change occurs in the rocket.  This can be used to check 
@@ -815,4 +813,14 @@ public class Rocket extends RocketComponent {
        public boolean isCompatible(Class<? extends RocketComponent> type) {
                return (Stage.class.isAssignableFrom(type));
        }
+
+    /**
+     * Accept a visitor to this Rocket in the component hierarchy.
+     * 
+     * @param theVisitor  the visitor that will be called back with a reference to this Rocket
+     */    
+       @Override 
+    public void accept (final ComponentVisitor theVisitor) {
+        theVisitor.visit(this);
+    }    
 }