|
Style Intelligence v12.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Graphics
java.awt.Graphics2D
inetsoft.report.PDFPrinter
public class PDFPrinter
PDFPrinter can be used to generate a PDF file from a report. This PDF printer simulates an actual printer, and generates a very accurately printer simulates an actual printer, and generates a very accurately formatted PDF document.
This class provides a simple implementation. For full featured PDF generation, use inetsoft.report.pdf.PDF3Generator.
| Nested Class Summary | |
|---|---|
protected class |
PDFPrinter.CountWriter
|
protected class |
PDFPrinter.ImageInfoCache
|
protected class |
PDFPrinter.PDFWriter
|
protected class |
PDFPrinter.RadioButtonGroup
Radio button group stores info of a radio group. |
static class |
PDFPrinter.StructurePart
|
| Field Summary | |
|---|---|
protected FontMetrics |
afm
|
protected Map |
annots
|
protected List |
annotsIds
|
protected static String[] |
charname
|
protected static int[][] |
charRanges
|
protected FontMetrics |
fm
|
protected List |
fnList
|
protected Map |
fnObj
|
protected Map |
fontFn
|
protected Map |
fontmap
Font mapping table. |
protected Map |
fontObj
|
protected int |
insetx
|
protected PDFPrinter.CountWriter |
others
|
protected String |
outlines
|
protected int |
pageheight
Page height in points. |
protected List |
pageIds
|
protected int |
pagewidth
Page width in points. |
protected PDFPrinter.PDFWriter |
pg
|
protected String |
psFontName
|
static int |
RESOLUTION
Page resolution. |
| Fields inherited from interface inetsoft.report.internal.CustomGraphics |
|---|
G_DASH_LINE, JPEG_EXPORT |
| Constructor Summary | |
|---|---|
PDFPrinter()
Create an empty PDFPrinter. |
|
PDFPrinter(File outf)
Construct a PDFPrinter graphics content. |
|
PDFPrinter(OutputStream o)
Constructs a new PDFPrinter Object. |
|
| Method Summary | |
|---|---|
void |
addAnnotation(int id,
int page)
Add an annotation to the PDF. |
boolean |
addField(inetsoft.report.internal.FieldPainterPaintable pt)
Add a field to the current pdf document. |
Integer |
addLink(Hyperlink.Ref link,
Rectangle linkBounds,
double pgH,
Map actions,
int page,
boolean flush)
Adds an annotation for a link. |
void |
addObject(int id,
String obj)
Add an object to the PDF. |
void |
addObject(int id,
String obj,
boolean flush)
Add an object to the PDF. |
void |
addRenderingHints(Map hints)
Not supported. |
void |
checkTextObj(boolean txt)
Make sure currently in the text segment (BT-ET). |
void |
clearRect(double x,
double y,
double width,
double height)
|
void |
clearRect(int x,
int y,
int width,
int height)
Clears the specified rectangle by filling it with the current background color of the current drawing surface. |
void |
clip(Shape s)
|
void |
clipRect(double x,
double y,
double width,
double height)
|
void |
clipRect(int x,
int y,
int width,
int height)
Clips to a rectangle. |
Object |
clone()
|
void |
close()
Close the pdf output stream. |
protected boolean |
containsArabicCombinCharacter()
|
void |
copyArea(int x,
int y,
int width,
int height,
int dx,
int dy)
Copies an area of the screen. |
Graphics |
create()
Creates a new PDFPrinter Object that is a copy of the original PDFPrinter Object. |
Graphics |
create(int x,
int y,
int width,
int height)
Creates a new Graphics Object with the specified parameters, based on the original Graphics Object. |
protected void |
debug(PDFPrinter.PDFWriter os,
String m)
|
void |
dispose()
Disposes of this graphics context. |
boolean |
doImage(Image img,
int x,
int y,
int width,
int height,
ImageObserver observer,
Color bgcolor)
Draw image. |
boolean |
doImage(Image img,
int x,
int y,
int width,
int height,
int sx1,
int sy1,
int sx2,
int sy2,
ImageObserver observer,
Color bgcolor)
Draw image. |
void |
draw(Shape s)
Draw a shape. |
void |
draw3DRect(double x,
double y,
double width,
double height,
boolean raised)
|
void |
draw3DRect(int x,
int y,
int width,
int height,
boolean raised)
Draws a highlighted 3-D rectangle. |
void |
drawArc(double x,
double y,
double width,
double height,
double startAngle,
double arcAngle,
int arcType)
|
void |
drawArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle)
Draws an arc bounded by the specified rectangle from startAngle to endAngle. |
void |
drawBytes(byte[] data,
int offset,
int length,
int x,
int y)
Draws the specified bytes using the current font and color. |
void |
drawChars(char[] data,
int offset,
int length,
int x,
int y)
Draws the specified characters using the current font and color. |
void |
drawGlyphVector(GlyphVector g,
float x,
float y)
Draw string. |
void |
drawImage(BufferedImage img,
BufferedImageOp op,
int x,
int y)
Draw image. |
boolean |
drawImage(Image img,
AffineTransform xform,
ImageObserver obs)
Draw image. |
boolean |
drawImage(Image img,
int x,
int y,
Color bgcolor,
ImageObserver observer)
Draws the specified image at the specified coordinate (x, y). |
boolean |
drawImage(Image img,
int x,
int y,
ImageObserver observer)
Draws the specified image at the specified coordinate (x, y). |
boolean |
drawImage(Image img,
int x,
int y,
int width,
int height,
Color bgcolor,
ImageObserver observer)
Draws the specified image inside the specified rectangle. |
boolean |
drawImage(Image img,
int x,
int y,
int width,
int height,
ImageObserver observer)
Draws the specified image inside the specified rectangle. |
boolean |
drawImage(Image img,
int dx1,
int dy1,
int dx2,
int dy2,
int sx1,
int sy1,
int sx2,
int sy2,
Color bgcolor,
ImageObserver observer)
Draws as much of the specified area of the specified image as is currently available, scaling it on the fly to fit inside the specified area of the destination drawable surface. |
boolean |
drawImage(Image img,
int dx1,
int dy1,
int dx2,
int dy2,
int sx1,
int sy1,
int sx2,
int sy2,
ImageObserver observer)
Draws as much of the specified area of the specified image as is currently available, scaling it on the fly to fit inside the specified area of the destination drawable surface. |
void |
drawLine(double x1,
double y1,
double x2,
double y2)
|
void |
drawLine(int x1,
int y1,
int x2,
int y2)
Draws a line between the coordinates (x1,y1) and (x2,y2). |
void |
drawOval(double x,
double y,
double width,
double height)
|
void |
drawOval(int x,
int y,
int width,
int height)
Draws an oval inside the specified rectangle using the current color. |
void |
drawPolygon(int[] xPoints,
int[] yPoints,
int nPoints)
Draws a polygon defined by an array of x points and y points. |
void |
drawPolygon(Polygon p)
Draws a polygon defined by the specified point. |
void |
drawPolyline(float[] xPoints,
float[] yPoints,
int nPoints)
Draws a sequence of connected lines defined by arrays of x and y coordinates. |
void |
drawPolyline(int[] xPoints,
int[] yPoints,
int nPoints)
Draws a sequence of connected lines defined by arrays of x and y coordinates. |
void |
drawRect(double x,
double y,
double width,
double height)
|
void |
drawRect(int x,
int y,
int width,
int height)
Draws the outline of the specified rectangle using the current color. |
void |
drawRenderableImage(RenderableImage img,
AffineTransform xform)
Draw image. |
void |
drawRenderedImage(RenderedImage img,
AffineTransform xform)
Draw image. |
void |
drawRoundRect(double x,
double y,
double width,
double height,
double arcWidth,
double arcHeight)
|
void |
drawRoundRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight)
Draws an outlined rounded corner rectangle using the current color. |
void |
drawString(AttributedCharacterIterator iterator,
float x,
float y)
Draw string. |
void |
drawString(AttributedCharacterIterator iterator,
int x,
int y)
Draw string. |
char[] |
drawString(String str,
double sx,
double sy)
Draw string with double coordinate values. |
void |
drawString(String str,
float sx,
float sy)
|
void |
drawString(String str,
int sx,
int sy)
Draws the specified String using the current font and color. |
void |
emit(String cmd)
Emit a PDF command to the output stream. |
protected void |
emitClip(double x,
double y,
double width,
double height)
|
protected void |
emitcm(AffineTransform tx)
Output a matrix command. |
protected String |
emitFont(Font font)
Send the set font command to output. |
protected int |
emitImage(inetsoft.report.internal.MetaImage image,
int x,
int y,
Dimension isize,
Color bgcolor)
Create an image object from a jpeg. |
protected int |
emitImage(inetsoft.util.PixelConsumer pc,
int x,
int y,
Dimension isize,
ImageObserver observer,
Color bgcolor)
Create an image object. |
protected void |
emitTj(String txt)
Output the Tj command. |
void |
endArtifact()
Marks the end of a non-content artifact. |
void |
endFigure()
Marks the end of a figure. |
void |
endHeading()
Marks the end of a heading. |
void |
endParagraph()
Marks the end of a paragraph of text. |
void |
endTable()
Marks the end of a table. |
void |
endTableCell()
Marks the end of a table data cell. |
void |
endTableHeader()
Marks the end of a table header cell. |
void |
fill(Shape s)
Fill shape. |
void |
fill3DRect(double x,
double y,
double width,
double height,
boolean raised)
|
void |
fill3DRect(int x,
int y,
int width,
int height,
boolean raised)
Paints a highlighted 3-D rectangle using the current color. |
void |
fillArc(double x,
double y,
double width,
double height,
double startAngle,
double arcAngle)
|
void |
fillArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle)
Fills an arc using the current color. |
void |
fillOval(double x,
double y,
double width,
double height)
|
void |
fillOval(int x,
int y,
int width,
int height)
Fills an oval inside the specified rectangle using the current color. |
void |
fillPolygon(int[] xPoints,
int[] yPoints,
int nPoints)
Fills a polygon with the current color. |
void |
fillPolygon(Polygon p)
Fills the specified polygon with the current color. |
void |
fillRect(double x,
double y,
double width,
double height)
|
void |
fillRect(int x,
int y,
int width,
int height)
Fills the specified rectangle with the current color. |
void |
fillRoundRect(double x,
double y,
double width,
double height,
double arcWidth,
double arcHeight)
|
void |
fillRoundRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight)
Draws a rounded rectangle filled in with the current color. |
Color |
getBackground()
Get the background color. |
String |
getBaseFontName(String fontname,
Font font)
Get Base font name, if font name is wide char string, just use the font name with US locale. |
Shape |
getClip()
Gets the current clipping area. |
Rectangle |
getClipBounds()
Returns the bounding rectangle of the current clipping area. |
Color |
getColor()
Gets the current color. |
Composite |
getComposite()
|
GraphicsConfiguration |
getDeviceConfiguration()
Not supported. |
DocumentInfo |
getDocumentInfo()
Get the document info. |
PDFEncryptInfo |
getEncryptInfo()
Get the PDF document encryption infomation. |
Font |
getFont()
Gets the current font. |
FontMetrics |
getFontMetrics()
Gets the current font metrics. |
FontMetrics |
getFontMetrics(Font f)
Gets the current font metrics for the specified font. |
String |
getFontName(Font font)
Get the pdf font name corresponding to the Java font name. |
FontRenderContext |
getFontRenderContext()
|
protected String |
getNaturalLanguage()
Writes the natural language attribute for the catalog dictionary. |
protected int |
getNextFontIndex()
Get the next font index. |
int |
getNextObjectID()
Get the next objectID. |
int |
getNextPatternID()
Get the next objectID. |
int |
getOutputSize()
Get the current output size. |
Size |
getPageSize()
Get the current page size. |
Paint |
getPaint()
|
String |
getPDFVersion()
Return the PDF version of the documents generated by this class. |
PrinterJob |
getPrinterJob()
Returns the PrinterJob that is controlling the
current rendering request. |
PrintJob |
getPrintJob()
Get the printjob object associated with this object, which contains the page size and resolution information. |
protected String |
getPSFontNameWithInsetx(String pfname,
int ix)
Return the PS Font Name with insetx as suffix. |
Object |
getRenderingHint(RenderingHints.Key hintKey)
Not supported. |
RenderingHints |
getRenderingHints()
Not supported. |
Locale |
getReportLocale()
Gets the locale of the report being rendered. |
Stroke |
getStroke()
|
protected String |
getTextString(int onum,
int gnum,
Object obj)
Get the text string representation. |
protected String |
getTextString(Object obj)
Get the wide string. |
protected String |
getTextString(Object obj,
boolean wide)
Get the wide string. |
AffineTransform |
getTransform()
|
int |
grestore(int level)
Restore graphics context up-to the specified level. |
void |
gsave(int level)
PDF save. |
boolean |
hit(Rectangle rect,
Shape s,
boolean onStroke)
Not supported. |
boolean |
isAccessible()
Gets the flag that determines if an accessible PDF file is generated. |
boolean |
isAsciiOnly()
Check if the output is ascii only. |
protected boolean |
isBase14Font(String fontin)
Check if a font is base14 font. |
boolean |
isCompressImage()
Check if compression is on. |
boolean |
isCompressText()
Check if compression is on. |
protected boolean |
isCurrentCJKFont()
Check if current using font is CJK font. |
boolean |
isEncrypted()
Check if the PDF document should be encrypted. |
protected boolean |
isInsetxNeeded(String pfname,
int ix)
|
boolean |
isMapSymbols()
Check if symbol mapping is enabled. |
boolean |
isOpenBookmark()
Get the value of the "openBookmark" flag. |
boolean |
isOpenThumbnail()
Get the value of the "openThumbnail" flag. |
boolean |
isPrintScaling()
Gets the "PrintScaling" flag. |
boolean |
isSupported(int feature)
|
protected boolean |
isWideCharString(String str,
boolean font)
Check if a string contains unicode. |
void |
putFontName(String javaName,
String psFontName)
Add the mapping for the pdf font name corresponding to the Java font name. |
void |
rotate(double theta)
|
void |
rotate(double theta,
double x,
double y)
|
void |
scale(double sx,
double sy)
|
void |
setAccessible(boolean accessible)
Sets the flag that determines if an accessible PDF file is generated. |
void |
setAsciiOnly(boolean ascii)
Set whether the output should only contain 7 bits ascii code only. |
void |
setBackground(Color c)
Set the background color. |
void |
setClip(double x,
double y,
double width,
double height)
|
void |
setClip(int x,
int y,
int width,
int height)
Sets the current clip to the rectangle specified by the given coordinates. |
void |
setClip(Shape s)
|
void |
setColor(Color c)
Sets the current color to the specified color. |
void |
setComposite(Composite comp)
Sets the Composite for the Graphics2D context. |
void |
setCompressImage(boolean comp)
Set whether to compress the image object and streams in the PDF. |
void |
setCompressText(boolean comp)
Set whether to compress the text object and streams in the PDF. |
void |
setDocumentInfo(DocumentInfo info)
Set the document info. |
void |
setEncryptInfo(PDFEncryptInfo info)
Set the PDF document encryption infomation. |
void |
setFont(Font font)
Sets the font for all subsequent text-drawing operations. |
void |
setLineWidth(float w)
Set the line width in points. |
void |
setMac(boolean isMac)
|
void |
setMapSymbols(boolean map)
Set whether to map unicode characters for greek and math symbols to symbol font characters. |
void |
setOpenBookmark(boolean openBookmark)
Set the "openBookmark" flag (which indicates whether bookmarks should be immediately displayed when the PDF file is opened). |
void |
setOpenThumbnail(boolean openThumbnail)
Set the "openThumbnail" flag (which indicates whether thumbnails should be immediately displayed when the PDF file is opened). |
void |
setOrientation(int orient)
Set page orientation. |
void |
setOutput(OutputStream o)
Set the output stream for the PDF output. |
void |
setPageSize(double width,
double height)
Set the page size in inches. |
void |
setPageSize(Size size)
Set the page size in inches. |
void |
setPaint(Paint paint)
Set the brush of painting. |
void |
setPaintMode()
Sets the default paint mode to overwrite the destination with the current color. |
void |
setPrinterJob(PrinterJob job)
Set the printer job associated with this graphics. |
void |
setPrintScaling(boolean printScaling)
Sets the "PrintScaling" flag. |
void |
setRenderingHint(RenderingHints.Key hintKey,
Object hintValue)
Not supported. |
void |
setRenderingHints(Map hints)
Not supported. |
void |
setReportLocale(Locale reportLocale)
Sets the locale of the report being rendered. |
void |
setStroke(Stroke s)
Set the painting pen. |
void |
setStructurePart(PDFPrinter.StructurePart structurePart)
Set which page part is being processed. |
void |
setTransform(AffineTransform tx)
|
void |
setXORMode(Color c1)
Sets the paint mode to alternate between the current color and the new specified color. |
void |
shear(double shx,
double shy)
|
static String[] |
splitWords(String str)
Split delimited string into array of words. |
void |
startArtifact()
Marks the start of a non-content artifact. |
void |
startDoc()
Initialize file. |
void |
startFigure(String altText)
Marks the beginning of a figure. |
void |
startHeading(int level)
Marks the start of a heading. |
protected void |
startPage()
Initialize a new page. |
void |
startParagraph(Integer linkId)
Marks the beginning of a paragraph of text. |
void |
startTable()
Marks the beginning of a table. |
void |
startTableCell(Integer linkId)
Marks the beginning of a table data cell. |
void |
startTableHeader(Integer linkId)
Marks the beginning of a table header cell. |
void |
startTableRow()
Marks the beginning of a table row. |
protected float |
stringWidth(String str)
Return the string width. |
String |
toString()
Returns a String object representing this Graphic's value. |
void |
transform(AffineTransform tx)
|
protected void |
transformRect(Rectangle2D.Double rect,
boolean reverse)
|
protected double |
transformX(double x)
Translate Java coordinate to PDF coordinate. |
protected double |
transformY(double y)
Flip Y coords so PDFPrinter looks like Java. |
void |
translate(double x,
double y)
|
void |
translate(int x,
int y)
|
protected void |
updateCharacterSet(String s)
Updates the set of characters used for the current font to include the characters of the specified string. |
protected void |
writeAdditionalResources(PrintWriter os)
This function is called to allow additional resources to be written to the current page. |
protected void |
writeAnnotations()
Write out the annotations. |
protected int |
writeEncoding(int idx)
Write the encoding object |
int |
writeGradientPaint(GradientPaint gpaint)
Write pattern object. |
protected void |
writeOthers()
flush out the others buffer. |
int |
writePattern(Image img)
Write pattern object. |
protected void |
writePatternResources(PrintWriter os)
Write the pattern resources. |
| Methods inherited from class java.awt.Graphics |
|---|
finalize, getClipBounds, getClipRect, hitClip |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected int pageheight
protected int pagewidth
public static final int RESOLUTION
protected Map fontmap
protected FontMetrics fm
protected FontMetrics afm
protected PDFPrinter.PDFWriter pg
protected PDFPrinter.CountWriter others
protected String psFontName
protected Map fontFn
protected List fnList
protected Map fontObj
protected Map fnObj
protected List pageIds
protected List annotsIds
protected Map annots
protected String outlines
protected int insetx
protected static String[] charname
protected static int[][] charRanges
| Constructor Detail |
|---|
public PDFPrinter()
public PDFPrinter(File outf)
throws IOException
outf - output file.
IOExceptionpublic PDFPrinter(OutputStream o)
o - Output stream for PostScript outputcreate()| Method Detail |
|---|
public void setOutput(OutputStream o)
setOutput in interface PDFDevicepublic void setCompressText(boolean comp)
setCompressText in interface PDFDevicecomp - compression option.public boolean isCompressText()
isCompressText in interface PDFDevicepublic void setAsciiOnly(boolean ascii)
setAsciiOnly in interface PDFDeviceascii - output ascii only.public boolean isAsciiOnly()
isAsciiOnly in interface PDFDevicepublic void setCompressImage(boolean comp)
setCompressImage in interface PDFDevicecomp - compression option.public boolean isCompressImage()
isCompressImage in interface PDFDevicepublic void setMapSymbols(boolean map)
setMapSymbols in interface PDFDevicepublic boolean isMapSymbols()
isMapSymbols in interface PDFDevicepublic void setOpenBookmark(boolean openBookmark)
public boolean isOpenBookmark()
public void setOpenThumbnail(boolean openThumbnail)
public boolean isOpenThumbnail()
public void setPrintScaling(boolean printScaling)
printScaling - true to set print scaling to the
application default; false for none.public boolean isPrintScaling()
true to set print scaling to the application
default; false for none.public boolean isAccessible()
Accessible PDF files will be larger and may take longer to generate.
public void setAccessible(boolean accessible)
Accessible PDF files will be larger and may take longer to generate.
accessible - true to generate an accessible PDF;
false otherwise.public Locale getReportLocale()
public void setReportLocale(Locale reportLocale)
reportLocale - the report locale.public void startParagraph(Integer linkId)
startParagraph in interface PDFDevicelinkId - the identifier of the link annotation associated with the
paragraph.public void endParagraph()
endParagraph in interface PDFDevicepublic void startHeading(int level)
startHeading in interface PDFDevicelevel - the heading level.public void endHeading()
endHeading in interface PDFDevicepublic void startFigure(String altText)
startFigure in interface PDFDevicealtText - the alternate text for the chart graphic.public void endFigure()
endFigure in interface PDFDevicepublic void startTable()
startTable in interface PDFDevicepublic void endTable()
endTable in interface PDFDevicepublic void startTableRow()
startTableRow in interface PDFDevicepublic void startTableHeader(Integer linkId)
startTableHeader in interface PDFDevicelinkId - the identifier of the link annotation associated with the
paragraph.public void endTableHeader()
endTableHeader in interface PDFDevicepublic void startTableCell(Integer linkId)
startTableCell in interface PDFDevicelinkId - the identifier of the link annotation associated with the
paragraph.public void endTableCell()
endTableCell in interface PDFDevicepublic void startArtifact()
startArtifact in interface PDFDevicepublic void endArtifact()
endArtifact in interface PDFDevicepublic void setDocumentInfo(DocumentInfo info)
public DocumentInfo getDocumentInfo()
public void setEncryptInfo(PDFEncryptInfo info)
public PDFEncryptInfo getEncryptInfo()
public boolean isEncrypted()
public Size getPageSize()
getPageSize in interface PDFDevice
public void setPageSize(double width,
double height)
width - page width.height - page height.public void setPageSize(Size size)
setPageSize in interface PDFDevicesize - Size object in inches.public void setOrientation(int orient)
setOrientation in interface inetsoft.report.internal.CustomGraphicssetOrientation in interface PDFDeviceorient - orientation, StyleConstants.PORTRAIT or
StyleConstants.LANDSCAPE.public String getFontName(Font font)
getFontName in interface PDFDevicefont - Java font.
public void putFontName(String javaName,
String psFontName)
putFontName in interface PDFDevicejavaName - Java font name.psFontName - mapped font name.
protected String getTextString(Object obj,
boolean wide)
protected String getTextString(Object obj)
protected String getTextString(int onum,
int gnum,
Object obj)
protected void updateCharacterSet(String s)
s - the string to add.
protected final boolean isWideCharString(String str,
boolean font)
public boolean addField(inetsoft.report.internal.FieldPainterPaintable pt)
addField in interface PDFDevicepublic int getOutputSize()
public PrintJob getPrintJob()
getPrintJob in interface PDFDevicegetPrintJob in interface PrintGraphicspublic Graphics create()
create in class Graphics
public Graphics create(int x,
int y,
int width,
int height)
create in class Graphicsx - the x coordinatey - the y coordinatewidth - the width of the areaheight - the height of the areatranslate(int, int)public Color getColor()
getColor in class Graphicspublic void setBackground(Color c)
setBackground in class Graphics2Dpublic Color getBackground()
getBackground in class Graphics2Dpublic void setColor(Color c)
setColor in class Graphicsc - the color to be setpublic void setPaintMode()
setPaintMode in class Graphicspublic void setXORMode(Color c1)
setXORMode in class Graphicsc1 - the second color
Note: setXORMode not supported by PostScriptpublic Font getFont()
getFont in class GraphicssetFont(java.awt.Font)public void setFont(Font font)
setFont in class Graphicsfont - the specified fontprotected String emitFont(Font font)
public String getBaseFontName(String fontname,
Font font)
public FontMetrics getFontMetrics()
getFontMetrics in class GraphicsgetFont()public FontMetrics getFontMetrics(Font f)
getFontMetrics in class Graphicsf - the specified fontgetFont(),
getFontMetrics()public Rectangle getClipBounds()
getClipBounds in class Graphicspublic Shape getClip()
getClip in class GraphicsShape object representing the
current clipping area.
public void clipRect(int x,
int y,
int width,
int height)
clipRect in class Graphicsx - the x coordinatey - the y coordinatewidth - the width of the rectangleheight - the height of the rectangleGraphics.getClipRect()
public void clipRect(double x,
double y,
double width,
double height)
public void setClip(int x,
int y,
int width,
int height)
setClip in class Graphicsx - the x coordinate of the new clip rectangle.y - the y coordinate of the new clip rectangle.width - the width of the new clip rectangle.height - the height of the new clip rectangle.
public void setClip(double x,
double y,
double width,
double height)
protected void emitClip(double x,
double y,
double width,
double height)
public void copyArea(int x,
int y,
int width,
int height,
int dx,
int dy)
copyArea in class Graphicsx - the x-coordinate of the sourcey - the y-coordinate of the sourcewidth - the widthheight - the heightdx - the horizontal distancedy - the vertical distance
Note: copyArea not supported by PostScript
public void drawLine(int x1,
int y1,
int x2,
int y2)
drawLine in class Graphicsx1 - the first point's x coordinatey1 - the first point's y coordinatex2 - the second point's x coordinatey2 - the second point's y coordinate
public void drawLine(double x1,
double y1,
double x2,
double y2)
public void drawPolyline(int[] xPoints,
int[] yPoints,
int nPoints)
drawPolyline in class GraphicsxPoints - an array of x pointsyPoints - an array of y pointsnPoints - the total number of points
public void drawPolyline(float[] xPoints,
float[] yPoints,
int nPoints)
xPoints - an array of x pointsyPoints - an array of y pointsnPoints - the total number of points
public void fillRect(int x,
int y,
int width,
int height)
fillRect in class Graphicsx - the x coordinatey - the y coordinatewidth - the width of the rectangleheight - the height of the rectangledrawRect(int, int, int, int),
clearRect(int, int, int, int)
public void fillRect(double x,
double y,
double width,
double height)
public void drawRect(int x,
int y,
int width,
int height)
drawRect in class Graphicsx - the x coordinatey - the y coordinatewidth - the width of the rectangleheight - the height of the rectanglefillRect(int, int, int, int),
clearRect(int, int, int, int)
public void drawRect(double x,
double y,
double width,
double height)
public void clearRect(int x,
int y,
int width,
int height)
clearRect in class Graphicsx - the x coordinatey - the y coordinatewidth - the width of the rectangleheight - the height of the rectanglefillRect(int, int, int, int),
drawRect(int, int, int, int)
public void clearRect(double x,
double y,
double width,
double height)
public void drawRoundRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight)
drawRoundRect in class Graphicsx - the x coordinatey - the y coordinatewidth - the width of the rectangleheight - the height of the rectanglearcWidth - the diameter of the arcarcHeight - the radius of the arcfillRoundRect(int, int, int, int, int, int)
public void drawRoundRect(double x,
double y,
double width,
double height,
double arcWidth,
double arcHeight)
public void fillRoundRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight)
fillRoundRect in class Graphicsx - the x coordinatey - the y coordinatewidth - the width of the rectangleheight - the height of the rectanglearcWidth - the diameter of the arcarcHeight - the radius of the arcdrawRoundRect(int, int, int, int, int, int)
public void fillRoundRect(double x,
double y,
double width,
double height,
double arcWidth,
double arcHeight)
public void draw3DRect(int x,
int y,
int width,
int height,
boolean raised)
draw3DRect in class Graphics2Dx - the x coordinatey - the y coordinatewidth - the width of the rectangleheight - the height of the rectangleraised - a boolean that states whether the rectangle is raised
or not.
public void draw3DRect(double x,
double y,
double width,
double height,
boolean raised)
public void fill3DRect(int x,
int y,
int width,
int height,
boolean raised)
fill3DRect in class Graphics2Dx - the x coordinatey - the y coordinatewidth - the width of the rectangleheight - the height of the rectangleraised - a boolean that states whether the rectangle is raised
or not.
public void fill3DRect(double x,
double y,
double width,
double height,
boolean raised)
public void drawOval(int x,
int y,
int width,
int height)
drawOval in class Graphicsx - the x coordinatey - the y coordinatewidth - the width of the rectangleheight - the height of the rectanglefillOval(int, int, int, int)
public void drawOval(double x,
double y,
double width,
double height)
public void fillOval(int x,
int y,
int width,
int height)
fillOval in class Graphicsx - the x coordinatey - the y coordinatewidth - the width of the rectangleheight - the height of the rectangledrawOval(int, int, int, int)
public void fillOval(double x,
double y,
double width,
double height)
public void drawArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle)
drawArc in class Graphicsx - the x coordinatey - the y coordinatewidth - the width of the rectangleheight - the height of the rectanglestartAngle - the beginning anglearcAngle - the angle of the arc (relative to startAngle).fillArc(int, int, int, int, int, int)
public void drawArc(double x,
double y,
double width,
double height,
double startAngle,
double arcAngle,
int arcType)
public void fillArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle)
fillArc in class Graphicsx - the x coordinatey - the y coordinatewidth - the width of the archeight - the height of the arcstartAngle - the beginning anglearcAngle - the angle of the arc (relative to startAngle).drawArc(int, int, int, int, int, int)
public void fillArc(double x,
double y,
double width,
double height,
double startAngle,
double arcAngle)
public void drawPolygon(int[] xPoints,
int[] yPoints,
int nPoints)
drawPolygon in class GraphicsxPoints - an array of x pointsyPoints - an array of y pointsnPoints - the total number of pointsfillPolygon(int[], int[], int)public void drawPolygon(Polygon p)
drawPolygon in class Graphicsp - the specified polygonfillPolygon(int[], int[], int)
public void fillPolygon(int[] xPoints,
int[] yPoints,
int nPoints)
fillPolygon in class GraphicsxPoints - an array of x pointsyPoints - an array of y pointsnPoints - the total number of pointsdrawPolygon(int[], int[], int)public void fillPolygon(Polygon p)
fillPolygon in class Graphicsp - the polygondrawPolygon(int[], int[], int)
public void drawString(String str,
int sx,
int sy)
drawString in class Graphics2Dstr - the String to be drawnsx - the x coordinatesy - the y coordinate
public void drawString(String str,
float sx,
float sy)
drawString in class Graphics2D
public char[] drawString(String str,
double sx,
double sy)
protected void emitTj(String txt)
protected float stringWidth(String str)
public void drawChars(char[] data,
int offset,
int length,
int x,
int y)
drawChars in class Graphicsdata - the array of characters to be drawnoffset - the start offset in the datalength - the number of characters to be drawnx - the x coordinatey - the y coordinatedrawString(java.lang.String, int, int),
drawBytes(byte[], int, int, int, int)
public void drawBytes(byte[] data,
int offset,
int length,
int x,
int y)
drawBytes in class Graphicsdata - the data to be drawnoffset - the start offset in the datalength - the number of bytes that are drawnx - the x coordinatey - the y coordinatedrawString(java.lang.String, int, int),
drawChars(char[], int, int, int, int)
public boolean doImage(Image img,
int x,
int y,
int width,
int height,
ImageObserver observer,
Color bgcolor)
public boolean doImage(Image img,
int x,
int y,
int width,
int height,
int sx1,
int sy1,
int sx2,
int sy2,
ImageObserver observer,
Color bgcolor)
protected int emitImage(inetsoft.util.PixelConsumer pc,
int x,
int y,
Dimension isize,
ImageObserver observer,
Color bgcolor)
protected int emitImage(inetsoft.report.internal.MetaImage image,
int x,
int y,
Dimension isize,
Color bgcolor)
throws IOException
IOException
public boolean drawImage(Image img,
int x,
int y,
ImageObserver observer)
drawImage in class Graphicsimg - the specified image to be drawnx - the x coordinatey - the y coordinateobserver - notifies if the image is complete or notImage,
ImageObserver
public boolean drawImage(Image img,
int x,
int y,
int width,
int height,
ImageObserver observer)
drawImage in class Graphicsimg - the specified image to be drawnx - the x coordinatey - the y coordinatewidth - the width of the rectangleheight - the height of the rectangleobserver - notifies if the image is complete or notImage,
ImageObserver
public boolean drawImage(Image img,
int x,
int y,
Color bgcolor,
ImageObserver observer)
drawImage in class Graphicsimg - the specified image to be drawnx - the x coordinatey - the y coordinatebgcolor - the background colorobserver - notifies if the image is complete or notImage,
ImageObserver
public boolean drawImage(Image img,
int x,
int y,
int width,
int height,
Color bgcolor,
ImageObserver observer)
drawImage in class Graphicsimg - the specified image to be drawnx - the x coordinatey - the y coordinatewidth - the width of the rectangleheight - the height of the rectanglebgcolor - the background colorobserver - notifies if the image is complete or notImage,
NOTE: PDFPrinter ignores the background color.
public boolean drawImage(Image img,
int dx1,
int dy1,
int dx2,
int dy2,
int sx1,
int sy1,
int sx2,
int sy2,
ImageObserver observer)
This method returns immediately in all cases, even if the
image area to be drawn has not yet been scaled, dithered, and converted
for the current output device.
If the current output representation is not yet complete then
drawImage returns false. As more of
the image becomes available, the process that draws the image notifies
the specified image observer.
This method always uses the unscaled version of the image to render the scaled rectangle and performs the required scaling on the fly. It does not use a cached, scaled version of the image for this operation. Scaling of the image from source to destination is performed such that the first coordinate of the source rectangle is mapped to the first coordinate of the destination rectangle, and the second source coordinate is mapped to the second destination coordinate. The subimage is scaled and flipped as needed to preserve those mappings.
drawImage in class Graphicsimg - the specified image to be drawndx1 - the x coordinate of the first corner of the
destination rectangle.dy1 - the y coordinate of the first corner of the
destination rectangle.dx2 - the x coordinate of the second corner of the
destination rectangle.dy2 - the y coordinate of the second corner of the
destination rectangle.sx1 - the x coordinate of the first corner of the
source rectangle.sy1 - the y coordinate of the first corner of the
source rectangle.sx2 - the x coordinate of the second corner of the
source rectangle.sy2 - the y coordinate of the second corner of the
source rectangle.observer - object to be notified as more of the image is
scaled and converted.
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)
Transparent pixels are drawn in the specified background color. This operation is equivalent to filling a rectangle of the width and height of the specified image with the given color and then drawing the image on top of it, but possibly more efficient.
This method returns immediately in all cases, even if the
image area to be drawn has not yet been scaled, dithered, and converted
for the current output device.
If the current output representation is not yet complete then
drawImage returns false. As more of
the image becomes available, the process that draws the image notifies
the specified image observer.
This method always uses the unscaled version of the image to render the scaled rectangle and performs the required scaling on the fly. It does not use a cached, scaled version of the image for this operation. Scaling of the image from source to destination is performed such that the first coordinate of the source rectangle is mapped to the first coordinate of the destination rectangle, and the second source coordinate is mapped to the second destination coordinate. The subimage is scaled and flipped as needed to preserve those mappings.
drawImage in class Graphicsimg - the specified image to be drawndx1 - the x coordinate of the first corner of the
destination rectangle.dy1 - the y coordinate of the first corner of the
destination rectangle.dx2 - the x coordinate of the second corner of the
destination rectangle.dy2 - the y coordinate of the second corner of the
destination rectangle.sx1 - the x coordinate of the first corner of the
source rectangle.sy1 - the y coordinate of the first corner of the
source rectangle.sx2 - the x coordinate of the second corner of the
source rectangle.sy2 - the y coordinate of the second corner of the
source rectangle.bgcolor - the background color to paint under the
non-opaque portions of the image.observer - object to be notified as more of the image is
scaled and converted.public void dispose()
dispose in class Graphicspublic void close()
close in interface PDFDevicepublic void emit(String cmd)
public void gsave(int level)
public int grestore(int level)
public Integer addLink(Hyperlink.Ref link,
Rectangle linkBounds,
double pgH,
Map actions,
int page,
boolean flush)
link - the target of the hyperlink.linkBounds - the bounds of the linked element.pgH - the page height.actions - map of action ids to internal targets.page - the page index (zero-based).flush - true to flush the object buffer.
public void addAnnotation(int id,
int page)
id - the annotation idpage - the page the annotation is being added to
public void addObject(int id,
String obj)
public void addObject(int id,
String obj,
boolean flush)
protected void writeAnnotations()
protected void writeOthers()
protected void writeAdditionalResources(PrintWriter os)
public void startDoc()
protected int writeEncoding(int idx)
public void setLineWidth(float w)
public void checkTextObj(boolean txt)
txt - true to make in a text segment or false to end text object.public String getPDFVersion()
public String toString()
toString in class Graphicsprotected final double transformY(double y)
protected final double transformX(double x)
protected String getNaturalLanguage()
protected int getNextFontIndex()
public int getNextObjectID()
public int getNextPatternID()
protected final void startPage()
public int writeGradientPaint(GradientPaint gpaint)
public int writePattern(Image img)
protected boolean isBase14Font(String fontin)
protected String getPSFontNameWithInsetx(String pfname,
int ix)
protected boolean isInsetxNeeded(String pfname,
int ix)
public static String[] splitWords(String str)
public PrinterJob getPrinterJob()
PrinterJob that is controlling the
current rendering request.
PrinterJob controlling the current
rendering request.public void setPrinterJob(PrinterJob job)
public void draw(Shape s)
draw in class Graphics2D
public boolean drawImage(Image img,
AffineTransform xform,
ImageObserver obs)
drawImage in class Graphics2D
public void drawImage(BufferedImage img,
BufferedImageOp op,
int x,
int y)
drawImage in class Graphics2D
public void drawRenderedImage(RenderedImage img,
AffineTransform xform)
drawRenderedImage in class Graphics2D
public void drawRenderableImage(RenderableImage img,
AffineTransform xform)
drawRenderableImage in class Graphics2D
public void drawString(AttributedCharacterIterator iterator,
int x,
int y)
drawString in class Graphics2D
public void drawString(AttributedCharacterIterator iterator,
float x,
float y)
drawString in class Graphics2D
public void drawGlyphVector(GlyphVector g,
float x,
float y)
drawGlyphVector in class Graphics2Dpublic void fill(Shape s)
fill in class Graphics2Dpublic void setPaint(Paint paint)
setPaint in class Graphics2D
public boolean hit(Rectangle rect,
Shape s,
boolean onStroke)
hit in class Graphics2Dpublic void setStroke(Stroke s)
setStroke in class Graphics2D
public void setRenderingHint(RenderingHints.Key hintKey,
Object hintValue)
setRenderingHint in class Graphics2Dpublic Object getRenderingHint(RenderingHints.Key hintKey)
getRenderingHint in class Graphics2Dpublic void setRenderingHints(Map hints)
setRenderingHints in class Graphics2Dpublic void addRenderingHints(Map hints)
addRenderingHints in class Graphics2Dpublic RenderingHints getRenderingHints()
getRenderingHints in class Graphics2D
public void translate(int x,
int y)
translate in class Graphics2D
public void translate(double x,
double y)
translate in class Graphics2Dpublic GraphicsConfiguration getDeviceConfiguration()
getDeviceConfiguration in class Graphics2Dpublic void setComposite(Composite comp)
setComposite in class Graphics2Dpublic void rotate(double theta)
rotate in class Graphics2D
public void rotate(double theta,
double x,
double y)
rotate in class Graphics2D
public void scale(double sx,
double sy)
scale in class Graphics2D
public void shear(double shx,
double shy)
shear in class Graphics2Dpublic void transform(AffineTransform tx)
transform in class Graphics2Dpublic void setTransform(AffineTransform tx)
setTransform in class Graphics2Dpublic AffineTransform getTransform()
getTransform in class Graphics2Dprotected void emitcm(AffineTransform tx)
public Paint getPaint()
getPaint in class Graphics2Dpublic Composite getComposite()
getComposite in class Graphics2Dpublic Stroke getStroke()
getStroke in class Graphics2Dpublic boolean isSupported(int feature)
isSupported in interface inetsoft.report.internal.CustomGraphicspublic void setClip(Shape s)
setClip in class Graphicspublic void clip(Shape s)
clip in class Graphics2Dpublic FontRenderContext getFontRenderContext()
getFontRenderContext in class Graphics2D
protected final void transformRect(Rectangle2D.Double rect,
boolean reverse)
protected void writePatternResources(PrintWriter os)
protected boolean isCurrentCJKFont()
public Object clone()
clone in class Object
protected void debug(PDFPrinter.PDFWriter os,
String m)
protected boolean containsArabicCombinCharacter()
public void setMac(boolean isMac)
public void setStructurePart(PDFPrinter.StructurePart structurePart)
structurePart - the StructurePart of the page
|
Copyright © 1996-2014 InetSoft Technology Corp. All Rights Reserved. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||