public abstract class AbstractComponent extends AbstractBase implements Component, Closeable
Copyright (c) 2020 xsx All Rights Reserved. x-easypdf-pdfbox is licensed under Mulan PSL v2. You can use this software according to the terms and conditions of the Mulan PSL v2. You may obtain a copy of Mulan PSL v2 at: http://license.coscl.org.cn/MulanPSL2 THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. See the Mulan PSL v2 for more details.
Modifier and Type | Field and Description |
---|---|
protected Float |
beginX
自定义起始X轴坐标
|
protected Float |
beginY
自定义起始Y轴坐标
|
protected BorderConfiguration |
borderConfiguration
边框配置
|
protected HorizontalAlignment |
horizontalAlignment
水平对齐方式
|
protected Boolean |
isBreak
是否分页
|
protected Boolean |
isCustomPosition
是否自定义坐标
|
protected Boolean |
isWrap
是否换行
|
protected MarginConfiguration |
marginConfiguration
边距配置
|
protected PagingCondition |
pagingCondition
自定义分页条件
|
protected LinkedHashSet<PagingEvent> |
pagingEvents
分页事件列表
|
protected Float |
relativeBeginX
X轴相对坐标(不影响后续坐标)
|
protected Float |
relativeBeginY
Y轴相对坐标(不影响后续坐标)
|
protected VerticalAlignment |
verticalAlignment
垂直对齐方式
|
contentMode, context, isResetContentStream, log
Modifier | Constructor and Description |
---|---|
protected |
AbstractComponent()
无参构造
|
|
AbstractComponent(Page page)
有参构造
|
Modifier and Type | Method and Description |
---|---|
void |
addPagingEvent(PagingEvent event)
添加分页事件
|
protected boolean |
checkPaging()
检查分页
|
protected boolean |
checkPaging(Component component,
float beginY)
检查分页
|
protected boolean |
checkPaging(float beginY)
检查分页
|
protected void |
checkWrap(float wrapHeight)
检查换行
|
void |
close()
关闭
|
protected Page |
executeBreak()
执行分页
|
AbstractBase |
getBase()
获取基类
|
Color |
getBorderBottomColor()
获取下边框颜色
|
Float |
getBorderDottedSpacing()
获取边框点线间隔
|
Color |
getBorderLeftColor()
获取左边框颜色
|
LineCapStyle |
getBorderLineCapStyle()
获取线帽样式
|
Float |
getBorderLineLength()
获取边框线长
|
LineStyle |
getBorderLineStyle()
获取边框样式
|
Float |
getBorderLineWidth()
获取边框线宽
|
Color |
getBorderRightColor()
获取右边框颜色
|
Color |
getBorderTopColor()
获取上边框颜色
|
float |
getBottom()
获取下边距
|
Boolean |
getIsBorderBottom()
获取是否下边框
|
Boolean |
getIsBorderLeft()
获取是否左边框
|
Boolean |
getIsBorderRight()
获取是否右边框
|
Boolean |
getIsBorderTop()
获取是否上边框
|
Float |
getMarginBottom()
获取下边距
|
Float |
getMarginLeft()
获取左边距
|
Float |
getMarginRight()
获取右边距
|
Float |
getMarginTop()
获取上边距
|
protected abstract float |
getMinWidth()
获取最小宽度
|
Page |
getPage()
获取页面
|
protected void |
init()
初始化
|
protected void |
initBeginX(float width)
初始化起始X轴坐标
|
protected void |
initBeginXY(float width,
float height)
初始化起始XY轴坐标
|
protected void |
initBeginY(float height)
初始化起始Y轴坐标
|
protected void |
initBeginYForPaging(float height)
初始化起始Y轴坐标
|
protected boolean |
isNeedWrap()
是否需要换行
|
protected boolean |
isPaging(Component component,
float beginY)
是否分页
|
protected boolean |
isPagingComponent()
是否分页组件
|
protected boolean |
isWrap()
是否换行
|
protected void |
processBreak()
处理分页
|
void |
render()
渲染
|
protected abstract void |
reset()
重置
|
protected void |
reset(ComponentType type,
float x,
float y)
重置
|
protected void |
resetXY()
重置起始XY轴坐标
|
void |
setBeginX(Float x)
设置自定义起始X轴坐标
|
protected void |
setBeginX(Float x,
Boolean isCustomPosition)
设置自定义起始X轴坐标
|
void |
setBeginY(Float y)
设置自定义起始Y轴坐标
|
protected void |
setBeginY(Float y,
Boolean isCustomPosition)
设置自定义起始Y轴坐标
|
void |
setBorderBottomColor(Color color)
设置下边框颜色
|
void |
setBorderColor(Color color)
设置边框颜色(上下左右)
|
void |
setBorderDottedSpacing(float spacing)
设置边框点线间隔
|
void |
setBorderLeftColor(Color color)
设置左边框颜色
|
void |
setBorderLineCapStyle(LineCapStyle style)
设置线帽样式
|
void |
setBorderLineLength(float length)
设置边框线长
|
void |
setBorderLineStyle(LineStyle style)
设置边框样式
|
void |
setBorderLineWidth(float width)
设置边框线宽
|
void |
setBorderRightColor(boolean flag)
设置是否上边框
|
void |
setBorderRightColor(Color color)
设置右边框颜色
|
void |
setBorderTopColor(Color color)
设置上边框颜色
|
void |
setIsBorder(boolean flag)
设置是否边框(上下左右)
|
void |
setIsBorderBottom(boolean flag)
设置是否下边框
|
void |
setIsBorderLeft(boolean flag)
设置是否左边框
|
void |
setIsBorderRight(boolean flag)
设置是否右边框
|
void |
setIsBorderTop(boolean flag)
设置是否上边框
|
void |
setMargin(float margin)
设置边距(上下左右)
|
void |
setMarginBottom(float margin)
设置下边距
|
void |
setMarginLeft(float margin)
设置左边距
|
void |
setMarginRight(float margin)
设置右边距
|
void |
setMarginTop(float margin)
设置上边距
|
void |
virtualRender()
虚拟渲染
|
protected void |
wrap(float wrapHeight)
换行
|
protected abstract void |
writeContents()
写入内容
|
init, init
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getContext, getPagingCondition, getPagingEvents, getType, setHorizontalAlignment, setVerticalAlignment
protected MarginConfiguration marginConfiguration
protected BorderConfiguration borderConfiguration
protected LinkedHashSet<PagingEvent> pagingEvents
protected PagingCondition pagingCondition
protected Float beginX
protected Float beginY
protected Float relativeBeginX
protected Float relativeBeginY
protected Boolean isWrap
protected Boolean isBreak
protected Boolean isCustomPosition
protected HorizontalAlignment horizontalAlignment
protected VerticalAlignment verticalAlignment
protected AbstractComponent()
public AbstractComponent(Page page)
page
- 页面protected abstract float getMinWidth()
protected abstract void writeContents()
protected abstract void reset()
public void setBeginX(Float x)
public void setBeginY(Float y)
public void setMargin(float margin)
margin
- 边距public void setBorderColor(Color color)
color
- 颜色public void setIsBorder(boolean flag)
flag
- 是否边框public Float getMarginTop()
public void setMarginTop(float margin)
margin
- 边距public Float getMarginBottom()
public void setMarginBottom(float margin)
margin
- 边距public Float getMarginLeft()
public void setMarginLeft(float margin)
margin
- 边距public Float getMarginRight()
public void setMarginRight(float margin)
margin
- 边距public LineStyle getBorderLineStyle()
public void setBorderLineStyle(LineStyle style)
style
- 样式public LineCapStyle getBorderLineCapStyle()
public void setBorderLineCapStyle(LineCapStyle style)
style
- 样式public Float getBorderLineLength()
public void setBorderLineLength(float length)
length
- 线长public Float getBorderLineWidth()
public void setBorderLineWidth(float width)
width
- 线宽public Float getBorderDottedSpacing()
public void setBorderDottedSpacing(float spacing)
spacing
- 间隔public Color getBorderTopColor()
public void setBorderTopColor(Color color)
color
- 颜色public Color getBorderBottomColor()
public void setBorderBottomColor(Color color)
color
- 颜色public Color getBorderLeftColor()
public void setBorderLeftColor(Color color)
color
- 颜色public Color getBorderRightColor()
public void setBorderRightColor(Color color)
color
- 颜色public void setBorderRightColor(boolean flag)
flag
- 是否上边框public Boolean getIsBorderTop()
public void setIsBorderTop(boolean flag)
flag
- 是否上边框public Boolean getIsBorderBottom()
public void setIsBorderBottom(boolean flag)
flag
- 是否下边框public Boolean getIsBorderLeft()
public void setIsBorderLeft(boolean flag)
flag
- 是否左边框public Boolean getIsBorderRight()
public void setIsBorderRight(boolean flag)
flag
- 是否右边框public AbstractBase getBase()
public Page getPage()
public float getBottom()
public void addPagingEvent(PagingEvent event)
event
- 事件public void virtualRender()
virtualRender
in interface Component
public void close()
close
in interface Closeable
close
in interface AutoCloseable
protected void init()
protected void initBeginX(float width)
width
- 宽度protected void initBeginY(float height)
height
- 高度protected void initBeginYForPaging(float height)
height
- 高度protected void initBeginXY(float width, float height)
width
- 宽度height
- 高度protected void checkWrap(float wrapHeight)
protected void wrap(float wrapHeight)
wrapHeight
- 换行高度protected boolean isWrap()
protected boolean isNeedWrap()
protected boolean isPaging(Component component, float beginY)
component
- 当前组件beginY
- Y轴起始坐标protected boolean checkPaging()
protected boolean checkPaging(Component component, float beginY)
component
- 组件beginY
- Y轴起始坐标protected boolean checkPaging(float beginY)
beginY
- Y轴起始坐标protected boolean isPagingComponent()
protected void processBreak()
protected Page executeBreak()
protected void reset(ComponentType type, float x, float y)
type
- 类型x
- x轴坐标y
- y轴坐标protected void resetXY()
protected void setBeginX(Float x, Boolean isCustomPosition)
x
- 起始X轴坐标isCustomPosition
- 是否自定义坐标Copyright © 2024. All rights reserved.