JDK-6804747 : Ensure consistent graphicsConfig member across components hierarchy
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 7
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2009-02-12
  • Updated: 2015-10-02
  • Resolved: 2011-03-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7 b55Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
When a component gets reparented to another top-level window, its locally cached graphics configuration (graphicsConfig member) should be updated to reflect the GC of the new parent frame. We need to ease this task, and also to make sure the whole component hierarchy belonging to a top-level window shares the same GC (the GC of this top-level window).

See this mailing thread for details:

http://mail.openjdk.java.net/pipermail/awt-dev/2009-January/000509.html

Comments
EVALUATION The fix is useful for: - 6783411; - automatic GC changing when we implement the public API for transparent windows; - public API for the DisplayChangeListener. The idea of the fix: 1. The graphicsConfig member is private to the java.awt.Component. 2. The method Component.setGraphicsConfiguration(GraphicsConfiguration gc) is used to update the value of the graphicsConfig memeber. The Container overrides the method to update the hierarchy of components. 3. The method ComponentPeer.updateGraphicsData(GraphicsConfiguration) is invoked on every graphicsConfig change to update peer's internal data structures. It is needed on MS Windows to invoke replaceSurfaceData(). 4. The method CanvasPeer.getAppropriateGraphicsConfiguration(GraphicsConfiguration) is invoked from the overriden Canvas.setGraphicsConfiguration() to choose the best possible GC for the Canvas. This is needed due to the ability of canvases to have a gc different from the toplevel window's one.
16-02-2009

EVALUATION The graphicsConfig memeber needs to be made private. The machinery that updates the member should be factored: 1. To meet the consistency requirements. 2. To ease the process of updating the member (including the descendents) should it be needed.
12-02-2009