Revision: 728 Author: heuermh Date: Thu Oct 15 11:19:00 2009 Log: Issue 124 ; adding new protected method void disposeImage, to allow subclasses to override default behavior http://code.google.com/p/piccolo2d/source/detail?r=728
Modified: /piccolo2d.java/trunk/swt/src/main/java/edu/umd/cs/piccolox/swt/PSWTImage.java ======================================= --- /piccolo2d.java/trunk/swt/src/main/java/edu/umd/cs/piccolox/swt/PSWTImage.java Tue Jul 28 13:58:25 2009 +++ /piccolo2d.java/trunk/swt/src/main/java/edu/umd/cs/piccolox/swt/PSWTImage.java Thu Oct 15 11:19:00 2009 @@ -64,9 +64,7 @@ this.canvas = canvas; canvas.addDisposeListener(new DisposeListener() { public void widgetDisposed(final DisposeEvent de) { - if (image != null) { - image.dispose(); - } + disposeImage(); } }); } @@ -125,6 +123,12 @@ firePropertyChange(PImage.PROPERTY_CODE_IMAGE, PImage.PROPERTY_IMAGE, old, image); } + + protected void disposeImage() { + if (image != null) { + image.dispose(); + } + } protected void paint(final PPaintContext paintContext) { if (getImage() != null) { --~--~---------~--~----~------------~-------~--~----~ Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en -~----------~----~----~----~------~----~------~--~---