JDK-4379971 : VolatileImages cannot subclass BufferedImage
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 1.4.0
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_nt
  • CPU: x86
  • Submitted: 2000-10-17
  • Updated: 2000-10-20
  • Resolved: 2000-10-20
Related Reports
Duplicate :  
Description
Currently, the new VolatileImage objects are implemented as subclasses
of BufferedImage.  This causes a problem with the specification of 
BufferedImage.  In particular, a BufferedImage is created as a static object
(with a static ColorModel, Raster, and SampleModel), whereas a VolatileImage
can change at any time due to situations such as display mode switches.

For example, if a user changes the bit depth setting (under Windows) we must
recreate the data inside of the VolatileImage to be compatible with this
new display depth (hardware surfaces must always be the same depth as the
display surface).

Because of this incompatibility, we need to make VolatileImage objects
subclass off of Image instead, so that the user can assume nothing about
the state or static nature of the image.

Comments
EVALUATION First of all, change VolatileImage from an interface to a class. This makes using the methods of VolatileImage easier, as the user does not have to cast the object into either an Image or VolatileImage to get the functionality they want. More importantly, make this class subclass directly off of Image instead of BufferedImage.
11-06-2004