public class SVGGraphics2D extends VectorGraphics2D
Graphics2D
implementation that saves all operations to a string
in the Scaled Vector Graphics (SVG) format.VectorGraphics2D.FontRendering
Constructor and Description |
---|
SVGGraphics2D(double x,
double y,
double width,
double height)
Constructor that initializes a new
SVGGraphics2D instance. |
Modifier and Type | Method and Description |
---|---|
void |
drawPolygon(int[] xPoints,
int[] yPoints,
int nPoints) |
void |
drawPolyline(int[] xPoints,
int[] yPoints,
int nPoints) |
void |
fillPolygon(int[] xPoints,
int[] yPoints,
int nPoints) |
protected String |
getFooter()
Returns a string of the footer to end a document.
|
protected void |
setAffineTransform(AffineTransform tx)
Sets the current transformation.
|
String |
toString() |
protected void |
writeClosingDraw(Shape s)
Write a command to draw the outline of a previously inserted shape.
|
protected void |
writeClosingFill(Shape s)
Write a command to fill the outline of a previously inserted shape.
|
protected void |
writeHeader()
Write the header to start a new document.
|
protected void |
writeImage(Image img,
int imgWidth,
int imgHeight,
double x,
double y,
double width,
double height)
Write the specified image to the document.
|
protected void |
writePath(Shape s)
Writes the beginning of the specified shape without any closing
commands.
|
protected void |
writeShape(Shape s)
Write the specified shape to the document.
|
protected void |
writeString(String str,
double x,
double y)
Write a text string to the document at a specified position.
|
addRenderingHints, clearRect, clip, clipRect, copyArea, create, dispose, draw, drawArc, drawGlyphVector, drawImage, drawImage, drawImage, drawImage, drawImage, drawImage, drawImage, drawImage, drawLine, drawOval, drawRect, drawRenderableImage, drawRenderedImage, drawRoundRect, drawString, drawString, drawString, drawString, fill, fillArc, fillOval, fillRect, fillRoundRect, getBackground, getBounds, getBytes, getClip, getClipBounds, getColor, getComposite, getDeviceConfiguration, getFont, getFontMetrics, getFontRenderContext, getFontRendering, getPaint, getRasteredImageSizeMaximum, getRenderingHint, getRenderingHints, getResolution, getStroke, getTransform, hit, isDistorted, isTransformed, rotate, rotate, scale, setBackground, setClip, setClip, setColor, setComposite, setFont, setFontRendering, setPaint, setPaintMode, setRasteredImageSizeMaximum, setRenderingHint, setRenderingHints, setResolution, setStroke, setTransform, setXORMode, shear, size, transform, translate, translate, write, writeln
draw3DRect, fill3DRect
create, drawBytes, drawChars, drawPolygon, fillPolygon, finalize, getClipBounds, getClipRect, getFontMetrics, hitClip
public SVGGraphics2D(double x, double y, double width, double height)
SVGGraphics2D
instance.
The document dimension must be specified as parameters.x
- Left offset of document.y
- Top offset of document.width
- Width of document.height
- Height of document.protected void writeString(String str, double x, double y)
VectorGraphics2D
writeString
in class VectorGraphics2D
str
- Text to be rendered.x
- Horizontal position in document units.y
- Vertical position in document units.protected void writeImage(Image img, int imgWidth, int imgHeight, double x, double y, double width, double height)
VectorGraphics2D
writeImage
in class VectorGraphics2D
img
- Image to be rendered.imgWidth
- Number of pixels in horizontal direction.imgHeight
- Number of pixels in vertical directionx
- Horizontal position in document units where the
upper left corner of the image should be placed.y
- Vertical position in document units where the
upper left corner of the image should be placed.width
- Width of the image in document units.height
- Height of the image in document units.public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints)
drawPolygon
in class VectorGraphics2D
public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints)
drawPolyline
in class VectorGraphics2D
public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints)
fillPolygon
in class VectorGraphics2D
protected void setAffineTransform(AffineTransform tx)
VectorGraphics2D
setAffineTransform
in class VectorGraphics2D
tx
- Current transformationprotected void writeHeader()
VectorGraphics2D
writeHeader
in class VectorGraphics2D
protected void writeClosingDraw(Shape s)
VectorGraphics2D
writeClosingDraw
in class VectorGraphics2D
s
- Shape that should be drawn.protected void writeClosingFill(Shape s)
VectorGraphics2D
writeClosingFill
in class VectorGraphics2D
s
- Shape that should be filled.protected void writeShape(Shape s)
VectorGraphics2D
writeShape
in class VectorGraphics2D
s
- Shape to be written.protected void writePath(Shape s)
s
- Shape to be written.protected String getFooter()
VectorGraphics2D
getFooter
in class VectorGraphics2D
public String toString()
toString
in class VectorGraphics2D
Copyright © 2010-2013. All Rights Reserved.