public class Cell extends Canvas
绘制行为详见渲染器:CellContentDrawer
| 构造器和说明 |
|---|
Cell(Double width,
Double height)
创建单元对象
|
Cell(double x,
double y,
double w,
double h)
创建单元对象
|
| 限定符和类型 | 方法和说明 |
|---|---|
Boolean |
getBlob()
已过时。
单词错误
getBold()
是否加粗 |
Boolean |
getBold()
是否加粗
|
String |
getColor()
获取单元格颜色
|
boolean |
getDeleteLine()
获取是否开启删除线
|
CellContentDrawer |
getDrawer()
获取单元格内容绘制器
|
String |
getFontName()
获取字体名称
|
double |
getFontSize()
获取字号
|
String |
getFontWeight()
获取字体宽度
|
double |
getImgHeight()
获取图片宽度
|
Path |
getImgPath()
获取图片路径
|
double |
getImgWidth()
获取图片高度
|
Boolean |
getItalic()
是否斜体
|
Double |
getLetterSpacing()
获取 文字之间的间距
|
Double |
getLineSpace()
获取 行间距
|
TextAlign |
getTextAlign()
获取 文字对齐方式
|
boolean |
getUnderline()
获取是否开启下划线
|
String |
getValue()
获取单元格文字内容
|
VerticalAlign |
getVerticalAlign()
获取 文字垂直方向浮动方式
|
Cell |
setBlob(Boolean blob)
已过时。
单词错误
getBold()
设置 是否加粗 |
Cell |
setBold(Boolean blob)
设置 是否加粗
|
Cell |
setColor(String color)
设置单元格颜色
|
Cell |
setDeleteLine(boolean deleteLine)
设置是否开启删除线
|
Cell |
setDrawer(Drawer drawer)
设置单元格内容绘制器
|
Cell |
setFont(String fontName,
Path fontPath)
设置单元格使用的外部字体
注意OFDRW不会提供任何字体裁剪功能,您的字体文件将直接加入OFD文件中,这可能造成文件体积剧增。
|
Cell |
setFontName(String fontName)
设置字体名称
|
Cell |
setFontSize(double fontSize)
设置字号
|
Cell |
setFontWeight(String fontWeight)
设置字体宽度
|
Cell |
setItalic(Boolean italic)
设置 是否斜体
|
Cell |
setLetterSpacing(Double letterSpacing)
设置 文字之间的间距
|
Cell |
setLineSpace(Double lineSpace)
设置 行间距
|
Cell |
setTextAlign(TextAlign textAlign)
设置 文字对齐方式
|
Cell |
setUnderline(boolean underline)
设置是否开启下划线
|
Cell |
setValue(Path imgPath)
设置图片
图片宽度与高度通过
DrawContext.mm(int) } 方法转换为毫米 |
Cell |
setValue(Path imgPath,
double w,
double h)
设置图片
|
Cell |
setValue(String value)
设置单元格文字内容
|
Cell |
setVerticalAlign(VerticalAlign verticalAlign)
设置 文字垂直方向浮动方式
|
doPrepare, elementType, getPreferBlock, setPreferBlockbox, clone, contentSplitAdjust, copyTo, getBackgroundColor, getBorder, getBorderBottom, getBorderColor, getBorderDash, getBorderLeft, getBorderRight, getBorderTop, getClear, getDisplay, getFloat, getHeight, getLayer, getLeft, getMargin, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getOnRenderFinish, getOpacity, getPadding, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getPosition, getRight, getTop, getWidth, getX, getY, heightPlus, isBlockElement, isIntegrity, isNoBorder, isPlaceholder, onRenderFinish, placeholder, placeholder, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBorder, setBorderBottom, setBorderColor, setBorderColor, setBorderColor, setBorderDash, setBorderLeft, setBorderRight, setBorderTop, setBox, setClear, setDisplay, setFloat, setHeight, setIntegrity, setLayer, setLeft, setMargin, setMarginBottom, setMarginLeft, setMarginRight, setMarginTop, setOpacity, setPadding, setPaddingBottom, setPaddingLeft, setPaddingRight, setPaddingTop, setPlaceholder, setPosition, setRight, setTop, setWidth, setX, setXY, setY, split, toString, widthPluspublic Cell(double x,
double y,
double w,
double h)
x - x坐标(单位:毫米mm)y - y坐标(单位:毫米mm)w - 宽度(单位:毫米mm)h - 高度(单位:毫米mm)public CellContentDrawer getDrawer()
public String getValue()
public Cell setValue(Path imgPath, double w, double h)
imgPath - 图片路径,仅支持png、jpg、jpeg、gif、bmp格式w - 图片宽度,单位:毫米h - 图片高度,单位:毫米public Cell setValue(Path imgPath) throws IOException
图片宽度与高度通过 DrawContext.mm(int) } 方法转换为毫米
imgPath - 图片路径,仅支持png、jpg、jpeg、gif、bmp格式IOException - 图片加载异常public String getColor()
public Cell setColor(String color)
color - 单元格颜色,格式:#000000、rgb(0,0,0)、rgba(0,0,0,1)public String getFontName()
public Cell setFontName(String fontName)
fontName - 字体名称,仅支持系统安装字体,且不会嵌入到OFD中。public Cell setFont(String fontName, Path fontPath)
注意OFDRW不会提供任何字体裁剪功能,您的字体文件将直接加入OFD文件中,这可能造成文件体积剧增。
fontName - 字体名称,如“思源宋体”fontPath - 字体文件所在路径public double getFontSize()
public Cell setFontSize(double fontSize)
fontSize - 字号,默认:3(单位:毫米)public TextAlign getTextAlign()
public Cell setTextAlign(TextAlign textAlign)
textAlign - 文字对齐方式public VerticalAlign getVerticalAlign()
VerticalAlign.centerpublic Cell setVerticalAlign(VerticalAlign verticalAlign)
verticalAlign - 文字垂直方向浮动方式public Double getLineSpace()
@Deprecated public Boolean getBlob()
getBold()
是否加粗@Deprecated public Cell setBlob(Boolean blob)
getBold()
设置 是否加粗blob - 是否加粗public Boolean getBold()
public Boolean getItalic()
public Cell setItalic(Boolean italic)
italic - 是否斜体,true - 斜体、false - 正常public Double getLetterSpacing()
public Cell setLetterSpacing(Double letterSpacing)
letterSpacing - 文字之间的间距,可以为负数,默认为:0。public Cell setUnderline(boolean underline)
underline - true - 启下划线,false - 禁用下划线public boolean getUnderline()
public Cell setDeleteLine(boolean deleteLine)
deleteLine - true - 启删除线,false - 禁用删除线public boolean getDeleteLine()
public Path getImgPath()
public double getImgWidth()
public double getImgHeight()
public String getFontWeight()
Copyright © 2024. All rights reserved.