DrawController

Draw controller.

Constructor

new DrawController(groupopt)

Parameters:
NameTypeAttributesDescription
groupAnnotationGroup<optional>

Optional annotation group.

Classes

DrawController

Methods

addAnnotation(annotation)

Add an annotation.

Parameters:
NameTypeDescription
annotationAnnotation

The annotation to add.

getAnnotation(id) → {Annotation|undefined}

Get an annotation.

Parameters:
NameTypeDescription
idstring

The annotation id.

Returns:

The annotation.

Type: 
Annotation | undefined

getAnnotationGroup() → {AnnotationGroup}

Get the annotation group.

Returns:

The list.

Type: 
AnnotationGroup

hasAnnotationMeta(key) → {boolean}

Check if the annotation group contains a meta data value.

Parameters:
NameTypeDescription
keystring

The key to check.

Returns:

True if the meta data is present.

Type: 
boolean

isAnnotationGroupEditable() → {boolean}

Check if the annotation group is editable.

Returns:

True if editable.

Type: 
boolean

removeAllAnnotationsWithCommand(exeCallback)

Remove all annotations via remove commands (triggers draw actions).

Parameters:
NameTypeDescription
exeCallbackfunction

The undo stack callback.

removeAnnotation(id)

Remove an anotation for the list.

Parameters:
NameTypeDescription
idstring

The id of the annotation to remove.

removeAnnotationWithCommand(id, exeCallback)

Remove an annotation via a remove command (triggers draw actions).

Parameters:
NameTypeDescription
idstring

The annotation id.

exeCallbackfunction

The undo stack callback.

setAnnotationGroupEditable(flag)

Set the annotation group editability.

Parameters:
NameTypeDescription
flagboolean

True to make the annotation group editable.

setAnnotationMeta(key, value)

Set an annotation meta data.

Parameters:
NameTypeDescription
keystring

The meta data to set.

valuestring

The value of the meta data.

updateAnnotation(annotation, propKeysopt)

Update an anotation from the list.

Parameters:
NameTypeAttributesDescription
annotationAnnotation

The annotation to update.

propKeysArray.<string><optional>

Optional properties that got updated.

updateAnnotationWithCommand(id, originalProps, newProps, exeCallback)

Update an annotation via an update command (triggers draw actions).

Parameters:
NameTypeDescription
idstring

The annotation id.

originalPropsobject

The original annotation properties that will be updated.

newPropsobject

The new annotation properties that will replace the original ones.

exeCallbackfunction

The undo stack callback.