📄 zabstractcellpainter.java
字号:
/* * Copyright 2002 EZCell , Inc. All rights reserved. * Version 1.0. * Author W.John */package ezcell;import java.awt.Graphics2D;import java.awt.Rectangle;import java.awt.geom.Line2D;/** * DOCUMENT ME! * * @version 1.00 * @author W.John */class ZAbstractCellPainter implements ZCellPainter { protected int leftHeadText; protected int topHeadText; protected ZPen gridxPen; protected ZPen gridyPen; protected boolean gridxVisible; protected boolean gridyVisible; protected Line2D line = new Line2D.Float(0, 0, 0, 0); ZAbstractCellPainter(ZDefaultUI ui) { updateUI(ui); } /** * * @param g2 * @param cellLoc * @param cell */ public void paint(Graphics2D g2, ZRect cellLoc, ZCell cell) { } /** * * @param ui */ public void updateUI(ZDefaultUI ui) { leftHeadText = ((Integer) ui.get(ZDefaultUI.LEFT_HEAD_TEXT)).intValue(); topHeadText = ((Integer) ui.get(ZDefaultUI.TOP_HEAD_TEXT)).intValue(); gridxPen = (ZPen) ui.get(ZDefaultUI.GRID_X_PEN); gridyPen = (ZPen) ui.get(ZDefaultUI.GRID_Y_PEN); gridxVisible = ((Boolean) ui.get(ZDefaultUI.GRID_X_VISIBLE)).booleanValue(); gridyVisible = ((Boolean) ui.get(ZDefaultUI.GRID_Y_VISIBLE)).booleanValue(); } /** * * @param g2 * @param cellLoc * * @return */ protected boolean isDirtyRect(Graphics2D g2, ZRect cellLoc) { Rectangle clipRect = g2.getClipBounds(); return !((cellLoc.right < clipRect.x) || (cellLoc.bottom < clipRect.y) || (cellLoc.top > (clipRect.y + clipRect.height)) || cellLoc.left > (clipRect.x + clipRect.width)); } /** * * @param cell * @param g2 * @param cellLoc * @param str * @param alignX * @param alignY * @param font */ protected void paintText(ZCell cell, Graphics2D g2, ZRect cellLoc, String str, int alignX, int alignY, ZFont font) { if (str == null) { return; } font.paint(g2, cellLoc, str, alignX, alignY,cell.isWordWrap() ); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -