ImageConsumer Properties

In “The ImageConsumer Interface”, we briefly discussed ImageConsumer.setProperties(), which can be used to set properties associated with an image consumer. setProperties() is a somewhat of an odd method because there is no corresponding getProperties(). Properties are used mainly as a debugging technique and are typically viewed in a debugger. If you wish to view the properties associated with an image filter without the aid of a debugger, you must implement a filter that overrides setProperties() and prints out the properties.

For example, we can modify the applet listed in Example 6-3 so that the properties associated with the ReplicateScaleFilter are printed out. First, an extension of java.awt.image.ImageFilter

Get Graphic Java™ 1.2, Volume I: AWT, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.