public class PdfGraphics2D extends Graphics2D
Modifier and Type | Class and Description |
---|---|
static class |
PdfGraphics2D.HyperLinkKey |
Modifier and Type | Field and Description |
---|---|
static int |
AFM_DIVISOR |
protected Color |
background |
protected BaseFont |
baseFont |
protected HashMap<String,BaseFont> |
baseFonts
Storage for BaseFont objects created.
|
protected PdfContentByte |
cb |
protected Area |
clip |
protected int |
currentFillGState |
protected int |
currentStrokeGState |
protected boolean |
disposeCalled |
protected PdfGState[] |
fillGState |
protected Font |
font |
protected FontMapper |
fontMapper |
protected float |
fontSize |
protected float |
height |
protected Stroke |
originalStroke |
protected Paint |
paint |
protected RenderingHints |
rhints |
protected boolean |
strikethrough |
protected Stroke |
stroke |
protected PdfGState[] |
strokeGState |
protected AffineTransform |
transform |
protected boolean |
underline |
protected float |
width |
Constructor and Description |
---|
PdfGraphics2D(PdfContentByte cb, float width, float height) |
PdfGraphics2D(PdfContentByte cb, float width, float height, boolean onlyShapes) |
PdfGraphics2D(PdfContentByte cb, float width, float height, FontMapper fontMapper) |
PdfGraphics2D(PdfContentByte cb, float width, float height, FontMapper fontMapper, boolean onlyShapes, boolean convertImagesToJPEG, float quality)
Constructor for PDFGraphics2D.
|
Modifier and Type | Method and Description |
---|---|
void |
addRenderingHints(Map,?> hints) |
static double |
asPoints(double d, int i)
Calculates position and/or stroke thickness depending on the font size
|
void |
clearRect(int x, int y, int width, int height) |
void |
clip(Shape s) |
void |
clipRect(int x, int y, int width, int height) |
void |
copyArea(int x, int y, int width, int height, int dx, int dy) |
Graphics |
create() |
void |
dispose() |
protected void |
doAttributes(AttributedCharacterIterator iter)
This routine goes through the attributes and sets the font before calling the actual string drawing routine
|
void |
draw(Shape s) |
void |
drawArc(int x, int y, int width, int height, int startAngle, int arcAngle) |
void |
drawGlyphVector(GlyphVector g, float x, float y) |
void |
drawImage(BufferedImage img, BufferedImageOp op, int x, int y) |
boolean |
drawImage(Image img, AffineTransform xform, ImageObserver obs) |
boolean |
drawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer) |
boolean |
drawImage(Image img, int x, int y, ImageObserver observer) |
boolean |
drawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer) |
boolean |
drawImage(Image img, int x, int y, int width, int height, ImageObserver observer) |
boolean |
drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver observer) |
boolean |
drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer) |
void |
drawLine(int x1, int y1, int x2, int y2) |
void |
drawOval(int x, int y, int width, int height) |
void |
drawPolygon(int[] xPoints, int[] yPoints, int nPoints) |
void |
drawPolyline(int[] x, int[] y, int nPoints) |
void |
drawRect(int x, int y, int width, int height) |
void |
drawRenderableImage(RenderableImage img, AffineTransform xform) |
void |
drawRenderedImage(RenderedImage img, AffineTransform xform) |
void |
drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) |
void |
drawString(AttributedCharacterIterator iter, float x, float y) |
void |
drawString(AttributedCharacterIterator iterator, int x, int y) |
void |
drawString(String s, float x, float y) |
void |
drawString(String s, int x, int y) |
void |
fill(Shape s) |
void |
fillArc(int x, int y, int width, int height, int startAngle, int arcAngle) |
void |
fillOval(int x, int y, int width, int height) |
void |
fillPolygon(int[] xPoints, int[] yPoints, int nPoints) |
void |
fillRect(int x, int y, int width, int height) |
void |
fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) |
Color |
getBackground() |
Shape |
getClip() |
Rectangle |
getClipBounds() |
Color |
getColor() |
Composite |
getComposite() |
PdfContentByte |
getContent() |
GraphicsConfiguration |
getDeviceConfiguration() |
Font |
getFont() |
FontMetrics |
getFontMetrics(Font f) |
FontRenderContext |
getFontRenderContext() |
Paint |
getPaint()
Method contributed by Alexej Suchov
|
Object |
getRenderingHint(RenderingHints.Key hintKey) |
RenderingHints |
getRenderingHints() |
Stroke |
getStroke() |
AffineTransform |
getTransform() |
boolean |
hit(Rectangle rect, Shape s, boolean onStroke) |
protected AffineTransform |
normalizeMatrix() |
static BaseColor |
prepareColor(Color color) |
void |
rotate(double theta) |
void |
rotate(double theta, double x, double y) |
void |
scale(double sx, double sy) |
void |
setBackground(Color color) |
void |
setClip(int x, int y, int width, int height) |
void |
setClip(Shape s) |
void |
setColor(Color color) |
void |
setComposite(Composite comp)
Method contributed by Alexej Suchov
|
void |
setFont(Font f)
Sets the current font.
|
void |
setPaint(Paint paint)
Method contributed by Alexej Suchov
|
void |
setPaintMode() |
void |
setRenderingHint(RenderingHints.Key hintKey, Object hintValue)
Sets a rendering hint
|
void |
setRenderingHints(Map,?> hints) |
void |
setStroke(Stroke s) |
void |
setTransform(AffineTransform t) |
void |
setXORMode(Color c1) |
void |
shear(double shx, double shy) |
void |
transform(AffineTransform tx) |
void |
translate(double tx, double ty) |
void |
translate(int x, int y) |
draw3DRect, fill3DRect
create, drawBytes, drawChars, drawPolygon, fillPolygon, finalize, getClipBounds, getClipRect, getFontMetrics, hitClip, toString
protected Font font
protected BaseFont baseFont
protected float fontSize
protected AffineTransform transform
protected Paint paint
protected Color background
protected float width
protected float height
protected Area clip
protected RenderingHints rhints
protected Stroke stroke
protected Stroke originalStroke
protected PdfContentByte cb
protected boolean disposeCalled
protected FontMapper fontMapper
protected boolean underline
protected boolean strikethrough
protected PdfGState[] fillGState
protected PdfGState[] strokeGState
protected int currentFillGState
protected int currentStrokeGState
public static final int AFM_DIVISOR
public PdfGraphics2D(PdfContentByte cb, float width, float height)
public PdfGraphics2D(PdfContentByte cb, float width, float height, FontMapper fontMapper)
public PdfGraphics2D(PdfContentByte cb, float width, float height, boolean onlyShapes)
public PdfGraphics2D(PdfContentByte cb, float width, float height, FontMapper fontMapper, boolean onlyShapes, boolean convertImagesToJPEG, float quality)
public void draw(Shape s)
draw
in class Graphics2D
Graphics2D.draw(Shape)
public boolean drawImage(Image img, AffineTransform xform, ImageObserver obs)
drawImage
in class Graphics2D
Graphics2D.drawImage(Image, AffineTransform, ImageObserver)
public void drawImage(BufferedImage img, BufferedImageOp op, int x, int y)
drawImage
in class Graphics2D
Graphics2D.drawImage(BufferedImage, BufferedImageOp, int, int)
public void drawRenderedImage(RenderedImage img, AffineTransform xform)
drawRenderedImage
in class Graphics2D
Graphics2D.drawRenderedImage(RenderedImage, AffineTransform)
public void drawRenderableImage(RenderableImage img, AffineTransform xform)
drawRenderableImage
in class Graphics2D
Graphics2D.drawRenderableImage(RenderableImage, AffineTransform)
public void drawString(String s, int x, int y)
drawString
in class Graphics2D
Graphics.drawString(String, int, int)
public static double asPoints(double d, int i)
d
- value to be converted
i
- font size
protected void doAttributes(AttributedCharacterIterator iter)
iter
-
public void drawString(String s, float x, float y)
drawString
in class Graphics2D
Graphics2D.drawString(String, float, float)
public void drawString(AttributedCharacterIterator iterator, int x, int y)
drawString
in class Graphics2D
Graphics.drawString(AttributedCharacterIterator, int, int)
public void drawString(AttributedCharacterIterator iter, float x, float y)
drawString
in class Graphics2D
Graphics2D.drawString(AttributedCharacterIterator, float, float)
public void drawGlyphVector(GlyphVector g, float x, float y)
drawGlyphVector
in class Graphics2D
Graphics2D.drawGlyphVector(GlyphVector, float, float)
public void fill(Shape s)
fill
in class Graphics2D
Graphics2D.fill(Shape)
public boolean hit(Rectangle rect, Shape s, boolean onStroke)
hit
in class Graphics2D
Graphics2D.hit(Rectangle, Shape, boolean)
public GraphicsConfiguration getDeviceConfiguration()
getDeviceConfiguration
in class Graphics2D
Graphics2D.getDeviceConfiguration()
public void setComposite(Composite comp)
setComposite
in class Graphics2D
Graphics2D.setComposite(Composite)
public void setPaint(Paint paint)
setPaint
in class Graphics2D
Graphics2D.setPaint(Paint)
public void setStroke(Stroke s)
setStroke
in class Graphics2D
Graphics2D.setStroke(Stroke)
public void setRenderingHint(RenderingHints.Key hintKey, Object hintValue)
setRenderingHint
in class Graphics2D
hintKey
-
hintValue
-
public Object getRenderingHint(RenderingHints.Key hintKey)
getRenderingHint
in class Graphics2D
hintKey
- a key
public void setRenderingHints(Map,?> hints)
setRenderingHints
in class Graphics2D
Graphics2D.setRenderingHints(Map)
public void addRenderingHints(Map,?> hints)
addRenderingHints
in class Graphics2D
Graphics2D.addRenderingHints(Map)
public RenderingHints getRenderingHints()
getRenderingHints
in class Graphics2D
Graphics2D.getRenderingHints()
public void translate(int x, int y)
translate
in class Graphics2D
Graphics.translate(int, int)
public void translate(double tx, double ty)
translate
in class Graphics2D
Graphics2D.translate(double, double)
public void rotate(double theta)
rotate
in class Graphics2D
Graphics2D.rotate(double)
public void rotate(double theta, double x, double y)
rotate
in class Graphics2D
Graphics2D.rotate(double, double, double)
public void scale(double sx, double sy)
scale
in class Graphics2D
Graphics2D.scale(double, double)
public void shear(double shx, double shy)
shear
in class Graphics2D
Graphics2D.shear(double, double)
public void transform(AffineTransform tx)
transform
in class Graphics2D
Graphics2D.transform(AffineTransform)
public void setTransform(AffineTransform t)
setTransform
in class Graphics2D
Graphics2D.setTransform(AffineTransform)
public AffineTransform getTransform()
getTransform
in class Graphics2D
Graphics2D.getTransform()
public Paint getPaint()
getPaint
in class Graphics2D
Graphics2D.getPaint()
public Composite getComposite()
getComposite
in class Graphics2D
Graphics2D.getComposite()
public void setBackground(Color color)
setBackground
in class Graphics2D
Graphics2D.setBackground(Color)
public Color getBackground()
getBackground
in class Graphics2D
Graphics2D.getBackground()
public Stroke getStroke()
getStroke
in class Graphics2D
Graphics2D.getStroke()
public FontRenderContext getFontRenderContext()
getFontRenderContext
in class Graphics2D
Graphics2D.getFontRenderContext()
public Graphics create()
create
in class Graphics
Graphics.create()
public PdfContentByte getContent()
public Color getColor()
getColor
in class Graphics
Graphics.getColor()
public void setColor(Color color)
setColor
in class Graphics
Graphics.setColor(Color)
public void setPaintMode()
setPaintMode
in class Graphics
Graphics.setPaintMode()
public void setXORMode(Color c1)
setXORMode
in class Graphics
Graphics.setXORMode(Color)
public Font getFont()
getFont
in class Graphics
Graphics.getFont()
public FontMetrics getFontMetrics(Font f)
getFontMetrics
in class Graphics
Graphics.getFontMetrics(Font)
public Rectangle getClipBounds()
getClipBounds
in class Graphics
Graphics.getClipBounds()
public void clipRect(int x, int y, int width, int height)
clipRect
in class Graphics
Graphics.clipRect(int, int, int, int)
public void setClip(int x, int y, int width, int height)
setClip
in class Graphics
Graphics.setClip(int, int, int, int)
public void clip(Shape s)
clip
in class Graphics2D
Graphics2D.clip(Shape)
public Shape getClip()
getClip
in class Graphics
Graphics.getClip()
public void setClip(Shape s)
setClip
in class Graphics
Graphics.setClip(Shape)
public void copyArea(int x, int y, int width, int height, int dx, int dy)
copyArea
in class Graphics
Graphics.copyArea(int, int, int, int, int, int)
public void drawLine(int x1, int y1, int x2, int y2)
drawLine
in class Graphics
Graphics.drawLine(int, int, int, int)
public void drawRect(int x, int y, int width, int height)
drawRect
in class Graphics
Graphics.fillRect(int, int, int, int)
public void fillRect(int x, int y, int width, int height)
fillRect
in class Graphics
Graphics.fillRect(int, int, int, int)
public void clearRect(int x, int y, int width, int height)
clearRect
in class Graphics
Graphics.clearRect(int, int, int, int)
public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
drawRoundRect
in class Graphics
Graphics.drawRoundRect(int, int, int, int, int, int)
public void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
fillRoundRect
in class Graphics
Graphics.fillRoundRect(int, int, int, int, int, int)
public void drawOval(int x, int y, int width, int height)
drawOval
in class Graphics
Graphics.drawOval(int, int, int, int)
public void fillOval(int x, int y, int width, int height)
fillOval
in class Graphics
Graphics.fillOval(int, int, int, int)
public void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle)
drawArc
in class Graphics
Graphics.drawArc(int, int, int, int, int, int)
public void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle)
fillArc
in class Graphics
Graphics.fillArc(int, int, int, int, int, int)
public void drawPolyline(int[] x, int[] y, int nPoints)
drawPolyline
in class Graphics
Graphics.drawPolyline(int[], int[], int)
public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints)
drawPolygon
in class Graphics
Graphics.drawPolygon(int[], int[], int)
public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints)
fillPolygon
in class Graphics
Graphics.fillPolygon(int[], int[], int)
public boolean drawImage(Image img, int x, int y, ImageObserver observer)
drawImage
in class Graphics
Graphics.drawImage(Image, int, int, ImageObserver)
public boolean drawImage(Image img, int x, int y, int width, int height, ImageObserver observer)
drawImage
in class Graphics
Graphics.drawImage(Image, int, int, int, int, ImageObserver)
public boolean drawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer)
drawImage
in class Graphics
Graphics.drawImage(Image, int, int, Color, ImageObserver)
public boolean drawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer)
drawImage
in class Graphics
Graphics.drawImage(Image, int, int, int, int, Color, ImageObserver)
public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer)
drawImage
in class Graphics
Graphics.drawImage(Image, int, int, int, int, int, int, int, int, ImageObserver)
public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver observer)
drawImage
in class Graphics
Graphics.drawImage(Image, int, int, int, int, int, int, int, int, Color, ImageObserver)
public void dispose()
dispose
in class Graphics
Graphics.dispose()
protected AffineTransform normalizeMatrix()
Copyright © 1998–2017. All rights reserved.