📄 zpage.java
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -