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 388166d..b50b809 100644 --- a/core/src/main/java/edu/umd/cs/piccolo/PNode.java +++ b/core/src/main/java/edu/umd/cs/piccolo/PNode.java @@ -2637,7 +2637,8 @@ printJob.print(); } catch (PrinterException e) { - throw new RuntimeException("Error Printing", e); + System.out.println("Error Printing"); + e.printStackTrace(); } } } 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 159930e..9aee2f9 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,7 +399,8 @@ results = new int[NUM_CONTEXTS][NUM_TESTS]; } catch (IOException e) { - throw new RuntimeException(e); + e.printStackTrace(); + System.exit(1); } } 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 92ee856..237411d 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,8 +267,7 @@ catch (InvocationTargetException e) { // Since this is how Swing handles Exceptions that get // thrown on listeners, it's probably ok to do it here. - // mro: if Swing does it wrong we don't have to. - throw new RuntimeException(e); + e.printStackTrace(); } } } 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 7c47725..10960f8 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 @@ -360,12 +360,11 @@ 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 @@ -409,11 +408,10 @@ } } else { - // 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()); + new Exception("PInputEvent.getSourceSwingEvent was not a MouseEvent. Actual event: " + + sourceSwingEvent + ", class=" + sourceSwingEvent.getClass().getName()).printStackTrace(); } - } + } } /** 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 8921f08..5f6db1e 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,8 +383,7 @@ return new Line2D.Double(l2.getP1(), l2.getP2()); } else { - // either throw an exception or don't. But don't just write to sysout - // new Exception().printStackTrace(); + 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 d4a3edd..0274484 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) { - throw new RuntimeException(e); + e.printStackTrace(); } return aRect; } @@ -182,7 +182,7 @@ SWTShapeManager.transform(aRect, transform.createInverse()); } catch (Exception e) { - throw new RuntimeException(e); + e.printStackTrace(); } return aRect; } @@ -311,7 +311,7 @@ sizeInt = Integer.parseInt(size.substring(size.indexOf("=") + 1, size.length())); } catch (Exception e) { - throw new RuntimeException(e); + e.printStackTrace(); } cachedFont = new org.eclipse.swt.graphics.Font(device,