Package java.awt

Examples of java.awt.GraphicsConfiguration$DefaultBufferCapabilities


    public static Rectangle getDestinationBounds(Graphics2D g2d) {
        BufferedImage bi = getDestination(g2d);
        if (bi != null)
            return new Rectangle(0, 0, bi.getWidth(), bi.getHeight());

        GraphicsConfiguration gc = g2d.getDeviceConfiguration();

        // We are going to a BufferedImage but no hint was provided
        // so we can't determine the destination bounds.
        if (gc.getDevice().getType() == GraphicsDevice.TYPE_IMAGE_BUFFER)
            return null;

        // This is a JDK 1.3ism, so we will just return null...
        // return gc.getBounds();
        return null;
View Full Code Here


  }

  public static void saveScreenShot(final int modifiers)
  {
    final Component component = KeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow();
    final GraphicsConfiguration graphicsConfiguration = component.getGraphicsConfiguration();
    final GraphicsDevice graphicsDevice = graphicsConfiguration.getDevice();
    try
    {
      final Robot robot = new Robot(graphicsDevice);
      final BufferedImage image;
      if ((modifiers & ActionEvent.SHIFT_MASK) == ActionEvent.SHIFT_MASK)
      {
        image = robot.createScreenCapture(graphicsConfiguration.getBounds());
      }
      else
      {
        image = robot.createScreenCapture(component.getBounds());
      }
View Full Code Here

        }
    }

    public void run() {
        // Must find a graphics configuration with a depth of 32 bits
        GraphicsConfiguration gconfig = WindowUtils.getAlphaCompatibleGraphicsConfiguration();
        frame = new JFrame("Alpha Mask Demo");
        alphaWindow = new JWindow(frame, gconfig);
        icon = new JLabel();
        icon.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
        alphaWindow.getContentPane().add(icon);
View Full Code Here

        update(true, false);
    }
   
    public void run() {
        // Must find a graphics configuration with a depth of 32 bits
        GraphicsConfiguration gconfig = WindowUtils.getAlphaCompatibleGraphicsConfiguration();
        frame = new JFrame("Alpha Mask Demo");
        alphaWindow = new JWindow(frame, gconfig);
        MouseInputAdapter handler = new MouseInputAdapter() {
            private Point offset;
            public void mousePressed(MouseEvent e) {
View Full Code Here

         */
        private boolean paintBuffered(Graphics2D graphics) {
            boolean painted = false;

            // Paint the display into an offscreen buffer
            GraphicsConfiguration gc = graphics.getDeviceConfiguration();
            java.awt.Rectangle clipBounds = graphics.getClipBounds();

            if (bufferedImage == null
                || bufferedImageGC != gc
                || bufferedImage.getWidth() < clipBounds.width
                || bufferedImage.getHeight() < clipBounds.height) {

                bufferedImage = gc.createCompatibleImage(clipBounds.width,
                    clipBounds.height, Transparency.OPAQUE);
                bufferedImageGC = gc;
            }

            if (bufferedImage != null) {
View Full Code Here

         */
        private boolean paintVolatileBuffered(Graphics2D graphics) {
            boolean painted = false;

            // Paint the display into a volatile offscreen buffer
            GraphicsConfiguration gc = graphics.getDeviceConfiguration();
            java.awt.Rectangle gcBounds = gc.getBounds();
            if (volatileImage == null || volatileImageGC != gc) {
                if (volatileImage != null) {
                    volatileImage.flush();
                }
                volatileImage = gc.createCompatibleVolatileImage(gcBounds.width, gcBounds.height,
                    Transparency.OPAQUE);
                // we need to create a new volatile if the GC changes
                volatileImageGC = gc;
            }

View Full Code Here

          r.x += i.left;
          r.y += i.top;
          r.width -= (i.left + i.right);
          r.height -= (i.top + i.bottom);

          GraphicsConfiguration gc = parent.getGraphicsConfiguration();
          Rectangle popupArea = getContainerPopupArea(gc);
          return r.intersection(popupArea).contains(x, y, width, height);

        } else if (parent instanceof JApplet) {
          Rectangle r = parent.getBounds();
View Full Code Here

        // create an ARGB image
        BufferedImage argbImage = new BufferedImage(width, height, imageType);

        // from there, create an image with Transparency.BITMASK
        Graphics2D g = argbImage.createGraphics();
        GraphicsConfiguration gc = g.getDeviceConfiguration();
        argbImage = gc.createCompatibleImage(width, height, Transparency.BITMASK);
        g.dispose();
        // create a red rectangle
        g = argbImage.createGraphics();
        g.setColor(Color.red);
        g.fillRect(0, 0, width, height);
View Full Code Here

  public void test(TestHarness harness)
  {
    try {
      Frame frame = new Frame();
      Window window = new Window(frame);
      GraphicsConfiguration gc = window.getGraphicsConfiguration();

      Permission[] showWindowWithoutWarningBanner = new Permission[] {
  new AWTPermission("showWindowWithoutWarningBanner")};

      TestSecurityManager sm = new TestSecurityManager(harness);
View Full Code Here

    }
    rendererRun = true;
            } else if (type == FREE_DRAWING_SURFACE) {
                Pipeline.getPipeline().freeDrawingSurfaceNative(o);
            } else if (type == GETBESTCONFIG) {
    GraphicsConfiguration gc = ((GraphicsConfiguration [])
        ((GraphicsConfigTemplate3D) o).testCfg)[0];
    sendRenderMessage(gc, o, type);
    rendererRun = true;
      } else if (type == ISCONFIGSUPPORT) {
    GraphicsConfiguration  gc = (GraphicsConfiguration)
        ((GraphicsConfigTemplate3D) o).testCfg;
    sendRenderMessage(gc, o, type);
    rendererRun = true;
      } else if ((type == SET_GRAPHICSCONFIG_FEATURES) ||
           (type == SET_QUERYPROPERTIES)) {
    GraphicsConfiguration gc = ((Canvas3D)o).graphicsConfiguration;
    sendRenderMessage(gc, o, type);
    rendererRun = true;
      } else if (type == SET_VIEW) {
    Canvas3D cv = (Canvas3D) o;
    cv.view = cv.pendingView;
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.