Class: AnnotationUITool

OSDPaperjsAnnotation.AnnotationUITool(paperScope)

Base class for annotation tools, extending the ToolBase class.

Constructor

new AnnotationUITool(paperScope)

Create an AnnotationUITool instance.
Parameters:
Name Type Description
paperScope paper.PaperScope The Paper.js scope for the tool.
Properties:
Name Type Description
_active boolean Flag indicating if the tool is currently active.
_items Array.<paper.Item> Array of selected items.
_item paper.Item The selected item (if only one is selected).
_itemToCreate paper.Item The selected new item to be created.
Source:

Extends

  • ToolBase

Classes

AnnotationUIToolbarBase

Members

item

Get the currently selected item, if only one is selected.
Source:

itemToCreate

Get the selected new item to be created.
Source:

items

Get the array of currently selected items.
Source:

Methods

activate()

Activate the annotation tool, making it ready for interaction. If another tool was active, it's deactivated before activating this tool.
Source:

deactivate(finishToolAction)

Deactivate the annotation tool, stopping its interaction.
Parameters:
Name Type Description
finishToolAction boolean Whether the tool action should be completed before deactivating.
Source:

getSelectedItems()

Retrieve the list of currently selected items.
Source:

getToolbarControl() → {AnnotationUIToolbarBase}

Get the associated toolbar control for the tool.
Source:
Returns:
The toolbar control instance.
Type
AnnotationUIToolbarBase

onSelectionChanged()

Callback function triggered when the selection changes. To be implemented in subclasses.
Source:

raiseCanvasZIndex()

Raise the viewer canvas's z-index so that toolbars don't interfere
Source:

refreshItems()

Refresh the list of currently selected items.
Source:

resetCanvasZIndex()

Return the viewer canvas to its original z-index
Source:

selectionChanged()

Callback function triggered when the selection of items changes. This function can be overridden in subclasses to react to selection changes.
Source:

setToolbarControl(toolbarControl) → {AnnotationUIToolbarBase}

Set the associated toolbar control for the tool.
Parameters:
Name Type Description
toolbarControl AnnotationUIToolbarBase The toolbar control instance to set.
Source:
Returns:
The provided toolbar control instance.
Type
AnnotationUIToolbarBase