Exemplo n.º 1
0
 private void gcChanged() {
   GCWrapper wrap = (GCWrapper) gcSelection.getSelectedItem();
   // assert wrap != null;
   GraphicsConfiguration gc = wrap.getGC();
   // assert gc != null;
   // Image Caps
   ImageCapabilities imageCaps = gc.getImageCapabilities();
   imageAccelerated.setSelected(imageCaps.isAccelerated());
   imageTrueVolatile.setSelected(imageCaps.isTrueVolatile());
   // Buffer Caps
   BufferCapabilities bufferCaps = gc.getBufferCapabilities();
   flipping.setSelected(bufferCaps.isPageFlipping());
   flippingMethod.setText(getFlipText(bufferCaps.getFlipContents()));
   fullScreen.setSelected(bufferCaps.isFullScreenRequired());
   multiBuffer.setSelected(bufferCaps.isMultiBufferAvailable());
   // Front buffer caps
   imageCaps = bufferCaps.getFrontBufferCapabilities();
   fbAccelerated.setSelected(imageCaps.isAccelerated());
   fbTrueVolatile.setSelected(imageCaps.isTrueVolatile());
   imageCaps = bufferCaps.getFrontBufferCapabilities();
   // Back buffer caps
   imageCaps = bufferCaps.getBackBufferCapabilities();
   bbAccelerated.setSelected(imageCaps.isAccelerated());
   bbTrueVolatile.setSelected(imageCaps.isTrueVolatile());
 }
 /**
  * Returns a {@link VolatileImage} with a data layout and color model compatible with this <code>
  * GraphicsConfiguration</code>, using the specified image capabilities and transparency value. If
  * the <code>caps</code> parameter is null, it is effectively ignored and this method will create
  * a VolatileImage without regard to <code>ImageCapabilities</code> constraints.
  *
  * <p>The returned <code>VolatileImage</code> has a layout and color model that is closest to this
  * native device configuration and can therefore be optimally blitted to this device.
  *
  * @param width the width of the returned <code>VolatileImage</code>
  * @param height the height of the returned <code>VolatileImage</code>
  * @param caps the image capabilities
  * @param transparency the specified transparency mode
  * @return a <code>VolatileImage</code> whose data layout and color model is compatible with this
  *     <code>GraphicsConfiguration</code>.
  * @see Transparency#OPAQUE
  * @see Transparency#BITMASK
  * @see Transparency#TRANSLUCENT
  * @throws IllegalArgumentException if the transparency is not a valid value
  * @exception AWTException if the supplied image capabilities could not be met by this graphics
  *     configuration
  * @see Component#createVolatileImage(int, int)
  * @since 1.5
  */
 public VolatileImage createCompatibleVolatileImage(
     int width, int height, ImageCapabilities caps, int transparency) throws AWTException {
   VolatileImage vi = new Container().createVolatileImage(width, height, caps);
   if (caps != null && caps.isAccelerated() && !vi.getCapabilities().isAccelerated()) {
     throw new AWTException(
         "Supplied image capabilities could not " + "be met by this graphics configuration.");
   }
   return vi;
 }