Class: CreateAnnotationState
@ghentcdh/vue-component-annotated-text / CreateAnnotationState
Class: CreateAnnotationState
Defined in: state/states/CreateAnnotationState.ts:11
Class holding the state of an annotation being created
Constructors
Constructor
new CreateAnnotationState(
userState
):CreateAnnotationState
Defined in: state/states/CreateAnnotationState.ts:18
Parameters
userState
Returns
CreateAnnotationState
Properties
annotation
annotation:
AnnotationInternal
Defined in: state/states/CreateAnnotationState.ts:14
creating
creating:
boolean
Defined in: state/states/CreateAnnotationState.ts:15
newEnd
newEnd:
number
Defined in: state/states/CreateAnnotationState.ts:12
newStart
newStart:
number
Defined in: state/states/CreateAnnotationState.ts:13
userState
userState:
UserState
Defined in: state/states/CreateAnnotationState.ts:16
Methods
getAnnotation()
getAnnotation():
AnnotationInternal
Defined in: state/states/CreateAnnotationState.ts:78
Returns
AnnotationInternal
init()
init(
annotation
):void
Defined in: state/states/CreateAnnotationState.ts:57
Parameters
annotation
Partial
<AnnotationInternal
> = {}
Returns
void
initAnnotation()
initAnnotation(
annotation
):void
Defined in: state/states/CreateAnnotationState.ts:51
Initialise the annotation to be created.
Parameters
annotation
AnnotationInternal
annotation object that the application can pass to use as default init value.
Returns
void
resetCreating()
resetCreating():
void
Defined in: state/states/CreateAnnotationState.ts:26
resets to the initial state
Returns
void
startCreating()
startCreating(
start
):void
Defined in: state/states/CreateAnnotationState.ts:40
start creating an annotation
Parameters
start
number
position where the creation starts. The end position will not be able to be before this starting position.
Returns
void
updateCreating()
updateCreating():
void
Defined in: state/states/CreateAnnotationState.ts:73
Has to be called every time the mouse moves a character when creating an annotation. If the application does not listen to onMove updates the component will do this automatically.
Returns
void