Class CanvasBase
java.lang.Object
org.ofdrw.layout.element.Div<Canvas>
org.ofdrw.layout.element.canvas.Canvas
org.ofdrw.layout.element.canvas.CanvasBase
- All Implemented Interfaces:
Drawer, ElementSplit, RenderPrepare
Canvas扩展基类,用于快速构建基于Canvas扩展的自定义元素。
通过CanvasBase类,可以简化Canvas的创建过程,实现者需要实现 Drawer 接口,
并在Drawer.draw(DrawContext) 实现自定义的绘制逻辑。
一个最简单扩展示例可参考 Line。
- Since:
- 2024-6-5 18:45:49
- Author:
- 权观宇
-
Constructor Summary
ConstructorsConstructorDescriptionCanvasBase(double x, double y, double w, double h) CanvasBase(Double width, Double height) CanvasBase(PageLayout style) -
Method Summary
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()doubleMethods inherited from class Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Constructor Details
-
CanvasBase
-
CanvasBase
public CanvasBase(double x, double y, double w, double h) -
CanvasBase
-