public class EPSGraphics2D extends VectorGraphics2D
Graphics2D
implementation that saves all operations to a string
in the Encapsulated PostScript® (EPS) format.VectorGraphics2D.FontRendering
Modifier and Type | Field and Description |
---|---|
protected static double |
MM_IN_UNITS
Constant to convert values from millimeters to PostScript® units
(1/72th inch).
|
Constructor and Description |
---|
EPSGraphics2D(double x,
double y,
double width,
double height)
Constructor that initializes a new
EPSGraphics2D instance. |
Modifier and Type | Method and Description |
---|---|
byte[] |
getBytes()
Encodes the painted data into a sequence of bytes.
|
protected String |
getFooter()
Returns a string of the footer to end a document.
|
void |
rotate(double theta) |
void |
rotate(double theta,
double x,
double y) |
void |
scale(double sx,
double sy) |
void |
setClip(Shape clip) |
void |
setColor(Color c) |
void |
setFont(Font font) |
void |
setStroke(Stroke s) |
void |
setTransform(AffineTransform tx) |
void |
shear(double sx,
double sy) |
void |
translate(double tx,
double ty) |
protected void |
writeClosingDraw(Shape s)
Utility method for writing a tag closing fragment for drawing operations.
|
protected void |
writeClosingFill(Shape s)
Utility method for writing a tag closing fragment for filling operations.
|
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 |
writeShape(Shape s)
Utility method for writing an arbitrary shape to.
|
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, drawPolygon, drawPolyline, drawRect, drawRenderableImage, drawRenderedImage, drawRoundRect, drawString, drawString, drawString, drawString, fill, fillArc, fillOval, fillPolygon, fillRect, fillRoundRect, getBackground, getBounds, getClip, getClipBounds, getColor, getComposite, getDeviceConfiguration, getFont, getFontMetrics, getFontRenderContext, getFontRendering, getPaint, getRasteredImageSizeMaximum, getRenderingHint, getRenderingHints, getResolution, getStroke, getTransform, hit, isDistorted, isTransformed, setAffineTransform, setBackground, setClip, setComposite, setFontRendering, setPaint, setPaintMode, setRasteredImageSizeMaximum, setRenderingHint, setRenderingHints, setResolution, setXORMode, size, toString, transform, translate, write, writeln
draw3DRect, fill3DRect
create, drawBytes, drawChars, drawPolygon, fillPolygon, finalize, getClipBounds, getClipRect, getFontMetrics, hitClip
protected static final double MM_IN_UNITS
public EPSGraphics2D(double x, double y, double width, double height)
EPSGraphics2D
instance.
The document dimension must be specified as parameters.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.public void setStroke(Stroke s)
setStroke
in class VectorGraphics2D
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 setColor(Color c)
setColor
in class VectorGraphics2D
public void setFont(Font font)
setFont
in class VectorGraphics2D
public void setClip(Shape clip)
setClip
in class VectorGraphics2D
public void setTransform(AffineTransform tx)
setTransform
in class VectorGraphics2D
public void translate(double tx, double ty)
translate
in class VectorGraphics2D
public void scale(double sx, double sy)
scale
in class VectorGraphics2D
public void rotate(double theta)
rotate
in class VectorGraphics2D
public void rotate(double theta, double x, double y)
rotate
in class VectorGraphics2D
public void shear(double sx, double sy)
shear
in class VectorGraphics2D
protected void writeHeader()
VectorGraphics2D
writeHeader
in class VectorGraphics2D
protected void writeClosingDraw(Shape s)
writeClosingDraw
in class VectorGraphics2D
s
- Shape.protected void writeClosingFill(Shape s)
writeClosingFill
in class VectorGraphics2D
s
- Shape.protected void writeShape(Shape s)
writeShape
in class VectorGraphics2D
s
- Shape.protected String getFooter()
VectorGraphics2D
getFooter
in class VectorGraphics2D
public byte[] getBytes()
VectorGraphics2D
getBytes
in class VectorGraphics2D
Copyright © 2010-2013. All Rights Reserved.