Class PDFGraphicsConfiguration


  • class PDFGraphicsConfiguration
    extends GraphicsConfiguration
    Our implementation of the class that returns information about roughly what we can handle and want to see (alpha for example).
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.awt.image.BufferedImage BI_WITH_ALPHA  
      private static java.awt.image.BufferedImage BI_WITHOUT_ALPHA  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.awt.image.BufferedImage createCompatibleImage​(int width, int height)
      Construct a buffered image with an alpha channel.
      java.awt.image.BufferedImage createCompatibleImage​(int width, int height, int transparency)
      Construct a buffered image with an alpha channel, unless transparencty is OPAQUE (no alpha at all).
      java.awt.Rectangle getBounds()
      TODO: This should return the page bounds in Pts, I couldn't figure out how to get this for the current page from the PDFDocument (this still works for now, but it should be fixed...).
      java.awt.image.ColorModel getColorModel()
      Return a good default color model for this 'device'.
      java.awt.image.ColorModel getColorModel​(int transparency)
      Return a good color model given transparency
      java.awt.geom.AffineTransform getDefaultTransform()
      The default transform (1:1).
      java.awt.GraphicsDevice getDevice()
      Return our dummy instance of GraphicsDevice
      java.awt.geom.AffineTransform getNormalizingTransform()
      The normalizing transform (1:1) (since we currently render images at 72dpi, which we might want to change in the future).
      • Methods inherited from class java.awt.GraphicsConfiguration

        createCompatibleVolatileImage, createCompatibleVolatileImage, getBufferCapabilities, getImageCapabilities, isTranslucencyCapable
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • BI_WITH_ALPHA

        private static final java.awt.image.BufferedImage BI_WITH_ALPHA
      • BI_WITHOUT_ALPHA

        private static final java.awt.image.BufferedImage BI_WITHOUT_ALPHA
    • Constructor Detail

      • PDFGraphicsConfiguration

        PDFGraphicsConfiguration()
    • Method Detail

      • createCompatibleImage

        public java.awt.image.BufferedImage createCompatibleImage​(int width,
                                                                  int height,
                                                                  int transparency)
        Construct a buffered image with an alpha channel, unless transparencty is OPAQUE (no alpha at all).
        Overrides:
        createCompatibleImage in class java.awt.GraphicsConfiguration
        Parameters:
        width - the width of the image
        height - the height of the image
        transparency - the alpha value of the image
        Returns:
        the new buffered image
      • createCompatibleImage

        public java.awt.image.BufferedImage createCompatibleImage​(int width,
                                                                  int height)
        Construct a buffered image with an alpha channel.
        Overrides:
        createCompatibleImage in class java.awt.GraphicsConfiguration
        Parameters:
        width - the width of the image
        height - the height of the image
        Returns:
        the new buffered image
      • getBounds

        public java.awt.Rectangle getBounds()
        TODO: This should return the page bounds in Pts, I couldn't figure out how to get this for the current page from the PDFDocument (this still works for now, but it should be fixed...).
        Specified by:
        getBounds in class java.awt.GraphicsConfiguration
        Returns:
        the bounds of the PDF document page
      • getColorModel

        public java.awt.image.ColorModel getColorModel()
        Return a good default color model for this 'device'.
        Specified by:
        getColorModel in class java.awt.GraphicsConfiguration
        Returns:
        the colour model for the configuration
      • getColorModel

        public java.awt.image.ColorModel getColorModel​(int transparency)
        Return a good color model given transparency
        Specified by:
        getColorModel in class java.awt.GraphicsConfiguration
        Parameters:
        transparency - the alpha value for the colour model
        Returns:
        the colour model for the configuration
      • getDefaultTransform

        public java.awt.geom.AffineTransform getDefaultTransform()
        The default transform (1:1).
        Specified by:
        getDefaultTransform in class java.awt.GraphicsConfiguration
        Returns:
        the default transform for the configuration
      • getNormalizingTransform

        public java.awt.geom.AffineTransform getNormalizingTransform()
        The normalizing transform (1:1) (since we currently render images at 72dpi, which we might want to change in the future).
        Specified by:
        getNormalizingTransform in class java.awt.GraphicsConfiguration
        Returns:
        the normalizing transform for the configuration
      • getDevice

        public java.awt.GraphicsDevice getDevice()
        Return our dummy instance of GraphicsDevice
        Specified by:
        getDevice in class java.awt.GraphicsConfiguration
        Returns:
        the PDF graphics device