Package java.awt

Examples of java.awt.GraphicsConfiguration$DefaultBufferCapabilities


          .getLocalGraphicsEnvironment();
      // dual head, use first screen
      if (ge.getScreenDevices().length > 1) {
        try {
          GraphicsDevice gd = ge.getDefaultScreenDevice();
          GraphicsConfiguration config = gd.getConfigurations()[0];
          frameD = config.getBounds().getSize();
          framePos = config.getBounds().getLocation();
        } catch (RuntimeException e) {
          frameD = Toolkit.getDefaultToolkit().getScreenSize();
          framePos = new Point(0, 0);
        }
      }
View Full Code Here


     *
     * @param bounds
     * @return BufferedImage
     */
    private BufferedImage getImage(Rectangle bounds) {
      GraphicsConfiguration gc = getGraphicsConfiguration();
      BufferedImage textImage = gc.createCompatibleImage(bounds.width, bounds.height, Transparency.TRANSLUCENT);
      return textImage;
    }
View Full Code Here

   * only if the given component is on the same screen as the cursor. Return
   * null otherwise.
   */
  private static Point getPointerLocation(final Component component) {
    try {
      final GraphicsConfiguration config = component.getGraphicsConfiguration();
      if (config != null) {
        PointerInfo pointer_info = AccessController.doPrivileged(new PrivilegedExceptionAction<PointerInfo>() {
          public PointerInfo run() throws Exception {
            return MouseInfo.getPointerInfo();
          }
        });
        GraphicsDevice device = pointer_info.getDevice();
        if (device == config.getDevice()) {
          return pointer_info.getLocation();
        }
        return null;
      }
    } catch (Exception e) {
View Full Code Here

  }
   
    public static int getPreferedBufferedImageType(){
    GraphicsDevice[] graphicsDevices = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();
    GraphicsDevice graphicsDevice = graphicsDevices[0];
    GraphicsConfiguration graphicsConfiguration = graphicsDevice.getConfigurations()[0];
    return graphicsConfiguration.createCompatibleImage(1, 1).getType();
  }
View Full Code Here

    }
   
    private void renderVolatileImage(BufferedImage bufferedImage) {
        do {
            int w = bufferedImage.getWidth(), h = bufferedImage.getHeight();
            GraphicsConfiguration gc = getGraphicsConfiguration();
            if (volatileImage == null || volatileImage.getWidth() != w
                    || volatileImage.getHeight() != h
                    || volatileImage.validate(gc) == VolatileImage.IMAGE_INCOMPATIBLE) {
                if (volatileImage != null) {
                    volatileImage.flush();
                }
                volatileImage = gc.createCompatibleVolatileImage(w, h);
                volatileImage.setAccelerationPriority(1.0f);
            }
            //
            // Now paint the BufferedImage into the accelerated image
            //
View Full Code Here

            if (alpha < 1.0f) {
                g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha));
            }

            if (currentImage != null) {
                GraphicsConfiguration gc = getGraphicsConfiguration();
                // If the GraphicsConfig changed, then change the hints being used
                if (gc.getClass() != graphicsConfigClass) {
                    graphicsConfigClass = gc.getClass();
                    updateRenderingHints(graphicsConfigClass);
                }
                if (!renderingHints.isEmpty()) {
                    g2d.setRenderingHints(renderingHints);
                }
View Full Code Here

                boolean hasAlpha)
        {
            GraphicsEnvironment ge = GraphicsEnvironment
                    .getLocalGraphicsEnvironment();
            GraphicsDevice gd = ge.getDefaultScreenDevice();
            GraphicsConfiguration gc = gd.getDefaultConfiguration();
            return gc.createCompatibleImage(width, height,
                    Transparency.TRANSLUCENT);
        }
View Full Code Here

            /*
             * throw new Exception();
             */

            // #else
            GraphicsConfiguration config = o.getGraphicsConfiguration();
            GraphicsDevice dev = config.getDevice();
            d = config.getBounds();

            // #endif JAVA1
        } catch (Throwable t) {
        }
        positionComponent(p, c, d);
View Full Code Here

      /*
       * throw new Exception();
       */

      // #else
      GraphicsConfiguration config = o.getGraphicsConfiguration();
      GraphicsDevice dev = config.getDevice();
      d = config.getBounds();

      // #endif JAVA1
    } catch (Throwable t) {
    }
    positionComponent(p, c, d);
View Full Code Here

            /*
             * throw new Exception();
             */

            // #else
            GraphicsConfiguration config = o.getGraphicsConfiguration();
            GraphicsDevice dev = config.getDevice();
            d = config.getBounds();

            // #endif JAVA1
        } catch (Throwable t) {
        }
        positionComponent(p, c, d);
View Full Code Here

TOP

Related Classes of java.awt.GraphicsConfiguration$DefaultBufferCapabilities

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.