Class CanvasElementHandler
Constructors
(constructor)(_viewer, _selection, _dndHandler, _rotateHandler, config)
Constructs a new instance of the CanvasElementHandler class
Declaration
constructor(_viewer: Viewer, _selection: SelectionHandler, _dndHandler: DragNDropHandler, _rotateHandler: RotateHandler, config: ICanvasElementHandlerConfiguration);
Parameters
Properties
addChild
Declaration
addChild: (element: HTMLElement) => void;
Property Value
| Type |
Description |
| (element: HTMLElement) => void |
|
offset
Declaration
get offset(): PointF;
set offset(value: PointF);
Property Value
staticTextCanvas
Declaration
staticTextCanvas: HTMLCanvasElement;
Property Value
| Type |
Description |
| HTMLCanvasElement |
|
textEditorDiv
Declaration
get textEditorDiv(): HTMLElement;
Property Value
| Type |
Description |
| HTMLElement |
|
textEditorInnerDiv
Declaration
get textEditorInnerDiv(): HTMLElement;
Property Value
| Type |
Description |
| HTMLElement |
|
viewportActiveCanvas
Declaration
get viewportActiveCanvas(): HTMLCanvasElement;
Property Value
| Type |
Description |
| HTMLCanvasElement |
|
viewportActiveTextCanvas
Declaration
get viewportActiveTextCanvas(): HTMLCanvasElement;
Property Value
| Type |
Description |
| HTMLCanvasElement |
|
viewportCursorCanvas
Declaration
get viewportCursorCanvas(): HTMLCanvasElement;
Property Value
| Type |
Description |
| HTMLCanvasElement |
|
viewportDesignCanvas
Declaration
get viewportDesignCanvas(): HTMLCanvasElement;
Property Value
| Type |
Description |
| HTMLCanvasElement |
|
viewportInactiveCanvas
Declaration
get viewportInactiveCanvas(): HTMLCanvasElement;
Property Value
| Type |
Description |
| HTMLCanvasElement |
|
viewportMemoryCanvas
Declaration
get viewportMemoryCanvas(): HTMLCanvasElement;
Property Value
| Type |
Description |
| HTMLCanvasElement |
|
viewportSelectionCanvas
Declaration
get viewportSelectionCanvas(): HTMLCanvasElement;
Property Value
| Type |
Description |
| HTMLCanvasElement |
|
viewportSurfaceCanvas
Declaration
get viewportSurfaceCanvas(): HTMLCanvasElement;
Property Value
| Type |
Description |
| HTMLCanvasElement |
|
viewportTextureCanvas
Declaration
get viewportTextureCanvas(): HTMLCanvasElement;
Property Value
| Type |
Description |
| HTMLCanvasElement |
|
Methods
addElement(parent, whitespace, width, height)
Declaration
addElement(parent: HTMLElement, whitespace: HTMLElement, width: number, height: number): void;
Parameters
| Type |
Name |
Description |
| HTMLElement |
parent |
|
| HTMLElement |
whitespace |
|
| number |
width |
|
| number |
height |
|
Returns
Declaration
addPlaceholderButtonGroup(placeholder: PlaceholderItemHandler, viewer: Viewer): void;
Parameters
Returns
addStyles()
Declaration
Returns
addTextEditorStyles(css)
Declaration
addTextEditorStyles(css: string): void;
Parameters
| Type |
Name |
Description |
| string |
css |
|
Returns
addViewport(viewport)
Declaration
addViewport(viewport: HTMLDivElement): void;
Parameters
| Type |
Name |
Description |
| HTMLDivElement |
viewport |
|
Returns
addViolationContainer(itemHandler, viewer)
Declaration
addViolationContainer(itemHandler: BaseRectangleItemHandler, viewer: Viewer): void;
Parameters
Returns
calculateRenderStateForItemHandlers(layers)
Declaration
calculateRenderStateForItemHandlers(layers: LayerCollection): boolean;
Parameters
Returns
changeTextEditorDivOutlineColor(toRed)
Declaration
changeTextEditorDivOutlineColor(toRed: boolean): void;
Parameters
| Type |
Name |
Description |
| boolean |
toRed |
|
Returns
createCanvas(size)
Declaration
createCanvas(size: Size): HTMLCanvasElement;
Parameters
| Type |
Name |
Description |
| Size |
size |
|
Returns
| Type |
Description |
| HTMLCanvasElement |
|
getControlRectangle(rectangle, viewer)
Declaration
static getControlRectangle(rectangle: RotatedRectangleF, viewer: Viewer): RectangleF;
Parameters
Returns
getTextEditorFormattedText()
Declaration
getTextEditorFormattedText(): string;
Returns
hideDnd()
Declaration
Returns
hideElement(element, withoutAnimation)
Declaration
static hideElement(element: HTMLElement, withoutAnimation?: boolean): void;
Parameters
| Type |
Name |
Description |
| HTMLElement |
element |
|
| boolean |
withoutAnimation |
|
Returns
hideTextEditor()
Declaration
Returns
moveActiveTextCanvasBack()
Declaration
moveActiveTextCanvasBack(): void;
Returns
moveActiveTextCanvasOnTop()
Declaration
moveActiveTextCanvasOnTop(): void;
Returns
removeChilds(element)
Declaration
removeChilds(element: HTMLElement): void;
Parameters
| Type |
Name |
Description |
| HTMLElement |
element |
|
Returns
removeElement()
Declaration
Returns
Declaration
removePlaceholderButtonGroup(placeholder: PlaceholderItemHandler): void;
Parameters
Returns
removeViewport()
Declaration
Returns
removeViolationContainer(handler)
Declaration
removeViolationContainer(handler: BaseRectangleItemHandler): void;
Parameters
Returns
replaceStaticTextCanvas()
Declaration
replaceStaticTextCanvas(): HTMLCanvasElement;
Returns
| Type |
Description |
| HTMLCanvasElement |
|
rotateRectangle(rectangle, viewer)
Declaration
static rotateRectangle(rectangle: RotatedRectangleF, viewer: Viewer): RotatedRectangleF;
Parameters
Returns
setConf(conf)
Declaration
setConf(conf: ICanvasElementHandlerConfiguration): void;
Parameters
Returns
setElementSize(element, width, height, fullUpdate)
Declaration
static setElementSize(element: HTMLCanvasElement, width: number, height: number, fullUpdate?: boolean): void;
Parameters
| Type |
Name |
Description |
| HTMLCanvasElement |
element |
|
| number |
width |
|
| number |
height |
|
| boolean |
fullUpdate |
|
Returns
showDnd(point, image, angle)
Declaration
showDnd(point: PointF, image: HTMLImageElement, angle: number): void;
Parameters
| Type |
Name |
Description |
| PointF |
point |
|
| HTMLImageElement |
image |
|
| number |
angle |
|
Returns
showElement(element, withoutAnimation)
Declaration
static showElement(element: HTMLElement, withoutAnimation?: boolean): void;
Parameters
| Type |
Name |
Description |
| HTMLElement |
element |
|
| boolean |
withoutAnimation |
|
Returns
showTextEditor(rectangle, textAlignment, html, borderWidth, borderColor, fillColor, opacity, textVerticalAlignment, isVertical)
Declaration
showTextEditor(rectangle: RotatedRectangleF, textAlignment: TextAlignment, html: string, borderWidth: number, borderColor: string, fillColor: string, opacity: number, textVerticalAlignment: TextVerticalAlignment, isVertical: boolean): void;
Parameters
Returns
Declaration
updatePlaceholderButtonGroup(placeholder: PlaceholderItemHandler, viewer: Viewer): void;
Parameters
Returns
Declaration
updatePlaceholderButtonGroupPosition(placeholder: PlaceholderItemHandler, viewer: Viewer): void;
Parameters
Returns
updateViewport()
Declaration
Returns
updateViolationContainer(itemHandler, updatePosition, viewer)
Declaration
updateViolationContainer(itemHandler: BaseRectangleItemHandler, updatePosition: boolean, viewer: Viewer): void;
Parameters
Returns
updateViolationContainerPosition(itemHandler, viewer)
Declaration
updateViolationContainerPosition(itemHandler: BaseRectangleItemHandler, viewer: Viewer): void;
Parameters
Returns