public class VectorWriter extends IOCapabilitiesStorage implements DrawableWriter
Class that stores Drawable
instances as vector graphics.
This implementation requires the VectorGraphics2D library to provide
support for the following file formats:
If the VectorGraphics2D library isn't available the file formats
aren't registered in the plug-in system. This class shouldn't be used directly
but using the DrawableWriterFactory
.
Modifier | Constructor and Description |
---|---|
protected |
VectorWriter(java.lang.String mimeType)
Creates a new
VectorWriter object with the specified
MIME-Type. |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getMimeType()
Returns the output format of this writer.
|
void |
write(Drawable d,
java.io.OutputStream destination,
double width,
double height)
Stores the specified
Drawable instance. |
void |
write(Drawable d,
java.io.OutputStream destination,
double x,
double y,
double width,
double height)
Stores the specified
Drawable instance. |
addCapabilities, getCapabilities
protected VectorWriter(java.lang.String mimeType)
VectorWriter
object with the specified
MIME-Type.mimeType
- Output MIME-Type.public void write(Drawable d, java.io.OutputStream destination, double width, double height) throws java.io.IOException
Drawable
instance.write
in interface DrawableWriter
d
- Drawable
to be written.destination
- Stream to write towidth
- Width of the image.height
- Height of the image.java.io.IOException
- if writing to stream failspublic void write(Drawable d, java.io.OutputStream destination, double x, double y, double width, double height) throws java.io.IOException
Drawable
instance.write
in interface DrawableWriter
d
- Drawable
to be written.destination
- Stream to write tox
- Horizontal position.y
- Vertical position.width
- Width of the image.height
- Height of the image.java.io.IOException
- if writing to stream failspublic java.lang.String getMimeType()
getMimeType
in interface DrawableWriter