Class: AnnotationToolbar

OSDPaperjsAnnotation.AnnotationToolbar(paperScope, toolsopt)

A class for creating and managing annotation toolbars

Constructor

new AnnotationToolbar(paperScope, toolsopt)

Constructs an AnnotationToolbar instance.
Parameters:
Name Type Attributes Description
paperScope Object The Paper.js scope object.
tools Array <optional>
An array of tool names or constructors to use. If not provided, all available tools will be used.
Properties:
Name Type Description
ui Object The UI object.
paperScope Object The Paper.js scope object.
currentMode null | Array.<string> The current mode.
setModeTimeout null | number The set mode timeout.
toolLayer Object The tool layer.
toolConstructors ToolConstructors An object containing tool constructors.
tools Object.<string, ToolObject> An object containing tool instances.
Source:
Throws:
Throws an error if `tools` is provided but is not an array.
Type
Error

Members

toolConstructors

Properties:
Name Type Description
default DefaultTool The default tool constructor.
select SelectTool The select tool constructor.
transform TransformTool The transform tool constructor.
style StyleTool The style tool constructor.
rectangle RectangleTool The rectangle tool constructor.
ellipse EllipseTool The ellipse tool constructor.
point PointTool The point tool constructor.
text PointTextTool The point text tool constructor.
polygon PolygonTool The polygon tool constructor.
brush BrushTool The brush tool constructor.
wand WandTool The wand tool constructor.
linestring LinestringTool The linestring tool constructor.
raster RasterTool The raster tool constructor.
Source:

Methods

addToolbarControl(toolbarControl)

Adds a toolbar control to the Annotation Toolbar.
Parameters:
Name Type Description
toolbarControl Object The toolbar control to be added.
Source:
Throws:
Throws an error if the toolbar control's button element is not found.
Type
Error

destroy()

Destroys the Annotation Toolbar.
Source:

hide()

Hides the Annotation Toolbar.
Source:

setMode()

Sets the mode of the toolbar based on the currently selected items in the project. Individual tools will be enabled and disabled by this. If the currently active tool is not supported for the selected item(s) it will be deactivated.
Source:

show()

Shows the Annotation Toolbar.
Source: