Abort printing if the user cancels the print setup dialog.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@262 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: Driver.java,v 1.10 2001/08/13 23:58:56 mdb Exp $
|
// $Id: Driver.java,v 1.11 2001/08/14 00:41:53 mdb Exp $
|
||||||
//
|
//
|
||||||
// viztool - a tool for visualizing collections of java classes
|
// viztool - a tool for visualizing collections of java classes
|
||||||
// Copyright (C) 2001 Michael Bayne
|
// Copyright (C) 2001 Michael Bayne
|
||||||
@@ -82,17 +82,20 @@ public class Driver
|
|||||||
paper.setImageableArea(72*0.5, 72*0.5, 72*7.5, 72*10);
|
paper.setImageableArea(72*0.5, 72*0.5, 72*7.5, 72*10);
|
||||||
format.setPaper(paper);
|
format.setPaper(paper);
|
||||||
|
|
||||||
// pop up a dialog to control printing
|
|
||||||
job.printDialog();
|
|
||||||
|
|
||||||
// use our configured page format
|
// use our configured page format
|
||||||
job.setPrintable(viz, format);
|
job.setPrintable(viz, format);
|
||||||
|
|
||||||
try {
|
// pop up a dialog to control printing
|
||||||
// invoke the printing process
|
if (job.printDialog()) {
|
||||||
job.print();
|
try {
|
||||||
} catch (PrinterException pe) {
|
// invoke the printing process
|
||||||
pe.printStackTrace(System.err);
|
job.print();
|
||||||
|
} catch (PrinterException pe) {
|
||||||
|
pe.printStackTrace(System.err);
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Log.info("Printing cancelled.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// printing starts up the AWT threads, so we have to
|
// printing starts up the AWT threads, so we have to
|
||||||
|
|||||||
Reference in New Issue
Block a user