JDK-4313120 : ColorUIResource: add Alpha channel support (plus another request)
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.2.2
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2000-02-16
  • Updated: 2003-10-28
  • Resolved: 2003-10-28
Related Reports
Duplicate :  
Description

Name: krT82822			Date: 02/16/2000


java version "1.2.2"
Classic VM (build JDK-1.2.2-001, native threads, nojit)

a) Please add a ColorUIResource constructor which let us define the value for the alpha channel.

b) In addition,
ColorUIResource and FontUIResource extend, respectively, Color and Font.
Now I would like a containment rather extension.
Why? Because I implemented a Font and Color Cache. Now I have to use separate
caches for the "normal" Font and Color Objects and for the UIResource versions.
If u make implement it as containment, I would even have to use two caches, but
for example the Font-Objects, which are heavier could be shared by the
FontUIResource-Objects.

(Review ID: 100102) 
======================================================================

Comments
EVALUATION Yes, we should add the additional Color constructors. ###@###.### 2001-11-12 You can use the ColorUIResource(Color) constructor which will correctly deal with the alpha channel. As to extending vs containing. If we would have made FontUIResource and ColorUIResource contain vs extend it would mean you couldn't do something like: setFont(new FontUIResource(xxx)); Instead you would have to derefence. This would also mean we couldn't tell when the developer had explicitly set a font vs one coming from the UI. For example, we have code like: Font f = widget.getFont(); if (f instanceof UIResource) { // Developer didn't reset font, we can change it widget.setFont(xxx); } Without UIResource, we wouldn't be able to know this. I'm closing this is a duplicate of the bug that fixed the ColorUIResource constructors. ###@###.### 2003-10-28
28-10-2003