java.lang.Object
java.awt.GraphicsConfiguration
org.jfree.svg.SVGGraphicsConfiguration
public class SVGGraphicsConfiguration extends GraphicsConfiguration
A graphics configuration for the
SVGGraphics2D
class.-
Constructor Summary
Constructors Constructor Description SVGGraphicsConfiguration(int width, int height)
Creates a new instance. -
Method Summary
Modifier and Type Method Description BufferedImage
createCompatibleImage(int width, int height)
Creates a compatible image.VolatileImage
createCompatibleVolatileImage(int width, int height, ImageCapabilities caps, int transparency)
Returns a volatile image.Rectangle
getBounds()
Returns the bounds for this configuration.ColorModel
getColorModel()
Returns the color model for this configuration.ColorModel
getColorModel(int transparency)
Returns the color model for the specified transparency type, ornull
.AffineTransform
getDefaultTransform()
Returns the default transform.GraphicsDevice
getDevice()
Returns the graphics device that this configuration is associated with.AffineTransform
getNormalizingTransform()
Returns the normalizing transform.Methods inherited from class java.awt.GraphicsConfiguration
createCompatibleImage, createCompatibleVolatileImage, createCompatibleVolatileImage, createCompatibleVolatileImage, getBufferCapabilities, getImageCapabilities, isTranslucencyCapable
-
Constructor Details
-
SVGGraphicsConfiguration
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:
getDevice
in classGraphicsConfiguration
- Returns:
- The graphics device (never
null
).
-
getColorModel
Returns the color model for this configuration.- Specified by:
getColorModel
in classGraphicsConfiguration
- Returns:
- The color model.
-
getColorModel
Returns the color model for the specified transparency type, ornull
.- Specified by:
getColorModel
in classGraphicsConfiguration
- Parameters:
transparency
- the transparency type.- Returns:
- A color model (possibly
null
).
-
getDefaultTransform
Returns the default transform.- Specified by:
getDefaultTransform
in classGraphicsConfiguration
- Returns:
- The default transform.
-
getNormalizingTransform
Returns the normalizing transform.- Specified by:
getNormalizingTransform
in classGraphicsConfiguration
- Returns:
- The normalizing transform.
-
getBounds
Returns the bounds for this configuration.- Specified by:
getBounds
in classGraphicsConfiguration
- Returns:
- The bounds.
-
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:
createCompatibleImage
in classGraphicsConfiguration
- Parameters:
width
- the width.height
- the height.- Returns:
- A compatible image.
-
createCompatibleVolatileImage
public VolatileImage createCompatibleVolatileImage(int width, int height, ImageCapabilities caps, int transparency) throws AWTExceptionReturns 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:
createCompatibleVolatileImage
in classGraphicsConfiguration
- Parameters:
width
- the image width.height
- the image height.caps
- the image capabilities.transparency
- the transparency.- Returns:
- The volatile image.
- Throws:
AWTException
- if there is a problem creating the image.
-