git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dfa39e0
)
JAL-2464 fix cancel tree print behaviour
author
gmungoc
<g.m.carstairs@dundee.ac.uk>
Thu, 23 Mar 2017 15:10:52 +0000
(15:10 +0000)
committer
kiramt
<k.mourao@dundee.ac.uk>
Fri, 24 Mar 2017 09:39:45 +0000
(09:39 +0000)
src/jalview/gui/TreeCanvas.java
patch
|
blob
|
history
diff --git
a/src/jalview/gui/TreeCanvas.java
b/src/jalview/gui/TreeCanvas.java
index
54eed1a
..
9a38d4c
100755
(executable)
--- a/
src/jalview/gui/TreeCanvas.java
+++ b/
src/jalview/gui/TreeCanvas.java
@@
-549,7
+549,16
@@
public class TreeCanvas extends JPanel implements MouseListener, Runnable,
public void run()
{
PrinterJob printJob = PrinterJob.getPrinterJob();
- PageFormat pf = printJob.pageDialog(printJob.defaultPage());
+ PageFormat defaultPage = printJob.defaultPage();
+ PageFormat pf = printJob.pageDialog(defaultPage);
+
+ if (defaultPage == pf)
+ {
+ /*
+ * user cancelled
+ */
+ return;
+ }
printJob.setPrintable(this, pf);