zpage.java
来自「用Java写的报表.功能如下: 0.内建网络打印,网络预览功能! 1.文件操作。」· Java 代码 · 共 95 行
JAVA
95 行
package ezcell;import java.io.Writer;import java.io.OutputStreamWriter;import java.io.IOException;import java.awt.Color;import java.awt.Graphics;import java.awt.Graphics2D;import java.awt.print.*;import java.awt.print.Printable;import java.awt.print.PrinterJob;import java.io.FileOutputStream;import java.io.IOException;class ZPage implements Printable { static ZPen gridPen = new ZPen(1, new Color(192, 192, 192)); private ZPrintableCells body; private ZDocument doc; /** * put your documentation comment here * @param ZDocument doc * @param ZPrintableCells body */ public ZPage(ZDocument doc, ZPrintableCells body) { this.doc = doc; this.body = body; } /** * put your documentation comment here * @return */ public ZPrintableCells getBody() { return body; } /** * put your documentation comment here * @return */ public ZPrintableCells getFooter() { return doc.getFooter(); } /** * put your documentation comment here * @return */ public ZPrintableCells getHeader() { return doc.getHeader(); } /** * put your documentation comment here * @return */ public int getHeight() { return (int) doc.getPageFormat().getHeight(); } /** * put your documentation comment here * @return */ public int getPageNumber() { return doc.getPageNumber(this); } /** * put your documentation comment here * @return */ public int getWidth() { return (int) doc.getPageFormat().getWidth(); } /** * put your documentation comment here * @param g * @param pageFormat * @param pageIndex * @return */ public int print(Graphics g, PageFormat pageFormat, int pageIndex) { doc.setPage(this); Graphics2D g2 = (Graphics2D) g; doc.paint(g2); return PAGE_EXISTS; }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?