Class Cell
java.lang.Object
org.ofdrw.layout.element.Div<Canvas>
org.ofdrw.layout.element.canvas.Canvas
org.ofdrw.layout.element.canvas.Cell
- All Implemented Interfaces:
ElementSplit, RenderPrepare
单元对象
绘制行为详见渲染器:CellContentDrawer
- Since:
- 2023-11-21 19:22:28
- Author:
- 权观宇
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetBlob()Deprecated.getBold()是否加粗getColor()获取单元格颜色boolean获取是否开启删除线获取单元格内容绘制器获取字体名称double获取字号获取字体宽度double获取图片宽度获取图片路径double获取图片高度是否斜体获取 文字之间的间距获取 行间距获取 文字对齐方式boolean获取是否开启下划线getValue()获取单元格文字内容获取 文字垂直方向浮动方式Deprecated.单词错误getBold()设置 是否加粗设置 是否加粗设置单元格颜色setDeleteLine(boolean deleteLine) 设置是否开启删除线设置单元格内容绘制器设置单元格使用的外部字体setFontName(String fontName) 设置字体名称setFontSize(double fontSize) 设置字号setFontWeight(String fontWeight) 设置字体宽度设置 是否斜体setLetterSpacing(Double letterSpacing) 设置 文字之间的间距setLineSpace(Double lineSpace) 设置 行间距setTextAlign(TextAlign textAlign) 设置 文字对齐方式setUnderline(boolean underline) 设置是否开启下划线设置单元格文字内容设置图片设置图片setVerticalAlign(VerticalAlign verticalAlign) 设置 文字垂直方向浮动方式Methods inherited from class Canvas
doPrepare, elementType, getPreferBlock, setPreferBlockModifier and TypeMethodDescriptionCanvas 不接受宽度重设获取元素类型org.ofdrw.core.basicStructure.pageObj.layer.block.CT_PageBlock获取 优先使用的页面块voidsetPreferBlock(org.ofdrw.core.basicStructure.pageObj.layer.block.CT_PageBlock preferBlock) 设置 优先使用的页面块Methods inherited from class Div
box, 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, widthPlusModifier and TypeMethodDescriptionbox()获取模型区域大小clone()克隆DivcontentSplitAdjust(double sHeight, T div1, T div2) 内容分割调整<T extends Div>
TcopyTo(T div) Clone到制定对象int[]Double[]int[]获取 边框颜色Double[]获取 边框虚线样式getClear()获取 显示样式getFloat()org.ofdrw.core.basicStructure.pageObj.layer.TypegetLayer()返回 图层getLeft()Double[]获取渲染完成回调事件获取透明度Double[]获取内边距getRight()getTop()getWidth()getX()getY()doubleboolean是否是块级元素元素是否可以拆分boolean是否存在边框boolean判断是否为占位符voidonRenderFinish(ElementRenderFinishHandler renderFinishHandler) 设置渲染完成回调事件static Divplaceholder(double width, double height, AFloat aFloat) 空间占位符static Divplaceholder(Rectangle rec, AFloat aFloat) 空间占位符setBackgroundColor(int[] backgroundColor) 设置背景颜色 RGBsetBackgroundColor(int r, int g, int b) 设置背景颜色 RGBsetBackgroundColor(String color) 设置 背景颜色设置 边框宽度setBorderBottom(Double bottom) setBorderColor(int[] rgb) 设置 边框颜色setBorderColor(int r, int g, int b) 设置边框颜色setBorderColor(String color) 设置 边框颜色setBorderDash(Double... dash) 设置 边框虚线样式setBorderLeft(Double left) setBorderRight(Double right) setBorderTop(Double top) 设置盒式模型的主要属性setDisplay(Display display) 设置 显示样式设置浮动样式setIntegrity(Boolean integrity) setLayer(org.ofdrw.core.basicStructure.pageObj.layer.Type layer) 设置 图层设置 外边距setMarginBottom(Double bottom) setMarginLeft(Double left) setMarginRight(Double right) setMarginTop(Double top) setOpacity(Double opacity) 设置透明度setPadding(Double... padding) 设置 内边距setPaddingBottom(Double bottom) setPaddingLeft(Double left) setPaddingRight(Double right) setPaddingTop(Double top) setPlaceholder(boolean placeholder) 设置是否为 占位符setPosition(Position position) 设置位置Div[]split(double sHeight) 根据给定的高度切分元素toString()double
-
Constructor Details
-
Cell
-
Cell
public Cell(double x, double y, double w, double h) 创建单元对象- Parameters:
x- x坐标(单位:毫米mm)y- y坐标(单位:毫米mm)w- 宽度(单位:毫米mm)h- 高度(单位:毫米mm)
-
-
Method Details
-
setDrawer
-
getDrawer
获取单元格内容绘制器 -
getValue
-
setValue
-
setValue
-
setValue
设置图片图片宽度与高度通过
DrawContext.mm(int)} 方法转换为毫米- Parameters:
imgPath- 图片路径,仅支持png、jpg、jpeg、gif、bmp格式- Returns:
- this
- Throws:
IOException- 图片加载异常
-
getColor
-
setColor
-
getFontName
-
setFontName
-
setFont
-
getFontSize
public double getFontSize()获取字号- Returns:
- 字号,默认:0.353 (单位:毫米)
-
setFontSize
-
getTextAlign
-
setTextAlign
-
getVerticalAlign
获取 文字垂直方向浮动方式- Returns:
- 文字垂直方向浮动方式,默认:居中
VerticalAlign.center
-
setVerticalAlign
设置 文字垂直方向浮动方式- Parameters:
verticalAlign- 文字垂直方向浮动方式- Returns:
- this
-
getLineSpace
-
setLineSpace
-
getBlob
-
setBlob
Deprecated.单词错误getBold()设置 是否加粗- Parameters:
blob- 是否加粗- Returns:
- this
-
getBold
-
setBold
-
getItalic
-
setItalic
-
getLetterSpacing
-
setLetterSpacing
-
setUnderline
设置是否开启下划线- Parameters:
underline- true - 启下划线,false - 禁用下划线- Returns:
- this
-
getUnderline
public boolean getUnderline()获取是否开启下划线- Returns:
- true - 启下划线,false - 不启用下划线
-
setDeleteLine
设置是否开启删除线- Parameters:
deleteLine- true - 启删除线,false - 禁用删除线- Returns:
- this
-
getDeleteLine
public boolean getDeleteLine()获取是否开启删除线- Returns:
- true - 启删除线,false - 禁用删除线
-
getImgPath
-
getImgWidth
public double getImgWidth()获取图片高度- Returns:
- 图片高度,可能为0。
-
getImgHeight
public double getImgHeight()获取图片宽度- Returns:
- 图片宽度,可能为0。
-
getFontWeight
获取字体宽度- Returns:
- 字体宽度,遵循 CSS3标准,可选值为 normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900
-
setFontWeight
-
getBold()是否加粗