Home Manual Reference Source
import {Editor} from 'myscript/src/Editor.js'
public class | source

Editor

Editor

Constructor Summary

Public Constructor
public

constructor(element: Element, configuration: Configuration, penStyle: PenStyle, theme: Theme, behaviors: Behaviors)

Member Summary

Public Members
public get

Get current behavior

public get

Get behaviors

public get

Get current callbacks

public get

True if can clear, false otherwise.

public get

True if can convert, false otherwise.

public get

True if can export, false otherwise.

public get

True if can redo, false otherwise.

public get

True if can undo, false otherwise.

public get

Get the current recognition parameters

public set

configuration(configuration: Configuration): *

Set the recognition parameters WARNING : Need to fire a clear if user have already input some strokes.

public

Inner reference to the DOM Element

public

error: *

public

Launch export timer

public get

Get current state exports

public get

Get current grabber

public

Current grabber context

public get

True if idle state

public get

True if initialized, false otherwise

public

loader: *

public

Current model

public

Notify delay timer

public set

penStyle(penStyle: PenStyle): *

Set the pen style

public get

Get the pen style

public get

png: String: *

Get a PNG image data url from the data model

public get

Get current recognizer

public

Current recognition context

public get

Get current renderer

public

Current rendering context

public

Launch resize timer

public get

Get current stroker

public set

theme(theme: Theme): *

Set the theme

public get

theme: Theme: *

Get the theme

public
public

Method Summary

Public Methods
public

clear()

Clear the output and the recognition result.

public

Convert the current content

public

Explicitly ask to perform an export.

public

Get statistics to monitor what ink size is send to the server.

public

importContent(point: {x: Number, y: Number}, data: Blob | *, mimetype: String)

Import content.

public

importInk(strokes: Array<Stroke>)

Import ink

public

pointerDown(point: {x: Number, y: Number, t: Number}, pointerType: String, pointerId: String)

Handle a pointer down

public

pointerMove(point: {x: Number, y: Number, t: Number})

Handle a pointer move

public

pointerUp(point: {x: Number, y: Number, t: Number})

Handle a pointer up

public

redo()

Redo the last action.

public

resize()

Function to call when the dom element link to the current ink paper has been resize.

public

undo()

Undo the last action.

public

Wait for idle state.

Public Constructors

public constructor(element: Element, configuration: Configuration, penStyle: PenStyle, theme: Theme, behaviors: Behaviors) source

Params:

NameTypeAttributeDescription
element Element

DOM element to attach this editor

configuration Configuration
  • optional

Configuration to apply

penStyle PenStyle
  • optional

Custom style to apply

theme Theme
  • optional

Custom theme to apply

behaviors Behaviors
  • optional

Custom behaviors to apply

Public Members

public get behavior: Behavior: * source

Get current behavior

Return:

Behavior

public get behaviors: Behaviors: * source

Get behaviors

Return:

Behaviors

public get callbacks: Array: * source

Get current callbacks

Return:

Array

public get canClear: Boolean: * source

True if can clear, false otherwise.

Return:

Boolean

public get canConvert: Boolean: * source

True if can convert, false otherwise.

Return:

Boolean

public get canExport: Boolean: * source

True if can export, false otherwise.

Return:

Boolean

public get canRedo: Boolean: * source

True if can redo, false otherwise.

Return:

Boolean

public get canUndo: Boolean: * source

True if can undo, false otherwise.

Return:

Boolean

public get configuration: Configuration: * source

Get the current recognition parameters

Return:

Configuration

public set configuration(configuration: Configuration): * source

Set the recognition parameters WARNING : Need to fire a clear if user have already input some strokes.

public domElement: Element source

Inner reference to the DOM Element

public error: * source

public exportTimer: Number source

Launch export timer

public get exports: Object: * source

Get current state exports

Return:

Object

public get grabber: Grabber: * source

Get current grabber

Return:

Grabber

public grabberContext: GrabberContext source

Current grabber context

public get idle: Boolean: * source

True if idle state

Return:

Boolean

public get initialized: Boolean: * source

True if initialized, false otherwise

Return:

Boolean

public loader: * source

public model: Model source

Current model

public notifyTimer: Number source

Notify delay timer

public set penStyle(penStyle: PenStyle): * source

Set the pen style

public get penStyle: PenStyle: * source

Get the pen style

Return:

PenStyle

public get png: String: * source

Get a PNG image data url from the data model

Return:

String

public get recognizer: Recognizer: * source

Get current recognizer

Return:

Recognizer

public recognizerContext: RecognizerContext source

Current recognition context

public get renderer: Renderer: * source

Get current renderer

Return:

Renderer

public rendererContext: Object source

Current rendering context

public resizeTimer: Number source

Launch resize timer

public get stroker: Stroker: * source

Get current stroker

Return:

Stroker

public set theme(theme: Theme): * source

Set the theme

public get theme: Theme: * source

Get the theme

Return:

Theme

public undoRedoContext: * source

public undoRedoManager: * source

Public Methods

public clear() source

Clear the output and the recognition result.

public convert() source

Convert the current content

public exportContent() source

Explicitly ask to perform an export.

public getStats(): Stats source

Get statistics to monitor what ink size is send to the server.

Return:

Stats

public importContent(point: {x: Number, y: Number}, data: Blob | *, mimetype: String) source

Import content.

Params:

NameTypeAttributeDescription
point {x: Number, y: Number}

Insert point coordinates

data Blob | *

Data to import

mimetype String
  • optional

Mimetype of the data, needed if data is not a Blob

public importInk(strokes: Array<Stroke>) source

Import ink

Params:

NameTypeAttributeDescription
strokes Array<Stroke>

public pointerDown(point: {x: Number, y: Number, t: Number}, pointerType: String, pointerId: String) source

Handle a pointer down

Params:

NameTypeAttributeDescription
point {x: Number, y: Number, t: Number}

Captured point coordinates

pointerType String
  • optional
  • default: mouse

Current pointer type

pointerId String
  • optional

Current pointer id

public pointerMove(point: {x: Number, y: Number, t: Number}) source

Handle a pointer move

Params:

NameTypeAttributeDescription
point {x: Number, y: Number, t: Number}

Captured point coordinates

public pointerUp(point: {x: Number, y: Number, t: Number}) source

Handle a pointer up

Params:

NameTypeAttributeDescription
point {x: Number, y: Number, t: Number}

Captured point coordinates

public redo() source

Redo the last action.

public resize() source

Function to call when the dom element link to the current ink paper has been resize.

public undo() source

Undo the last action.

public waitForIdle() source

Wait for idle state.