Class Line
java.lang.Object
org.ofdrw.layout.element.Div<Canvas>
org.ofdrw.layout.element.canvas.Canvas
org.ofdrw.layout.element.canvas.CanvasBase
org.ofdrw.layout.element.canvas.Line
- All Implemented Interfaces:
Drawer, ElementSplit, RenderPrepare
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddraw(DrawContext ctx) 线条绘制器double[]获取线的起始点double[]获取线的结束点获取线的颜色double获取线的透明度double获取线的宽度setBeginPoint(double[] beginPoint) 设置线的起始点setBeginPoint(double beginX, double beginY) 设置线的起始点setEndPoint(double[] endPoint) 设置线的结束点setEndPoint(double endX, double endY) 设置线的结束点setLineColor(String lineColor) 设置线的颜色setLineOpacity(double lineOpacity) 设置线的透明度setLineWidth(double lineWidth) 设置线的宽度Methods inherited from class Canvas
doPrepare, elementType, getDrawer, getPreferBlock, setDrawer, setPreferBlockModifier and TypeMethodDescriptionCanvas 不接受宽度重设获取元素类型org.ofdrw.core.basicStructure.pageObj.layer.block.CT_PageBlock获取 优先使用的页面块在进入渲染器之前可以对Canvas的绘制进行重设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
-
Line
-
Line
public Line(double x, double y, double w, double h) 线对象- Parameters:
x- 画线区域左上角的x坐标,单位:毫米mmy- 画线区域左上角的y坐标,单位:毫米mmw- 画线区域的宽度,单位:毫米mmh- 画线区域高度,单位:毫米mm
-
-
Method Details
-
getBeginPoint
public double[] getBeginPoint()获取线的起始点- Returns:
- 线的起始点坐标 [x, y],可能为NULL。
-
setBeginPoint
设置线的起始点- Parameters:
beginPoint- 线的起始点在画布上的坐标 [x, y]- Returns:
- this
-
setBeginPoint
设置线的起始点- Parameters:
beginX- 线的起始点在画布上的x坐标,单位:毫米mmbeginY- 线的起始点在画布上的y坐标,单位:毫米mm- Returns:
- this
-
getEndPoint
public double[] getEndPoint()获取线的结束点- Returns:
- 线的结束点坐标 [x, y],可能为NULL。
-
setEndPoint
设置线的结束点- Parameters:
endPoint- 线的结束点在画布上的坐标 [x, y]- Returns:
- this
-
setEndPoint
设置线的结束点- Parameters:
endX- 线的结束点在画布上的x坐标,单位:毫米mmendY- 线的结束点在画布上的y坐标,单位:毫米mm- Returns:
- this
-
getLineColor
-
setLineColor
-
getLineWidth
public double getLineWidth()获取线的宽度- Returns:
- 线的宽度
-
setLineWidth
设置线的宽度- Parameters:
lineWidth- 线的宽度,单位 毫米mm- Returns:
- this
-
getLineOpacity
public double getLineOpacity()获取线的透明度- Returns:
- 线的透明度 [0,1]
-
setLineOpacity
设置线的透明度- Parameters:
lineOpacity- 线的透明度,范围 [0,1]- Returns:
- this
-
draw
线条绘制器- Parameters:
ctx- 绘制上下文- Throws:
IOException- 绘制异常
-