jdk/src/share/classes/java/awt/GraphicsConfiguration.java
author anthony
Tue, 05 May 2009 17:56:31 +0400
changeset 3444 18840bd1c784
parent 2451 597df8e1d786
child 2648 aa45a227fce3
permissions -rw-r--r--
6818787: It is possible to reposition the security icon too far from the border of the window on X11 Summary: The constraints for the position of the icon are moved to the shared code Reviewed-by: art, dcherepanov
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
2451
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 2
diff changeset
     2
 * Copyright 1997-2009 Sun Microsystems, Inc.  All Rights Reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 * have any questions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package java.awt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.awt.geom.AffineTransform;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import java.awt.image.BufferedImage;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.awt.image.ColorModel;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import java.awt.image.VolatileImage;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import java.awt.image.WritableRaster;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
import sun.awt.image.SunVolatileImage;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * The <code>GraphicsConfiguration</code> class describes the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * characteristics of a graphics destination such as a printer or monitor.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * There can be many <code>GraphicsConfiguration</code> objects associated
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * with a single graphics device, representing different drawing modes or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * capabilities.  The corresponding native structure will vary from platform
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * to platform.  For example, on X11 windowing systems,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * each visual is a different <code>GraphicsConfiguration</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * On Microsoft Windows, <code>GraphicsConfiguration</code>s represent
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * PixelFormats available in the current resolution and color depth.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 * In a virtual device multi-screen environment in which the desktop
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 * area could span multiple physical screen devices, the bounds of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 * <code>GraphicsConfiguration</code> objects are relative to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 * virtual coordinate system.  When setting the location of a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 * component, use {@link #getBounds() getBounds} to get the bounds of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 * the desired <code>GraphicsConfiguration</code> and offset the location
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 * with the coordinates of the <code>GraphicsConfiguration</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 * as the following code sample illustrates:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 * </p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
 * <pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 *      Frame f = new Frame(gc);  // where gc is a GraphicsConfiguration
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
 *      Rectangle bounds = gc.getBounds();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
 *      f.setLocation(10 + bounds.x, 10 + bounds.y); </pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
 * To determine if your environment is a virtual device
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
 * environment, call <code>getBounds</code> on all of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
 * <code>GraphicsConfiguration</code> objects in your system.  If
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
 * any of the origins of the returned bounds is not (0,&nbsp;0),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
 * your environment is a virtual device environment.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
 * You can also use <code>getBounds</code> to determine the bounds
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
 * of the virtual device.  To do this, first call <code>getBounds</code> on all
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
 * of the <code>GraphicsConfiguration</code> objects in your
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
 * system.  Then calculate the union of all of the bounds returned
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
 * from the calls to <code>getBounds</code>.  The union is the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
 * bounds of the virtual device.  The following code sample
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
 * calculates the bounds of the virtual device.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
 * <pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
 *      Rectangle virtualBounds = new Rectangle();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
 *      GraphicsEnvironment ge = GraphicsEnvironment.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
 *              getLocalGraphicsEnvironment();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
 *      GraphicsDevice[] gs =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
 *              ge.getScreenDevices();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
 *      for (int j = 0; j < gs.length; j++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
 *          GraphicsDevice gd = gs[j];
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
 *          GraphicsConfiguration[] gc =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
 *              gd.getConfigurations();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
 *          for (int i=0; i < gc.length; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
 *              virtualBounds =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
 *                  virtualBounds.union(gc[i].getBounds());
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
 *          }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
 *      } </pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
 * @see Window
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
 * @see Frame
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
 * @see GraphicsEnvironment
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
 * @see GraphicsDevice
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
 * REMIND:  What to do about capabilities?
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
 * The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
 * capabilities of the device can be determined by enumerating the possible
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
 * capabilities and checking if the GraphicsConfiguration
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
 * implements the interface for that capability.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
public abstract class GraphicsConfiguration {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
    private static BufferCapabilities defaultBufferCaps;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
    private static ImageCapabilities defaultImageCaps;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
     * This is an abstract class that cannot be instantiated directly.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
     * Instances must be obtained from a suitable factory or query method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
     * @see GraphicsDevice#getConfigurations
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
     * @see GraphicsDevice#getDefaultConfiguration
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
     * @see GraphicsDevice#getBestConfiguration
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
     * @see Graphics2D#getDeviceConfiguration
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
    protected GraphicsConfiguration() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
     * Returns the {@link GraphicsDevice} associated with this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
     * <code>GraphicsConfiguration</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
     * @return a <code>GraphicsDevice</code> object that is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
     * associated with this <code>GraphicsConfiguration</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
    public abstract GraphicsDevice getDevice();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
     * Returns a {@link BufferedImage} with a data layout and color model
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
     * compatible with this <code>GraphicsConfiguration</code>.  This
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
     * method has nothing to do with memory-mapping
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
     * a device.  The returned <code>BufferedImage</code> has
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
     * a layout and color model that is closest to this native device
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
     * configuration and can therefore be optimally blitted to this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
     * device.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
     * @param width the width of the returned <code>BufferedImage</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
     * @param height the height of the returned <code>BufferedImage</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
     * @return a <code>BufferedImage</code> whose data layout and color
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
     * model is compatible with this <code>GraphicsConfiguration</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
    public BufferedImage createCompatibleImage(int width, int height) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
        ColorModel model = getColorModel();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
        WritableRaster raster =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
            model.createCompatibleWritableRaster(width, height);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
        return new BufferedImage(model, raster,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
                                 model.isAlphaPremultiplied(), null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     * Returns a <code>BufferedImage</code> that supports the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     * transparency and has a data layout and color model
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     * compatible with this <code>GraphicsConfiguration</code>.  This
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
     * method has nothing to do with memory-mapping
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     * a device. The returned <code>BufferedImage</code> has a layout and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
     * color model that can be optimally blitted to a device
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
     * with this <code>GraphicsConfiguration</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
     * @param width the width of the returned <code>BufferedImage</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
     * @param height the height of the returned <code>BufferedImage</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
     * @param transparency the specified transparency mode
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
     * @return a <code>BufferedImage</code> whose data layout and color
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
     * model is compatible with this <code>GraphicsConfiguration</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
     * and also supports the specified transparency.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
     * @throws IllegalArgumentException if the transparency is not a valid value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
     * @see Transparency#OPAQUE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
     * @see Transparency#BITMASK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
     * @see Transparency#TRANSLUCENT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
    public BufferedImage createCompatibleImage(int width, int height,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
                                               int transparency)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
        if (getColorModel().getTransparency() == transparency) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
            return createCompatibleImage(width, height);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
        ColorModel cm = getColorModel(transparency);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
        if (cm == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
            throw new IllegalArgumentException("Unknown transparency: " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
                                               transparency);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
        WritableRaster wr = cm.createCompatibleWritableRaster(width, height);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
        return new BufferedImage(cm, wr, cm.isAlphaPremultiplied(), null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
     * Returns a {@link VolatileImage} with a data layout and color model
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
     * compatible with this <code>GraphicsConfiguration</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
     * The returned <code>VolatileImage</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
     * may have data that is stored optimally for the underlying graphics
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
     * device and may therefore benefit from platform-specific rendering
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
     * acceleration.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
     * @param width the width of the returned <code>VolatileImage</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
     * @param height the height of the returned <code>VolatileImage</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
     * @return a <code>VolatileImage</code> whose data layout and color
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
     * model is compatible with this <code>GraphicsConfiguration</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
     * @see Component#createVolatileImage(int, int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
    public VolatileImage createCompatibleVolatileImage(int width, int height) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
        VolatileImage vi = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
            vi = createCompatibleVolatileImage(width, height,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
                                               null, Transparency.OPAQUE);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
        } catch (AWTException e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
            // shouldn't happen: we're passing in null caps
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
            assert false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
        return vi;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
     * Returns a {@link VolatileImage} with a data layout and color model
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
     * compatible with this <code>GraphicsConfiguration</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
     * The returned <code>VolatileImage</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
     * may have data that is stored optimally for the underlying graphics
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
     * device and may therefore benefit from platform-specific rendering
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
     * acceleration.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
     * @param width the width of the returned <code>VolatileImage</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
     * @param height the height of the returned <code>VolatileImage</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
     * @param transparency the specified transparency mode
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
     * @return a <code>VolatileImage</code> whose data layout and color
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
     * model is compatible with this <code>GraphicsConfiguration</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
     * @throws IllegalArgumentException if the transparency is not a valid value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
     * @see Transparency#OPAQUE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
     * @see Transparency#BITMASK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
     * @see Transparency#TRANSLUCENT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
     * @see Component#createVolatileImage(int, int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
    public VolatileImage createCompatibleVolatileImage(int width, int height,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
                                                       int transparency)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
        VolatileImage vi = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
            vi = createCompatibleVolatileImage(width, height, null, transparency);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
        } catch (AWTException e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
            // shouldn't happen: we're passing in null caps
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
            assert false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
        return vi;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
     * Returns a {@link VolatileImage} with a data layout and color model
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
     * compatible with this <code>GraphicsConfiguration</code>, using
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
     * the specified image capabilities.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
     * If the <code>caps</code> parameter is null, it is effectively ignored
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
     * and this method will create a VolatileImage without regard to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
     * <code>ImageCapabilities</code> constraints.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
     * The returned <code>VolatileImage</code> has
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
     * a layout and color model that is closest to this native device
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
     * configuration and can therefore be optimally blitted to this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
     * device.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
     * @return a <code>VolatileImage</code> whose data layout and color
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
     * model is compatible with this <code>GraphicsConfiguration</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
     * @param width the width of the returned <code>VolatileImage</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
     * @param height the height of the returned <code>VolatileImage</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
     * @param caps the image capabilities
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
     * @exception AWTException if the supplied image capabilities could not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
     * be met by this graphics configuration
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
    public VolatileImage createCompatibleVolatileImage(int width, int height,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
        ImageCapabilities caps) throws AWTException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
        return createCompatibleVolatileImage(width, height, caps,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
                                             Transparency.OPAQUE);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
     * Returns a {@link VolatileImage} with a data layout and color model
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
     * compatible with this <code>GraphicsConfiguration</code>, using
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
     * the specified image capabilities and transparency value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
     * If the <code>caps</code> parameter is null, it is effectively ignored
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
     * and this method will create a VolatileImage without regard to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
     * <code>ImageCapabilities</code> constraints.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
     * The returned <code>VolatileImage</code> has
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
     * a layout and color model that is closest to this native device
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
     * configuration and can therefore be optimally blitted to this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
     * device.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
     * @param width the width of the returned <code>VolatileImage</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
     * @param height the height of the returned <code>VolatileImage</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
     * @param caps the image capabilities
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
     * @param transparency the specified transparency mode
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
     * @return a <code>VolatileImage</code> whose data layout and color
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
     * model is compatible with this <code>GraphicsConfiguration</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
     * @see Transparency#OPAQUE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
     * @see Transparency#BITMASK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
     * @see Transparency#TRANSLUCENT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
     * @throws IllegalArgumentException if the transparency is not a valid value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
     * @exception AWTException if the supplied image capabilities could not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
     * be met by this graphics configuration
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
     * @see Component#createVolatileImage(int, int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
    public VolatileImage createCompatibleVolatileImage(int width, int height,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
        ImageCapabilities caps, int transparency) throws AWTException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
        VolatileImage vi =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
            new SunVolatileImage(this, width, height, transparency, caps);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
        if (caps != null && caps.isAccelerated() &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
            !vi.getCapabilities().isAccelerated())
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
        {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
            throw new AWTException("Supplied image capabilities could not " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
                                   "be met by this graphics configuration.");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
        return vi;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
     * Returns the {@link ColorModel} associated with this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
     * <code>GraphicsConfiguration</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
     * @return a <code>ColorModel</code> object that is associated with
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
     * this <code>GraphicsConfiguration</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
    public abstract ColorModel getColorModel();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
     * Returns the <code>ColorModel</code> associated with this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
     * <code>GraphicsConfiguration</code> that supports the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
     * transparency.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
     * @param transparency the specified transparency mode
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
     * @return a <code>ColorModel</code> object that is associated with
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
     * this <code>GraphicsConfiguration</code> and supports the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
     * specified transparency or null if the transparency is not a valid
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
     * value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
     * @see Transparency#OPAQUE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
     * @see Transparency#BITMASK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
     * @see Transparency#TRANSLUCENT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
    public abstract ColorModel getColorModel(int transparency);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
     * Returns the default {@link AffineTransform} for this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
     * <code>GraphicsConfiguration</code>. This
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
     * <code>AffineTransform</code> is typically the Identity transform
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
     * for most normal screens.  The default <code>AffineTransform</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
     * maps coordinates onto the device such that 72 user space
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
     * coordinate units measure approximately 1 inch in device
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
     * space.  The normalizing transform can be used to make
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
     * this mapping more exact.  Coordinates in the coordinate space
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
     * defined by the default <code>AffineTransform</code> for screen and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
     * printer devices have the origin in the upper left-hand corner of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
     * the target region of the device, with X coordinates
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
     * increasing to the right and Y coordinates increasing downwards.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
     * For image buffers not associated with a device, such as those not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
     * created by <code>createCompatibleImage</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
     * this <code>AffineTransform</code> is the Identity transform.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
     * @return the default <code>AffineTransform</code> for this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
     * <code>GraphicsConfiguration</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
    public abstract AffineTransform getDefaultTransform();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
     * Returns a <code>AffineTransform</code> that can be concatenated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
     * with the default <code>AffineTransform</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
     * of a <code>GraphicsConfiguration</code> so that 72 units in user
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
     * space equals 1 inch in device space.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
     * For a particular {@link Graphics2D}, g, one
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
     * can reset the transformation to create
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
     * such a mapping by using the following pseudocode:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
     * <pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
     *      GraphicsConfiguration gc = g.getDeviceConfiguration();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
     *      g.setTransform(gc.getDefaultTransform());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
     *      g.transform(gc.getNormalizingTransform());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
     * </pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
     * Note that sometimes this <code>AffineTransform</code> is identity,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
     * such as for printers or metafile output, and that this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
     * <code>AffineTransform</code> is only as accurate as the information
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
     * supplied by the underlying system.  For image buffers not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
     * associated with a device, such as those not created by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
     * <code>createCompatibleImage</code>, this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
     * <code>AffineTransform</code> is the Identity transform
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
     * since there is no valid distance measurement.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
     * @return an <code>AffineTransform</code> to concatenate to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
     * default <code>AffineTransform</code> so that 72 units in user
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
     * space is mapped to 1 inch in device space.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
    public abstract AffineTransform getNormalizingTransform();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
     * Returns the bounds of the <code>GraphicsConfiguration</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
     * in the device coordinates. In a multi-screen environment
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
     * with a virtual device, the bounds can have negative X
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
     * or Y origins.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
     * @return the bounds of the area covered by this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
     * <code>GraphicsConfiguration</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
     * @since 1.3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
    public abstract Rectangle getBounds();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
    private static class DefaultBufferCapabilities extends BufferCapabilities {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
        public DefaultBufferCapabilities(ImageCapabilities imageCaps) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
            super(imageCaps, imageCaps, null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
     * Returns the buffering capabilities of this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
     * <code>GraphicsConfiguration</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
     * @return the buffering capabilities of this graphics
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
     * configuration object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
    public BufferCapabilities getBufferCapabilities() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
        if (defaultBufferCaps == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
            defaultBufferCaps = new DefaultBufferCapabilities(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
                getImageCapabilities());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
        return defaultBufferCaps;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
     * Returns the image capabilities of this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
     * <code>GraphicsConfiguration</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
     * @return the image capabilities of this graphics
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
     * configuration object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
    public ImageCapabilities getImageCapabilities() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
        if (defaultImageCaps == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
            defaultImageCaps = new ImageCapabilities(false);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
        return defaultImageCaps;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
    }
2451
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 2
diff changeset
   437
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 2
diff changeset
   438
    /**
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 2
diff changeset
   439
     * Returns whether this GraphicsConfiguration supports
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 2
diff changeset
   440
     * the {@link GraphicsDevice.WindowTranslucency#PERPIXEL_TRANSLUCENT
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 2
diff changeset
   441
     * PERPIXEL_TRANSLUCENT} kind of translucency.
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 2
diff changeset
   442
     *
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 2
diff changeset
   443
     * @param gc GraphicsConfiguration
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 2
diff changeset
   444
     * @throws NullPointerException if the gc argument is null
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 2
diff changeset
   445
     * @return whether the given GraphicsConfiguration supports
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 2
diff changeset
   446
     *         the translucency effects.
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 2
diff changeset
   447
     * @see Window#setBackground(Color)
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 2
diff changeset
   448
     */
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 2
diff changeset
   449
    /*public */boolean isTranslucencyCapable() {
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 2
diff changeset
   450
        // Overridden in subclasses
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 2
diff changeset
   451
        return false;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
    }
2451
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 2
diff changeset
   453
}