diff --git a/core/src/main/java/edu/umd/cs/piccolo/PNode.java b/core/src/main/java/edu/umd/cs/piccolo/PNode.java index 87ee16c..228379e 100644 --- a/core/src/main/java/edu/umd/cs/piccolo/PNode.java +++ b/core/src/main/java/edu/umd/cs/piccolo/PNode.java @@ -2628,8 +2628,7 @@ printJob.print(); } catch (PrinterException e) { - System.out.println("Error Printing"); - e.printStackTrace(); + throw new RuntimeException("Error Printing", e); } } } diff --git a/examples/src/main/java/edu/umd/cs/piccolo/examples/swt/SWTBenchTest.java b/examples/src/main/java/edu/umd/cs/piccolo/examples/swt/SWTBenchTest.java index 9aee2f9..159930e 100644 --- a/examples/src/main/java/edu/umd/cs/piccolo/examples/swt/SWTBenchTest.java +++ b/examples/src/main/java/edu/umd/cs/piccolo/examples/swt/SWTBenchTest.java @@ -399,8 +399,7 @@ results = new int[NUM_CONTEXTS][NUM_TESTS]; } catch (IOException e) { - e.printStackTrace(); - System.exit(1); + throw new RuntimeException(e); } } diff --git a/extras/src/main/java/edu/umd/cs/piccolox/event/PNotificationCenter.java b/extras/src/main/java/edu/umd/cs/piccolox/event/PNotificationCenter.java index 237411d..92ee856 100644 --- a/extras/src/main/java/edu/umd/cs/piccolox/event/PNotificationCenter.java +++ b/extras/src/main/java/edu/umd/cs/piccolox/event/PNotificationCenter.java @@ -267,7 +267,8 @@ catch (InvocationTargetException e) { // Since this is how Swing handles Exceptions that get // thrown on listeners, it's probably ok to do it here. - e.printStackTrace(); + // mro: if Swing does it wrong we don't have to. + throw new RuntimeException(e); } } } diff --git a/extras/src/main/java/edu/umd/cs/piccolox/pswing/PSwingEventHandler.java b/extras/src/main/java/edu/umd/cs/piccolox/pswing/PSwingEventHandler.java index a4d83e4..73dbf6c 100644 --- a/extras/src/main/java/edu/umd/cs/piccolox/pswing/PSwingEventHandler.java +++ b/extras/src/main/java/edu/umd/cs/piccolox/pswing/PSwingEventHandler.java @@ -362,11 +362,12 @@ private void cameraToLocal(PCamera topCamera, Point2D pt, PNode node) { AffineTransform inverse; try { - inverse = topCamera.getViewTransform().createInverse(); - } catch (NoninvertibleTransformException e) { + inverse = topCamera.getViewTransform().createInverse(); + } + catch (NoninvertibleTransformException e) { throw new PAffineTransformException(e, topCamera.getViewTransform()); } - + /* * Only apply the camera's view transform when this node is a descendant * of PLayer @@ -410,10 +411,11 @@ } } else { - new Exception("PInputEvent.getSourceSwingEvent was not a MouseEvent. Actual event: " - + sourceSwingEvent + ", class=" + sourceSwingEvent.getClass().getName()).printStackTrace(); + // what was that? an exception to format syslog output? + throw new RuntimeException("PInputEvent.getSourceSwingEvent was not a MouseEvent. Actual event: " + + sourceSwingEvent + ", class=" + sourceSwingEvent.getClass().getName()); } - } + } } /** diff --git a/swt/src/main/java/edu/umd/cs/piccolox/swt/PSWTPath.java b/swt/src/main/java/edu/umd/cs/piccolox/swt/PSWTPath.java index 9794fe2..54400ec 100644 --- a/swt/src/main/java/edu/umd/cs/piccolox/swt/PSWTPath.java +++ b/swt/src/main/java/edu/umd/cs/piccolox/swt/PSWTPath.java @@ -383,7 +383,8 @@ return new Line2D.Double(l2.getP1(), l2.getP2()); } else { - new Exception().printStackTrace(); + // either throw an exception or don't. But don't just write to sysout + // new Exception().printStackTrace(); GeneralPath aPath = new GeneralPath(); aPath.append(aShape, false); return aPath; diff --git a/swt/src/main/java/edu/umd/cs/piccolox/swt/SWTGraphics2D.java b/swt/src/main/java/edu/umd/cs/piccolox/swt/SWTGraphics2D.java index 0274484..d4a3edd 100644 --- a/swt/src/main/java/edu/umd/cs/piccolox/swt/SWTGraphics2D.java +++ b/swt/src/main/java/edu/umd/cs/piccolox/swt/SWTGraphics2D.java @@ -121,7 +121,7 @@ SWTShapeManager.transform(aRect, transform.createInverse()); } catch (Exception e) { - e.printStackTrace(); + throw new RuntimeException(e); } return aRect; } @@ -182,7 +182,7 @@ SWTShapeManager.transform(aRect, transform.createInverse()); } catch (Exception e) { - e.printStackTrace(); + throw new RuntimeException(e); } return aRect; } @@ -311,7 +311,7 @@ sizeInt = Integer.parseInt(size.substring(size.indexOf("=") + 1, size.length())); } catch (Exception e) { - e.printStackTrace(); + throw new RuntimeException(e); } cachedFont = new org.eclipse.swt.graphics.Font(device,