X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fnet%2Fsf%2Fopenrocket%2Fgui%2Fprint%2FPrintSimulationWorker.java;h=53a710c8003f0a207a388c0b9c38ca089d2d6b22;hb=bf771f9d4b5215b0036435eb19fc8c813f87c79d;hp=b0b31b35e70202a308e83a0e6ffd309a97bef25b;hpb=da7a9ff299f7b1529f8ff9cba08e4be3f369937c;p=debian%2Fopenrocket diff --git a/src/net/sf/openrocket/gui/print/PrintSimulationWorker.java b/src/net/sf/openrocket/gui/print/PrintSimulationWorker.java index b0b31b35..53a710c8 100644 --- a/src/net/sf/openrocket/gui/print/PrintSimulationWorker.java +++ b/src/net/sf/openrocket/gui/print/PrintSimulationWorker.java @@ -12,38 +12,39 @@ import net.sf.openrocket.simulation.FlightData; * finished. The worker can be cancelled if necessary. */ public class PrintSimulationWorker { - - public static FlightData doit (Simulation sim) { - return new InnerPrintSimulationWorker(sim).doit(); - } - - static class InnerPrintSimulationWorker extends SimulationWorker { - - public InnerPrintSimulationWorker (Simulation sim) { - super(sim); - } - - public FlightData doit() { - return doInBackground(); - } - @Override - protected void simulationDone () { - // Do nothing if cancelled - if (isCancelled()) { - return; - } - - simulation.getSimulatedData(); - } - - - /** - * Called if the simulation is interrupted due to an exception. - * - * @param t the Throwable that caused the interruption - */ - @Override - protected void simulationInterrupted (final Throwable t) { - } - } + + public static FlightData doit(Simulation sim) { + return new InnerPrintSimulationWorker(sim).doit(); + } + + static class InnerPrintSimulationWorker extends SimulationWorker { + + public InnerPrintSimulationWorker(Simulation sim) { + super(sim); + } + + public FlightData doit() { + return doInBackground(); + } + + @Override + protected void simulationDone() { + // Do nothing if cancelled + if (isCancelled()) { + return; + } + + simulation.getSimulatedData(); + } + + + /** + * Called if the simulation is interrupted due to an exception. + * + * @param t the Throwable that caused the interruption + */ + @Override + protected void simulationInterrupted(final Throwable t) { + } + } } \ No newline at end of file