Revision: 1012
Author: allain.lalonde
Date: Sat Apr 17 07:27:48 2010
Log: Making PNode.print() throw PrinterException rather than swallowing it.
This is until we remove printing support from PNode as per Issue 102.
http://code.google.com/p/piccolo2d/source/detail?r=1012
Modified:
/piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PNode.java
=======================================
--- /piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PNode.java
Sat Apr 17 05:38:08 2010
+++ /piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PNode.java
Sat Apr 17 07:27:48 2010
@@ -2905,8 +2905,9 @@
/**
* Constructs a new PrinterJob, allows the user to select which
printer to
* print to, And then prints the node.
+ * @throws PrinterException
*/
- public void print() {
+ public void print() throws PrinterException {
final PrinterJob printJob = PrinterJob.getPrinterJob();
final PageFormat pageFormat = printJob.defaultPage();
final Book book = new Book();
@@ -2914,12 +2915,7 @@
printJob.setPageable(book);
if (printJob.printDialog()) {
- try {
- printJob.print();
- }
- catch (final PrinterException e) {
- throw new RuntimeException("Error Printing", e);
- }
+ printJob.print();
}
}
--
Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en