Merge commit '42b2e5ca519766e37ce6941ba4faecc9691cc403' into upstream
[debian/openrocket] / core / src / net / sf / openrocket / gui / dialogs / PrintDialog.java
index 729586d3455e70e69423fbbc5200ab2942051360..bf2249ced76e5e22aeb491e1ec5af0d631720b8e 100644 (file)
@@ -61,22 +61,25 @@ public class PrintDialog extends JDialog implements TreeSelectionListener {
        private JButton previewButton;
        private JButton saveAsPDF;
        private JButton cancel;
-       
+
+    private double rotation = 0d;
        
        private final static SwingPreferences prefs = (SwingPreferences) Application.getPreferences();
        
        /**
         * Constructor.
         *
+     * @param parent     the parent awt component
         * @param orDocument the OR rocket container
+     * @param theRotation the angle of rocket figure rotation
         */
-       public PrintDialog(Window parent, OpenRocketDocument orDocument) {
+       public PrintDialog(Window parent, OpenRocketDocument orDocument, double theRotation) {
                super(parent, trans.get("title"), ModalityType.APPLICATION_MODAL);
                
 
                JPanel panel = new JPanel(new MigLayout("fill, gap rel unrel"));
                this.add(panel);
-               
+               rotation = theRotation;
 
                // before any Desktop APIs are used, first check whether the API is
                // supported by this particular VM on this particular host
@@ -257,7 +260,7 @@ public class PrintDialog extends JDialog implements TreeSelectionListener {
        /**
         * Generate a report using a temporary file.  The file will be deleted upon JVM exit.
         *
-        * @param paper the name of the paper size
+     * @param settings  the container of different print settings
         *
         * @return a file, populated with the "printed" output (the rocket info)
         *
@@ -273,7 +276,7 @@ public class PrintDialog extends JDialog implements TreeSelectionListener {
         * Generate a report to a specified file.
         *
         * @param f     the file to which rocket data will be written
-        * @param paper the name of the paper size
+        * @param settings  the container of different print settings
         *
         * @return a file, populated with the "printed" output (the rocket info)
         *
@@ -281,7 +284,7 @@ public class PrintDialog extends JDialog implements TreeSelectionListener {
         */
        private File generateReport(File f, PrintSettings settings) throws IOException {
                Iterator<PrintableContext> toBePrinted = currentTree.getToBePrinted();
-               new PrintController().print(document, toBePrinted, new FileOutputStream(f), settings);
+               new PrintController().print(document, toBePrinted, new FileOutputStream(f), settings, rotation);
                return f;
        }