public class PaintUtils
extends java.lang.Object
限定符和类型 | 字段和说明 |
---|---|
static java.awt.Color |
CELL_CONDITION_FILTER_MARK_COLOR |
static java.awt.Color |
CELL_DIRECTION_MARK_COLOR |
static java.awt.Color |
CELL_HIGHT_LIGHT_MARK_COLOR |
static int |
CELL_MARK_SIZE |
static java.awt.Color |
CELL_PAGINATION_MARK_COLOR |
static java.awt.Color |
CELL_PARAMETER_FILTER_MARK_CONLR |
static java.awt.Color |
CELL_PRESENT_MARK_COLOR |
static java.awt.Color |
CELL_RESULT_MARK_COLOR |
限定符和类型 | 方法和说明 |
---|---|
static UNIT |
analyzeCellElementPreferredHeight(CellElement cellElement,
UNIT paintWidth)
Preferred height.
|
static java.lang.String |
clipBlockValue(java.lang.Object value,
Style style,
java.awt.Rectangle primitiveArea,
java.awt.Rectangle blockArea,
int resolution,
boolean isShowAsHTML)
截取文字,只考虑了垂直方向,水平方向没意义且难度大.
|
static java.util.Map |
createFontAttributeMap(java.awt.Font font)
create font attribute map, 创建属性map
|
static java.awt.image.BufferedImage |
createHTMLContentBufferedImage(java.lang.String value,
java.awt.Rectangle paintRectangle,
int x,
int y,
Style style)
如果用户希望以HTML方式展示String,这个时候先value变成图片
|
static int |
getLineTextCount(java.lang.String text,
Style style,
UNIT paintWidth)
see
BaseUtils.getLineTextList , 等于BaseUtils.getLineTextList().size()
Denny: 为了提高速度和性能,才单独拿出来的
TODO: 重构 |
static UNIT |
getPreferredWidth(CellElement cell,
UNIT height)
Gets the preferred width.
|
static void |
paintBarcode(java.awt.Graphics2D g2d,
int width,
int height,
java.lang.String text,
Style style,
BarcodeAttr barcodeAttr)
paintBarcode
|
static void |
paintFloatElement(java.awt.Graphics2D g2d,
FloatElement flotEl,
int width,
int height,
int resolution) |
static void |
paintFloatElement(java.awt.Graphics2D g2d,
FloatElement flotEl,
java.awt.Rectangle paintRectangle,
java.awt.Rectangle clipRectangle,
int resolution) |
static void |
paintGridCellContent(java.awt.Graphics2D g2d,
TemplateCellElement cell,
int width,
int height,
int resolution) |
static void |
paintHTMLContent(java.awt.Graphics2D g2d,
java.lang.String value,
int resolution,
Style style,
java.awt.Rectangle paintRectangle,
java.awt.Rectangle clipRectangle) |
static void |
paintTag(Painter painter,
Repository repo,
int width,
int height,
Style style,
Tag tag) |
public static final int CELL_MARK_SIZE
public static final java.awt.Color CELL_HIGHT_LIGHT_MARK_COLOR
public static final java.awt.Color CELL_PRESENT_MARK_COLOR
public static final java.awt.Color CELL_PAGINATION_MARK_COLOR
public static final java.awt.Color CELL_RESULT_MARK_COLOR
public static final java.awt.Color CELL_CONDITION_FILTER_MARK_COLOR
public static final java.awt.Color CELL_PARAMETER_FILTER_MARK_CONLR
public static final java.awt.Color CELL_DIRECTION_MARK_COLOR
public static void paintGridCellContent(java.awt.Graphics2D g2d, TemplateCellElement cell, int width, int height, int resolution)
public static void paintFloatElement(java.awt.Graphics2D g2d, FloatElement flotEl, int width, int height, int resolution)
public static void paintFloatElement(java.awt.Graphics2D g2d, FloatElement flotEl, java.awt.Rectangle paintRectangle, java.awt.Rectangle clipRectangle, int resolution)
public static void paintHTMLContent(java.awt.Graphics2D g2d, java.lang.String value, int resolution, Style style, java.awt.Rectangle paintRectangle, java.awt.Rectangle clipRectangle)
public static void paintTag(Painter painter, Repository repo, int width, int height, Style style, Tag tag)
public static java.awt.image.BufferedImage createHTMLContentBufferedImage(java.lang.String value, java.awt.Rectangle paintRectangle, int x, int y, Style style)
value
- 值paintRectangle
- 绘制范围x
- x坐标y
- y坐标style
- 当前格子样式public static int getLineTextCount(java.lang.String text, Style style, UNIT paintWidth)
BaseUtils.getLineTextList
, 等于BaseUtils.getLineTextList().size()
Denny: 为了提高速度和性能,才单独拿出来的
TODO: 重构text
- 文本style
- 样式paintWidth
- 单元格宽度public static UNIT getPreferredWidth(CellElement cell, UNIT height)
public static UNIT analyzeCellElementPreferredHeight(CellElement cellElement, UNIT paintWidth)
cellElement
- 单元格内容paintWidth
- 画的宽度public static java.lang.String clipBlockValue(java.lang.Object value, Style style, java.awt.Rectangle primitiveArea, java.awt.Rectangle blockArea, int resolution, boolean isShowAsHTML)
value
- 画的值style
- 字体样式格式.blockArea
- 冻结的范围resolution
- 分辨率public static void paintBarcode(java.awt.Graphics2D g2d, int width, int height, java.lang.String text, Style style, BarcodeAttr barcodeAttr)
public static java.util.Map createFontAttributeMap(java.awt.Font font)
font
- 字体