Back to Website
Show / Hide Table of Contents

Class CanvasElementHandler

Package: @aurigma/design-atoms

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
Type Name Description
Viewer _viewer
SelectionHandler _selection
DragNDropHandler _dndHandler
RotateHandler _rotateHandler
ICanvasElementHandlerConfiguration config

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
Type Description
PointF

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
Type Description
void

addPlaceholderButtonGroup(placeholder, viewer)

Declaration
addPlaceholderButtonGroup(placeholder: PlaceholderItemHandler, viewer: Viewer): void;
Parameters
Type Name Description
PlaceholderItemHandler placeholder
Viewer viewer
Returns
Type Description
void

addStyles()

Declaration
addStyles(): void;
Returns
Type Description
void

addTextEditorStyles(css)

Declaration
addTextEditorStyles(css: string): void;
Parameters
Type Name Description
string css
Returns
Type Description
void

addViewport(viewport)

Declaration
addViewport(viewport: HTMLDivElement): void;
Parameters
Type Name Description
HTMLDivElement viewport
Returns
Type Description
void

addViolationContainer(itemHandler, viewer)

Declaration
addViolationContainer(itemHandler: BaseRectangleItemHandler, viewer: Viewer): void;
Parameters
Type Name Description
BaseRectangleItemHandler itemHandler
Viewer viewer
Returns
Type Description
void

calculateRenderStateForItemHandlers(layers)

Declaration
calculateRenderStateForItemHandlers(layers: LayerCollection): boolean;
Parameters
Type Name Description
LayerCollection layers
Returns
Type Description
boolean

changeTextEditorDivOutlineColor(toRed)

Declaration
changeTextEditorDivOutlineColor(toRed: boolean): void;
Parameters
Type Name Description
boolean toRed
Returns
Type Description
void

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
Type Name Description
RotatedRectangleF rectangle
Viewer viewer
Returns
Type Description
RectangleF

getTextEditorFormattedText()

Declaration
getTextEditorFormattedText(): string;
Returns
Type Description
string

hideDnd()

Declaration
hideDnd(): void;
Returns
Type Description
void

hideElement(element, withoutAnimation)

Declaration
static hideElement(element: HTMLElement, withoutAnimation?: boolean): void;
Parameters
Type Name Description
HTMLElement element
boolean withoutAnimation
Returns
Type Description
void

hideTextEditor()

Declaration
hideTextEditor(): void;
Returns
Type Description
void

moveActiveTextCanvasBack()

Declaration
moveActiveTextCanvasBack(): void;
Returns
Type Description
void

moveActiveTextCanvasOnTop()

Declaration
moveActiveTextCanvasOnTop(): void;
Returns
Type Description
void

removeChilds(element)

Declaration
removeChilds(element: HTMLElement): void;
Parameters
Type Name Description
HTMLElement element
Returns
Type Description
void

removeElement()

Declaration
removeElement(): void;
Returns
Type Description
void

removePlaceholderButtonGroup(placeholder)

Declaration
removePlaceholderButtonGroup(placeholder: PlaceholderItemHandler): void;
Parameters
Type Name Description
PlaceholderItemHandler placeholder
Returns
Type Description
void

removeViewport()

Declaration
removeViewport(): void;
Returns
Type Description
void

removeViolationContainer(handler)

Declaration
removeViolationContainer(handler: BaseRectangleItemHandler): void;
Parameters
Type Name Description
BaseRectangleItemHandler handler
Returns
Type Description
void

replaceStaticTextCanvas()

Declaration
replaceStaticTextCanvas(): HTMLCanvasElement;
Returns
Type Description
HTMLCanvasElement

rotateRectangle(rectangle, viewer)

Declaration
static rotateRectangle(rectangle: RotatedRectangleF, viewer: Viewer): RotatedRectangleF;
Parameters
Type Name Description
RotatedRectangleF rectangle
Viewer viewer
Returns
Type Description
RotatedRectangleF

setConf(conf)

Declaration
setConf(conf: ICanvasElementHandlerConfiguration): void;
Parameters
Type Name Description
ICanvasElementHandlerConfiguration conf
Returns
Type Description
void

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
Type Description
void

showDnd(point, image, angle)

Declaration
showDnd(point: PointF, image: HTMLImageElement, angle: number): void;
Parameters
Type Name Description
PointF point
HTMLImageElement image
number angle
Returns
Type Description
void

showElement(element, withoutAnimation)

Declaration
static showElement(element: HTMLElement, withoutAnimation?: boolean): void;
Parameters
Type Name Description
HTMLElement element
boolean withoutAnimation
Returns
Type Description
void

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
Type Name Description
RotatedRectangleF rectangle
TextAlignment textAlignment
string html
number borderWidth
string borderColor
string fillColor
number opacity
TextVerticalAlignment textVerticalAlignment
boolean isVertical
Returns
Type Description
void

updatePlaceholderButtonGroup(placeholder, viewer)

Declaration
updatePlaceholderButtonGroup(placeholder: PlaceholderItemHandler, viewer: Viewer): void;
Parameters
Type Name Description
PlaceholderItemHandler placeholder
Viewer viewer
Returns
Type Description
void

updatePlaceholderButtonGroupPosition(placeholder, viewer)

Declaration
updatePlaceholderButtonGroupPosition(placeholder: PlaceholderItemHandler, viewer: Viewer): void;
Parameters
Type Name Description
PlaceholderItemHandler placeholder
Viewer viewer
Returns
Type Description
void

updateViewport()

Declaration
updateViewport(): void;
Returns
Type Description
void

updateViolationContainer(itemHandler, updatePosition, viewer)

Declaration
updateViolationContainer(itemHandler: BaseRectangleItemHandler, updatePosition: boolean, viewer: Viewer): void;
Parameters
Type Name Description
BaseRectangleItemHandler itemHandler
boolean updatePosition
Viewer viewer
Returns
Type Description
void

updateViolationContainerPosition(itemHandler, viewer)

Declaration
updateViolationContainerPosition(itemHandler: BaseRectangleItemHandler, viewer: Viewer): void;
Parameters
Type Name Description
BaseRectangleItemHandler itemHandler
Viewer viewer
Returns
Type Description
void
Was this page helpful?
Thanks for your feedback!
Back to top Copyright © 2001–2025 Aurigma, Inc. All rights reserved.
Loading...
    Thank for your vote
    Your opinion is important to us. To provide details, send feedback.
    Send feedback