Constructor
new DrawController(groupopt)
Name | Type | Attributes | Description |
---|---|---|---|
group | AnnotationGroup | <optional> | Optional annotation group. |
- Source
Classes
Methods
addAnnotation(annotation)
Add an annotation.
Name | Type | Description |
---|---|---|
annotation | Annotation | The annotation to add. |
- Source
getAnnotation(id) → {Annotation|undefined}
Get an annotation.
Name | Type | Description |
---|---|---|
id | string | The annotation id. |
- Source
The annotation.
- Type:
- Annotation |
undefined
getAnnotationGroup() → {AnnotationGroup}
Get the annotation group.
- Source
The list.
- Type:
- AnnotationGroup
hasAnnotationMeta(key) → {boolean}
Check if the annotation group contains a meta data value.
Name | Type | Description |
---|---|---|
key | string | The key to check. |
True if the meta data is present.
- Type:
- boolean
isAnnotationGroupEditable() → {boolean}
Check if the annotation group is editable.
- Source
True if editable.
- Type:
- boolean
removeAllAnnotationsWithCommand(exeCallback)
Remove all annotations via remove commands (triggers draw actions).
Name | Type | Description |
---|---|---|
exeCallback | function | The undo stack callback. |
removeAnnotation(id)
Remove an anotation for the list.
Name | Type | Description |
---|---|---|
id | string | The id of the annotation to remove. |
- Source
removeAnnotationWithCommand(id, exeCallback)
Remove an annotation via a remove command (triggers draw actions).
Name | Type | Description |
---|---|---|
id | string | The annotation id. |
exeCallback | function | The undo stack callback. |
- Source
setAnnotationGroupEditable(flag)
Set the annotation group editability.
Name | Type | Description |
---|---|---|
flag | boolean | True to make the annotation group editable. |
- Source
setAnnotationMeta(key, value)
Set an annotation meta data.
Name | Type | Description |
---|---|---|
key | string | The meta data to set. |
value | string | The value of the meta data. |
updateAnnotation(annotation, propKeysopt)
Update an anotation from the list.
Name | Type | Attributes | Description |
---|---|---|---|
annotation | Annotation | The annotation to update. | |
propKeys | Array.<string> | <optional> | Optional properties that got updated. |
- Source
updateAnnotationWithCommand(id, originalProps, newProps, exeCallback)
Update an annotation via an update command (triggers draw actions).
Name | Type | Description |
---|---|---|
id | string | The annotation id. |
originalProps | object | The original annotation properties that will be updated. |
newProps | object | The new annotation properties that will replace the original ones. |
exeCallback | function | The undo stack callback. |