Package java.awt

Examples of java.awt.GraphicsConfiguration$DefaultBufferCapabilities


    public static ColorModel getDestinationColorModel(Graphics2D g2d) {
        BufferedImage bi = getDestination(g2d);
        if (bi != null)
            return bi.getColorModel();

        GraphicsConfiguration gc = g2d.getDeviceConfiguration();

        // We are going to a BufferedImage but no hint was provided
        // so we can't determine the destination Color Model.
        if (gc.getDevice().getType() == GraphicsDevice.TYPE_IMAGE_BUFFER) {
            if (g2d.getRenderingHint(RenderingHintsKeyExt.KEY_TRANSCODING) ==
                RenderingHintsKeyExt.VALUE_TRANSCODING_PRINTING)
                return sRGB_Unpre;

            // System.out.println("CM: " + gc.getColorModel());
            // System.out.println("CS: " + gc.getColorModel().getColorSpace());
            return null;
        }

        return gc.getColorModel();
    }
View Full Code Here


    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

  }

  private BufferedImage getCompatibleImage()
  {
    BufferedImage image = null;
    GraphicsConfiguration gc = getGraphicsConfiguration();
    if (gc != null)
    {
      image = gc.createCompatibleImage(getWidth(), getHeight());
    }
    else
    {
      image = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_RGB);
    }
View Full Code Here

        return textLength;
    }

    private static Rectangle getScreenClientBounds(final GraphicsConfiguration graphConfig) {
        GraphicsConfiguration gc = graphConfig;
        if (gc == null) {
            gc = GraphicsEnvironment.getLocalGraphicsEnvironment()
                    .getDefaultScreenDevice().getDefaultConfiguration();
        }
        final Rectangle screenRect = gc.getBounds();
        final Insets screenInsets = Toolkit.getDefaultToolkit().getScreenInsets(gc);
        return subtractInsets(screenRect, screenInsets);
    }
View Full Code Here

    public void setUp() {
        JFrame jf = new JFrame("Welcome");
        JPanel panel = new JPanel();
        panel.setLayout(new GridLayout(1, 1, 2, 2));

        GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration();
        Canvas3D canvas3D = new Canvas3D(config);
        canvas3D.setSize(360, 160);
        SimpleUniverse universe = new SimpleUniverse(canvas3D);
        BranchGroup group = new BranchGroup();
        addObjects(group);
View Full Code Here

        return textLength;
    }

    private static Rectangle getScreenClientBounds(final GraphicsConfiguration graphConfig) {
        GraphicsConfiguration gc = graphConfig;
        if (gc == null) {
            gc = GraphicsEnvironment.getLocalGraphicsEnvironment()
                    .getDefaultScreenDevice().getDefaultConfiguration();
        }
        final Rectangle screenRect = gc.getBounds();
        final Insets screenInsets = Toolkit.getDefaultToolkit().getScreenInsets(gc);
        return subtractInsets(screenRect, screenInsets);
    }
View Full Code Here

    @Override
    public FontRenderContext getFontRenderContext() {
        AffineTransform at;
        if (frc == null){
            GraphicsConfiguration gc = getDeviceConfiguration();
            if (gc != null){
                at = gc.getDefaultTransform();
                at.concatenate(gc.getNormalizingTransform());
            }
            else
                at = null;

            boolean isAa = (hints.get(RenderingHints.KEY_TEXT_ANTIALIASING) ==
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

    public static ColorModel getDestinationColorModel(Graphics2D g2d) {
        BufferedImage bi = getDestination(g2d);
        if (bi != null)
            return bi.getColorModel();

        GraphicsConfiguration gc = g2d.getDeviceConfiguration();

        // We are going to a BufferedImage but no hint was provided
        // so we can't determine the destination Color Model.
        if (gc.getDevice().getType() == GraphicsDevice.TYPE_IMAGE_BUFFER) {
            if (g2d.getRenderingHint(RenderingHintsKeyExt.KEY_TRANSCODING) ==
                RenderingHintsKeyExt.VALUE_TRANSCODING_PRINTING)
                return sRGB_Unpre;

            // System.out.println("CM: " + gc.getColorModel());
            // System.out.println("CS: " + gc.getColorModel().getColorSpace());
            return null;
        }

        return gc.getColorModel();
    }
View Full Code Here

    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

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.