Package org.apache.xmlgraphics.java2d
Class GraphicsConfigurationWithTransparency
- java.lang.Object
-
- java.awt.GraphicsConfiguration
-
- org.apache.xmlgraphics.java2d.AbstractGraphicsConfiguration
-
- org.apache.xmlgraphics.java2d.GraphicsConfigurationWithTransparency
-
public class GraphicsConfigurationWithTransparency extends AbstractGraphicsConfiguration
An implementation ofGraphicsConfigurationthat supports transparencies (alpha channels).
-
-
Constructor Summary
Constructors Constructor Description GraphicsConfigurationWithTransparency()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.image.BufferedImagecreateCompatibleImage(int width, int height)Construct a buffered image with an alpha channel.java.awt.image.BufferedImagecreateCompatibleImage(int width, int height, int transparency)Construct a buffered image with an alpha channel, unless transparency is OPAQUE (no alpha at all).java.awt.RectanglegetBounds()TODO: This should return the page bounds in Pts, I couldn't figure out how to get this for the current page (this still works for now, but it should be fixed...).java.awt.image.ColorModelgetColorModel()Return a good default color model for this 'device'.java.awt.image.ColorModelgetColorModel(int transparency)Return a good color model giventransparencyjava.awt.geom.AffineTransformgetDefaultTransform()The default transform (1:1).java.awt.GraphicsDevicegetDevice()Return our dummy instance of GraphicsDevicejava.awt.geom.AffineTransformgetNormalizingTransform()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 org.apache.xmlgraphics.java2d.AbstractGraphicsConfiguration
createCompatibleVolatileImage, createCompatibleVolatileImage
-
-
-
-
Method Detail
-
createCompatibleImage
public java.awt.image.BufferedImage createCompatibleImage(int width, int height, int transparency)Construct a buffered image with an alpha channel, unless transparency is OPAQUE (no alpha at all).- Overrides:
createCompatibleImagein classjava.awt.GraphicsConfiguration- Parameters:
width- the width of the imageheight- the height of the imagetransparency- 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:
createCompatibleImagein classjava.awt.GraphicsConfiguration- Parameters:
width- the width of the imageheight- 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 (this still works for now, but it should be fixed...).- Specified by:
getBoundsin classjava.awt.GraphicsConfiguration- Returns:
- the bounds of the document page
-
getColorModel
public java.awt.image.ColorModel getColorModel()
Return a good default color model for this 'device'.- Specified by:
getColorModelin classjava.awt.GraphicsConfiguration- Returns:
- the colour model for the configuration
-
getColorModel
public java.awt.image.ColorModel getColorModel(int transparency)
Return a good color model giventransparency- Specified by:
getColorModelin classjava.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:
getDefaultTransformin classjava.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:
getNormalizingTransformin classjava.awt.GraphicsConfiguration- Returns:
- the normalizing transform for the configuration
-
getDevice
public java.awt.GraphicsDevice getDevice()
Return our dummy instance of GraphicsDevice- Specified by:
getDevicein classjava.awt.GraphicsConfiguration- Returns:
- the graphics device
-
-