[piccolo2d-dev] Issue 124 in piccolo2d: Add additional constructors to PSWTImage
Updates: Status: Fixed Comment #10 on issue 124 by heuermh: Add additional constructors to PSWTImage http://code.google.com/p/piccolo2d/issues/detail?id=124 Committing patch, review/vote at revision link below. $ svn commit -m Issue 124 ; adding new protected method void disposeImage, to allow subclasses to override default behavior swt Sendingswt/src/main/java/edu/umd/cs/piccolox/swt/PSWTImage.java Transmitting file data . Committed revision 728. -- You received this message because you are listed in the owner or CC fields of this issue, or because you starred this issue. You may adjust your issue notification preferences at: http://code.google.com/hosting/settings --~--~-~--~~~---~--~~ Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en -~--~~~~--~~--~--~---
[piccolo2d-dev] Issue 124 in piccolo2d: Add additional constructors to PSWTImage
Comment #8 on issue 124 by fabiofz: Add additional constructors to PSWTImage http://code.google.com/p/piccolo2d/issues/detail?id=124 Just wanted to say that I'm Ok with any other approach (although if a protected disposeImage() is provided, it might be nice providing a setter and getter too -- it seems a bit strange having to subclass it just to add that behavior). -- You received this message because you are listed in the owner or CC fields of this issue, or because you starred this issue. You may adjust your issue notification preferences at: http://code.google.com/hosting/settings --~--~-~--~~~---~--~~ Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en -~--~~~~--~~--~--~---
[piccolo2d-dev] Issue 124 in piccolo2d: Add additional constructors to PSWTImage
Comment #9 on issue 124 by heuermh: Add additional constructors to PSWTImage http://code.google.com/p/piccolo2d/issues/detail?id=124 Thanks for the input. This is why I feel that a boolean ctr parameter or a getter/setter pair might not be a good idea; consider the property slowInSlowOut on PInterpolatingActivity http://www.piccolo2d.org/doc/piccolo2d.java/release-1.2.1/apidocs/edu/umd/cs/piccolo/activities/PInterpolatingActivity.html#setSlowInSlowOut%28boolean%29 Here a boolean flag was used to discriminate between two different behaviors. The problem arises when you want a third possible behavior, or more (i.e. Issue 107). Now we have a meaningless pair of methods (or constructors, in the earlier patch) that must go through a deprecation cycle before they can go away. I can't say for sure that we'll ever come up with a third possible implementation of disposeImage(), but we might. -- You received this message because you are listed in the owner or CC fields of this issue, or because you starred this issue. You may adjust your issue notification preferences at: http://code.google.com/hosting/settings --~--~-~--~~~---~--~~ Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en -~--~~~~--~~--~--~---
[piccolo2d-dev] Issue 124 in piccolo2d: Add additional constructors to PSWTImage
Comment #6 on issue 124 by allain.lalonde: Add additional constructors to PSWTImage http://code.google.com/p/piccolo2d/issues/detail?id=124 I agree with heuermh. Seems simpler. Though I'd add a getter and setter for the boolean disposesImage and default would be true. -- You received this message because you are listed in the owner or CC fields of this issue, or because you starred this issue. You may adjust your issue notification preferences at: http://code.google.com/hosting/settings --~--~-~--~~~---~--~~ Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en -~--~~~~--~~--~--~---
[piccolo2d-dev] Issue 124 in piccolo2d: Add additional constructors to PSWTImage
Comment #7 on issue 124 by heuermh: Add additional constructors to PSWTImage http://code.google.com/p/piccolo2d/issues/detail?id=124 (No comment was entered for this change.) Attachments: patch.txt 1008 bytes -- You received this message because you are listed in the owner or CC fields of this issue, or because you starred this issue. You may adjust your issue notification preferences at: http://code.google.com/hosting/settings --~--~-~--~~~---~--~~ Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en -~--~~~~--~~--~--~---
[piccolo2d-dev] Issue 124 in piccolo2d: Add additional constructors to PSWTImage
Updates: Status: Accepted Owner: heuermh Comment #4 on issue 124 by heuermh: Add additional constructors to PSWTImage http://code.google.com/p/piccolo2d/issues/detail?id=124 There is something missing from this patch. I can only assume it should be public PSWTImage(final PSWTCanvas canvas, final boolean disposeImage) { super(); this.canvas = canvas; this.canvas.addDisposeListener(new DisposeListener() { public void widgetDisposed(final DisposeEvent disposeEvent) { if (disposeImage (image != null)) { image.dispose(); } } }); } If this is the case, rather than polluting the API with several additional constructors with a boolean parameter, I would like to add a new protected method protected void disposeImage() { if (image != null) { image.dispose(); } } and call that method from the DisposeListener. This would allow subclasses of PSWTImage to override the default behaviour if desired. -- You received this message because you are listed in the owner or CC fields of this issue, or because you starred this issue. You may adjust your issue notification preferences at: http://code.google.com/hosting/settings --~--~-~--~~~---~--~~ Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en -~--~~~~--~~--~--~---
[piccolo2d-dev] Issue 124 in piccolo2d: Add additional constructors to PSWTImage
Status: New Owner: Labels: Type-Enhancement Priority-Medium Effort-Medium OpSys-All Toolkit-Piccolo2D.Java New issue 124 by heuermh: Add additional constructors to PSWTImage http://code.google.com/p/piccolo2d/issues/detail?id=124 Old post to piccolo-dev, referred to in Issue 43. From: Fabio Zadrozny Date: Thu Apr 13 10:12:12 EDT 2006 Sure, thanks... And while we are at it, there is another 'dispose' related thing I wanted to request... It's not a bug, but a feature-request I find important... I'm doing an Eclipse plugin, and I manage all the Images and dispose them carefully (and share it among lot's of objects), so, I've added the following constructors to PSWTImage, which I think should be in the 'default' distribution, as I think that's pretty common when using SWT (sharing an image through several objects). Thanks, Fabio CODE: PSWTImage.java public PSWTImage(PSWTCanvas canvas) { this(canvas, true); } public PSWTImage(PSWTCanvas canvas, final boolean disposeImage) { super(); this.canvas canvas.addDisposeListener(new DisposeListener() { public void widgetDisposed(DisposeEvent de) { if (image !image.dispose(); } } }); } public PSWTImage(PSWTCanvas canvas, Image newImage) { this(canvas, newImage, true); } public PSWTImage(PSWTCanvas canvas, Image newImage, boolean disposeImage) { this(canvas, disposeImage); setImage(newImage); } public PSWTImage(PSWTCanvas canvas, String fileName) { this(canvas, fileName, true); } public PSWTImage(PSWTCanvas canvas, String fileName, boolean disposeImage) { this(canvas, disposeImage); setImage(fileName); } -- You received this message because you are listed in the owner or CC fields of this issue, or because you starred this issue. You may adjust your issue notification preferences at: http://code.google.com/hosting/settings --~--~-~--~~~---~--~~ Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en -~--~~~~--~~--~--~---