Class Paragraph
- All Implemented Interfaces:
ElementSplit, RenderPrepare
段落
绘制行为详见渲染器:ParagraphRender
- Since:
- 2020-02-03 01:27:20
- Author:
- 权观宇
-
Constructor Summary
ConstructorsConstructorDescription创建一个段落对象Paragraph(double x, double y, double width, double height) 创建绝对定位段落对象创建绝对定位段落对象创建一个固定大小段落对象新建一个段落对象新建一个段落对象,并指定文字大小新建一个段落对象,并指定文字大小和字体新建一个段落对象,并指定字体 -
Method Summary
Modifier and TypeMethodDescription增加段落中的文字加入带有特殊样式文字内容清除缩进格式clone()请勿调用该方法克隆段落,除非你知道你在干什么contentSplitAdjust(double sHeight, T div1, T div2) 内容分割调整预布局元素类型获取首行缩进字符数获取首行缩进数值getLines()获取段落内字体浮动setContents(List<Span> contents) setDefaultFont(Font defaultFont) setDefaultFont(Font defaultFont, boolean refreshBeforeAdd) 设置默认字体setFirstLineIndent(Integer firstLineIndent) 设置段落首行缩进setFirstLineIndentWidth(double firstLineIndentWidth) 设置段落首行缩进数值setFontSize(Double defaultFontSize) 设置段落内默认的字体大小setFontSize(Double defaultFontSize, boolean refreshBeforeAdd) 设置段落内默认的字体大小setLineSpace(Double lineSpace) setTextAlign(TextAlign textAlign) 设置段落内字体浮动Methods inherited from class Div
box, 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()获取模型区域大小<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
-
Paragraph
-
Paragraph
public Paragraph()创建一个段落对象注意如果不主动对 Paragraph 设置宽度,那么Paragraph 会独占整个段,并且与段具有相同宽度,也就是页面宽度, 在需要更加细致盒式的布局时 请设置
Div.setClear(Clear)并设置段落宽度Div.setWidth(Double)。 -
Paragraph
public Paragraph(double x, double y, double width, double height) 创建绝对定位段落对象- Parameters:
x- 固定布局的盒式模型左上角X坐标y- 固定布局的盒式模型左上角y坐标width- 宽度height- 高度
-
Paragraph
创建绝对定位段落对象- Parameters:
x- 固定布局的盒式模型左上角X坐标y- 固定布局的盒式模型左上角y坐标width- 宽度height- 高度text- 文本内容fontSize- 字号
-
Paragraph
新建一个段落对象如果在指定段落中文字大小建议使用
Paragraph(java.lang.String, java.lang.Double)- Parameters:
text- 文字内容
-
Paragraph
-
Paragraph
-
Paragraph
-
-
Method Details
-
add
-
add
-
getLineSpace
-
setLineSpace
-
getDefaultFont
-
setDefaultFont
-
setDefaultFont
-
getFontSize
-
setFontSize
-
setFontSize
-
getContents
-
setContents
-
getLines
-
getFirstLineIndent
-
setFirstLineIndent
-
getFirstLineIndentWidth
获取首行缩进数值该方法仅在已经设置了首行缩进数值的情况下才会返还正确的数值,否则返还null
- Returns:
- 首行缩进数值或null
-
setFirstLineIndentWidth
设置段落首行缩进数值- Parameters:
firstLineIndentWidth- 首行缩进数值(单位:mm)- Returns:
- this
-
clearFirstLineIndent
-
setTextAlign
-
getTextAlign
-
doPrepare
-
contentSplitAdjust
Description copied from class:Div内容分割调整根据分割高度调整两个克隆元素,达成分割元素的效果
- Overrides:
contentSplitAdjustin classDiv<Paragraph>- Type Parameters:
T- Div子类泛型参数- Parameters:
sHeight- 分割内容的高度div1- 克隆元素1div2- 克隆元素2- Returns:
- 分割调整后的两个Div
-
clone
-
elementType
元素类型关联渲染器:
ParagraphRender- Overrides:
elementTypein classDiv<Paragraph>- Returns:
- Paragraph
-