X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAlignFrame.java;h=7b1dfeb10c4a81e1b87b0a7390eeb5a3ac5f81b4;hb=c858b2b71816055429bd496a7158973ad8acec57;hp=f8134579b559335df69b52961e0e57fd9f40bb42;hpb=cca1d315fd19ddcc7c67a5aba91dafa98be097cf;p=jalview.git diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index f813457..7b1dfeb 100755 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -825,6 +825,13 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener alignPanel.makeEPS(f); } + + public void pageSetup_actionPerformed(ActionEvent e) + { + PrinterJob printJob = PrinterJob.getPrinterJob(); + PrintThread.pf = printJob.pageDialog(printJob.defaultPage()); + } + /** * DOCUMENT ME! * @@ -833,7 +840,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener public void printMenuItem_actionPerformed(ActionEvent e) { //Putting in a thread avoids Swing painting problems - PrintThread thread = new PrintThread(); + PrintThread thread = new PrintThread(alignPanel); thread.start(); } @@ -1684,7 +1691,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener new RemoveGapColCommand("Remove Gapped Columns", seqs, start, end, - viewport.getGapCharacter()); + viewport.alignment); addHistoryItem(removeGapCols); @@ -1729,9 +1736,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener int startRes = seq.findPosition(viewport.startRes); addHistoryItem(new RemoveGapsCommand("Remove Gaps", - seqs, - start, end, - viewport.getGapCharacter())); + seqs, + start, end, + viewport.alignment)); viewport.setStartRes(seq.findIndex(startRes)-1); @@ -2932,28 +2939,6 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener return tp; } - class PrintThread - extends Thread - { - public void run() - { - PrinterJob printJob = PrinterJob.getPrinterJob(); - PageFormat pf = printJob.pageDialog(printJob.defaultPage()); - printJob.setPrintable(alignPanel, pf); - - if (printJob.printDialog()) - { - try - { - printJob.print(); - } - catch (Exception PrintException) - { - PrintException.printStackTrace(); - } - } - } - } /** * Generates menu items and listener event actions for web service clients @@ -3356,3 +3341,34 @@ public void drop(DropTargetDropEvent evt) return viewport; } } + +class PrintThread extends Thread +{ + AlignmentPanel ap; + public PrintThread(AlignmentPanel ap) + { + this.ap = ap; + } + static PageFormat pf; + public void run() + { + PrinterJob printJob = PrinterJob.getPrinterJob(); + + if (pf != null) + printJob.setPrintable(ap, pf); + else + printJob.setPrintable(ap); + + if (printJob.printDialog()) + { + try + { + printJob.print(); + } + catch (Exception PrintException) + { + PrintException.printStackTrace(); + } + } + } +}