Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6797587
Votes 0
Synopsis Need better control over shapes cut out by hw/lw mixing
Category java:classes_awt
Reported Against
Release Fixed 6u14(b02)
State 11-Closed, Verified, bug
Priority: 2-High
Related Bugs 6776743 , 6800516 , 6816700
Submit Date 26-JAN-2009
Description
The fix 6776743 introduces the "boolean" API for controling how the hw/lw mixing code cuts out shapes of lw component from hw components. The API (the com.sun.awt.AWTUtilities class) is as follows:

setComponentNonOpaqueForMixing(Component component, boolean nonOpaque);

Making a component 'non-opaque-for-mixing' tells the mixing code to not cut out the shape of this component (but still cut out the shapes of its children).

However this API seems too limited: the new L&Fs which use non-opaque components to render rounded corners will work OK, but the rounded corners themselves will produce some kind of "unrendered pieces". To eliminate this limitation we need to remove the newly introduced API (it is introduced in 6u14b01, nobody uses it for now, it is not an "official" API), and replace it with the following API in 6u14b02:

setComponentMixingCutoutShape(Component component, Shape shape);

By default a component will have a null cutout shape, meaning the component should be considered opaque rectangle by the hw/lw mixing code. Setting an empty non-null shape means the component should be treated as a non-opaque entity (only the shapes of its children should be cut out by the mixing code). Finally, if one sets a non-null, non-empty shape to the component, exactly this shape will be cut out from hw components.
Posted Date : 2009-01-26 11:52:51.0
Work Around
N/A
Evaluation
The following method is added to the com.sun.awt.AWTUtilities class:

    /**
     * Sets a 'mixing-cutout' shape for the given component.
     *
     * By default a lightweight component is treated as an opaque rectangle for
     * the purposes of the Heavyweight/Lightweight Components Mixing feature.
     * This method enables developers to set an arbitrary shape to be cut out
     * from heavyweight components positioned underneath the lightweight
     * component in the z-order.
     * <p>
     * The {@code shape} argument may have the following values:
     * <ul>
     * <li>{@code null} - reverts the default cutout shape (the rectangle equal
     * to the component's {@code getBounds()})
     * <li><i>empty-shape</i> - does not cut out anything from heavyweight
     * components. This makes the given lightweight component effectively
     * transparent. Note that descendants of the lightweight component still
     * affect the shapes of heavyweight components.  An example of an
     * <i>empty-shape</i> is {@code new Rectangle()}.
     * <li><i>non-empty-shape</i> - the given shape will be cut out from
     * heavyweight components.
     * </ul>
     * <p>
     * The most common example when the 'mixing-cutout' shape is needed is a
     * glass pane component. The {@link JRootPane#setGlassPane()} method
     * automatically sets the <i>empty-shape</i> as the 'mixing-cutout' shape
     * for the given glass pane component.  If a developer needs some other
     * 'mixing-cutout' shape for the glass pane (which is rare), this must be
     * changed manually after installing the glass pane to the root pane.
     * <p>
     * Note that the 'mixing-cutout' shape neither affects painting, nor the
     * mouse events handling for the given component. It is used exclusively
     * for the purposes of the Heavyweight/Lightweight Components Mixing
     * feature.
     *
     * @param component the component that needs non-default
     * 'mixing-cutout' shape
     * @param shape the new 'mixing-cutout' shape
     * @throws NullPointerException if the component argument is {@code null}
     */
    public static void setComponentMixingCutoutShape(Component component,
            Shape shape);
Posted Date : 2009-01-29 13:52:35.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang