java.lang.Object
java.awt.GraphicsConfiguration
org.jfree.svg.SVGGraphicsConfiguration
A graphics configuration for the
SVGGraphics2D class.Field Summary
FieldsModifier and TypeFieldDescriptionprivate GraphicsDeviceThe device this configuration belongs to.private GraphicsConfigurationThe configuration the fake device reports.private final intHeight of the SVG canvas, in pixels.private BufferedImageStand-in image the fake device draws into.private final intWidth of the SVG canvas, in pixels.Constructor Summary
ConstructorsMethod Summary
All MethodsModifier and TypeMethodDescriptioncreateCompatibleImage(int width, int height) Creates a compatible image.createCompatibleVolatileImage(int width, int height, ImageCapabilities caps, int transparency) Returns a volatile image.Returns the bounds for this configuration.Returns the color model for this configuration.getColorModel(int transparency) Returns the color model for the specified transparency type, ornull.Returns the default transform.Returns the graphics device that this configuration is associated with.Returns the normalizing transform.
Field Details
device
The device this configuration belongs to.width
private final int widthWidth of the SVG canvas, in pixels.height
private final int heightHeight of the SVG canvas, in pixels.img
Stand-in image the fake device draws into.gc
The configuration the fake device reports.
Constructor Details
SVGGraphicsConfiguration
public SVGGraphicsConfiguration(int width, int height) Creates a new instance.- Parameters:
width- the width of the bounds.height- the height of the bounds.
Method Details
getDevice
Returns the graphics device that this configuration is associated with.- Specified by:
getDevicein classGraphicsConfiguration- Returns:
- The graphics device (never
null).
getColorModel
Returns the color model for this configuration.- Specified by:
getColorModelin classGraphicsConfiguration- Returns:
- The color model.
getColorModel
Returns the color model for the specified transparency type, ornull.- Specified by:
getColorModelin classGraphicsConfiguration- Parameters:
transparency- the transparency type.- Returns:
- A color model (possibly
null).
getDefaultTransform
Returns the default transform.- Specified by:
getDefaultTransformin classGraphicsConfiguration- Returns:
- The default transform.
getNormalizingTransform
Returns the normalizing transform.- Specified by:
getNormalizingTransformin classGraphicsConfiguration- Returns:
- The normalizing transform.
getBounds
Returns the bounds for this configuration.- Specified by:
getBoundsin classGraphicsConfiguration- Returns:
- The width and height configured for this device.
createCompatibleImage
Creates a compatible image. This override is only here to provide support for Java 6 because from Java 7 onwards the super class has a non-abstract implementation for this method.- Overrides:
createCompatibleImagein classGraphicsConfiguration- Parameters:
width- the width of the deviceheight- the height of the device- Returns:
- A compatible image.
createCompatibleVolatileImage
public VolatileImage createCompatibleVolatileImage(int width, int height, ImageCapabilities caps, int transparency) throws AWTException Returns a volatile image. This method is a workaround for a ClassCastException that occurs on MacOSX when exporting a Swing UI that uses the Nimbus Look and Feel to SVG.- Overrides:
createCompatibleVolatileImagein classGraphicsConfiguration- Parameters:
width- the image width.height- the image height.caps- the image capabilities.transparency- the transparency of the device- Returns:
- The volatile image.
- Throws:
AWTException- if there is a problem creating the image.