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:
mdb
2001-08-14 00:41:53 +00:00
parent 09ab5b9005
commit 99ce178d1c
@@ -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
// Copyright (C) 2001 Michael Bayne
@@ -82,12 +82,11 @@ public class Driver
paper.setImageableArea(72*0.5, 72*0.5, 72*7.5, 72*10);
format.setPaper(paper);
// pop up a dialog to control printing
job.printDialog();
// use our configured page format
job.setPrintable(viz, format);
// pop up a dialog to control printing
if (job.printDialog()) {
try {
// invoke the printing process
job.print();
@@ -95,6 +94,10 @@ public class Driver
pe.printStackTrace(System.err);
}
} else {
Log.info("Printing cancelled.");
}
// printing starts up the AWT threads, so we have to
// explicitly exit at this point
System.exit(0);