Package java.awt

Examples of java.awt.GraphicsConfiguration$DefaultBufferCapabilities


                 || (this.chartBufferWidth != available.getWidth())
                 || (this.chartBufferHeight != available.getHeight()))
         {
            this.chartBufferWidth = (int) available.getWidth();
            this.chartBufferHeight = (int) available.getHeight();
            GraphicsConfiguration gc = g2.getDeviceConfiguration();
            this.chartBuffer = gc.createCompatibleImage(
                    this.chartBufferWidth, this.chartBufferHeight,
                    Transparency.TRANSLUCENT);
            this.refreshBuffer = true;
         }
View Full Code Here


  private void validateBounds(){
    Rectangle bounds = dialog.getBounds();
   
    Point location = dialog.getLocation();
   
    GraphicsConfiguration bestConfiguration = null;
    int bestDistance = 0;
   
    GraphicsEnvironment environment = GraphicsEnvironment.getLocalGraphicsEnvironment();
    for( GraphicsDevice device : environment.getScreenDevices() ){
      GraphicsConfiguration configuration = device.getDefaultConfiguration();
      Rectangle screenBounds = configuration.getBounds();
     
      if( screenBounds.contains( location )){
        bestConfiguration = configuration;
        bestDistance = 0;
      }
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();
            java.awt.image.BufferedImage bufferedImage =
                gc.createCompatibleImage(clipBounds.width, clipBounds.height,
                    Transparency.OPAQUE);

            if (bufferedImage != null) {
                Graphics2D bufferedImageGraphics = (Graphics2D)bufferedImage.getGraphics();
                bufferedImageGraphics.setClip(0, 0, clipBounds.width, clipBounds.height);
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 clipBounds = graphics.getClipBounds();
            java.awt.image.VolatileImage volatileImage =
                gc.createCompatibleVolatileImage(clipBounds.width, clipBounds.height,
                    Transparency.OPAQUE);

            // If we have a valid volatile image, attempt to paint the
            // display to it
            if (volatileImage != null) {
View Full Code Here

   * Compute the size of the drawable rectangle with respect to the frame. Take into account the
   * Frame header as well as bars that are added by the OS
   */
  @Override
  protected void calcSizes() {
      GraphicsConfiguration gc = getGraphicsConfiguration();
    Rectangle screenRect = gc.getBounds();
//System.out.println("Screen bounds: "+screenRect);
    // System.out.println("Screen size: " + screenRect);
      Toolkit tk = Toolkit.getDefaultToolkit();
      Insets desktopInsets = tk.getScreenInsets(gc);
//System.out.println("Desktop insets: "+desktopInsets);
View Full Code Here

            // try to find the graphics configuration for our point of interest
            GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
            GraphicsDevice[] gd = ge.getScreenDevices();
            for(int i = 0; i < gd.length; i++) {
                if(gd[i].getType() != GraphicsDevice.TYPE_RASTER_SCREEN) continue;
                GraphicsConfiguration defaultGraphicsConfiguration = gd[i].getDefaultConfiguration();
                if(!defaultGraphicsConfiguration.getBounds().contains(point)) continue;
                return defaultGraphicsConfiguration;
            }
           
            // we couldn't find a graphics configuration, use the component's
            return component.getGraphicsConfiguration();
View Full Code Here

  //private Polygon poly = new Polygon();
 
  public Renderer() {
      GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
      GraphicsDevice device = env.getDefaultScreenDevice();
        GraphicsConfiguration gc = device.getDefaultConfiguration();
    frame = new Frame("Fysix", gc);
    frame.addWindowListener(new WindowAdapter() {
      @Override
      public void windowClosing(WindowEvent e) {
        System.exit(0);
View Full Code Here

        if (preferredSize == null)
        {
            preferredSize = new Dimension();
            int is = getFont().getSize() * 4;
            BufferedImage image = null;
            GraphicsConfiguration graphicsConfiguration = getGraphicsConfiguration();
            if (graphicsConfiguration != null)
                image = graphicsConfiguration.createCompatibleImage(is, is);
            else
                image = new BufferedImage(is, is, BufferedImage.TYPE_4BYTE_ABGR);
            Graphics2D g = image.createGraphics();
            g.setFont(getFont());
            FontMetrics fm = g.getFontMetrics();
View Full Code Here

    {
        if (image == null)
        {
            GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
            GraphicsDevice gd = ge.getDefaultScreenDevice();
            GraphicsConfiguration gc = gd.getDefaultConfiguration();
            BufferedImage bi = gc.createCompatibleImage(getIconWidth(), getIconHeight(),
                    Transparency.TRANSLUCENT);
            paintIcon(null, bi.getGraphics(), 0, 0);
        }
        return image;
    }
View Full Code Here

            (RenderingHintsKeyExt.KEY_BUFFERED_IMAGE);
        if (o != null)
            return (BufferedImage)(((Reference)o).get());

        // Check if this is a BufferedImage G2d if so throw an error...
        GraphicsConfiguration gc = g2d.getDeviceConfiguration();
        GraphicsDevice gd = gc.getDevice();
        if (WARN_DESTINATION &&
            (gd.getType() == GraphicsDevice.TYPE_IMAGE_BUFFER) &&
            (g2d.getRenderingHint(RenderingHintsKeyExt.KEY_TRANSCODING) !=
                RenderingHintsKeyExt.VALUE_TRANSCODING_PRINTING))
            // throw new IllegalArgumentException
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.