2 * PrintSimulationWorker.java
4 package net.sf.openrocket.gui.print;
6 import net.sf.openrocket.document.Simulation;
7 import net.sf.openrocket.gui.main.SimulationWorker;
8 import net.sf.openrocket.simulation.FlightData;
11 * A SimulationWorker that simulates the rocket flight in the background and sets the results to the extra text when
12 * finished. The worker can be cancelled if necessary.
14 public class PrintSimulationWorker {
16 public static FlightData doit(Simulation sim) {
17 return new InnerPrintSimulationWorker(sim).doit();
20 static class InnerPrintSimulationWorker extends SimulationWorker {
22 public InnerPrintSimulationWorker(Simulation sim) {
26 public FlightData doit() {
27 return doInBackground();
31 protected void simulationDone() {
32 // Do nothing if cancelled
37 simulation.getSimulatedData();
42 * Called if the simulation is interrupted due to an exception.
44 * @param t the Throwable that caused the interruption
47 protected void simulationInterrupted(final Throwable t) {