Inherits from UIView
Declared in DIWDiagramView.h

Overview

The DIWDiagramView is the entry point of the Diagram Widget.

Properties

backgroundView

Background view of the writing area.

@property (strong, nonatomic) UIView *backgroundView

Discussion

The view is automatically resized to match the size of the Diagram Widget View.

The default background view is a UIImageView displaying a graph paper pattern. You can set this property to nil to remove the background.

Declared In

DIWDiagramView.h

delegate

The receiver’s delegate or nil if it doesn’t have a delegate.

@property (assign, nonatomic) id<DIWDiagramViewDelegate> delegate

Discussion

See DIWDiagramViewDelegate for the methods this delegate can implement.

Declared In

DIWDiagramView.h

enablePrompter

Enables/Disables the prompter

@property (assign, nonatomic) BOOL enablePrompter

Declared In

DIWDiagramView.h

hasSelection

Indicate whether some shapes are selected or not

@property (assign, nonatomic, readonly) BOOL hasSelection

Return Value

true if an item of the diagram is selected, false if not.

Declared In

DIWDiagramView.h

isEmpty

Returns a Boolean value that indicates whether the widget is empty or not.

@property (assign, nonatomic, readonly) BOOL isEmpty

Return Value

YES if widget content is empty.

Declared In

DIWDiagramView.h

palmRejectionEnabled

A Boolean value that determines whether the Diagram Widget should ignore unwanted touches caused by the user palm.

@property (assign, nonatomic) BOOL palmRejectionEnabled

Discussion

The default value of this property is YES.

Declared In

DIWDiagramView.h

palmRejectionLeftHanded

A Boolean value that determines whether the Diagram Rejection should be configured for left handed users.

@property (assign, nonatomic) BOOL palmRejectionLeftHanded

Discussion

The default value of this property is NO.

Declared In

DIWDiagramView.h

styleSheet

Path of the current stylesheet

@property (strong, nonatomic) NSString *styleSheet

Declared In

DIWDiagramView.h

tool

Allows to change the current writing tool of the widget (ie Pen/Eraser)

@property (assign, nonatomic) DIWDiagramTool tool

Declared In

DIWDiagramView.h

writingStyle

Style of the pen

@property (strong, nonatomic) NSString *writingStyle

Declared In

DIWDiagramView.h

Instance Methods

addSearchDir:

Add given directory to handwriting resources search path. Directory name can point to a folder in the file system, or to a directory in a zip file.

- (void)addSearchDir:(NSString *)directoryName

Parameters

directoryName

Path to a folder containing handwriting resources.

Declared In

DIWDiagramView.h

addStroke:

Adds a stroke to the MyScript document model

- (void)addStroke:(NSArray<DIWCaptureInfo*> *)points

Parameters

points

an NSArray of DIWCaptureInfo constituting the path of the stroke

Declared In

DIWDiagramView.h

beautify

Launch beautification of handwritten ink

- (void)beautify

Declared In

DIWDiagramView.h

beautifySelection

Beautify selected items

- (void)beautifySelection

Declared In

DIWDiagramView.h

canRedo

Returns a Boolean value that indicates whether the Diagram Widget has any actions to redo.

- (BOOL)canRedo

Return Value

YES if the Diagram Widget has any actions to redo, otherwise NO.

Declared In

DIWDiagramView.h

canUndo

Returns a Boolean value that indicates whether the Diagram Widget has any actions to undo.

- (BOOL)canUndo

Return Value

YES if the Diagram Widget has any actions to undo, otherwise NO.

Declared In

DIWDiagramView.h

clear

Clears all primitives & constraints.

- (void)clear

Declared In

DIWDiagramView.h

clearSearchPath

Clear handwriting resources search path.

- (void)clearSearchPath

Declared In

DIWDiagramView.h

clearSelection

Erase the selected diagram items

- (void)clearSelection

Declared In

DIWDiagramView.h

clearUndoStack

Clear the undo stack

- (void)clearUndoStack

Declared In

DIWDiagramView.h

configureWithBundle:config:extendedConf:

Configure handwriting recognition engine. This method is non-blocking and returns immediately.

- (void)configureWithBundle:(NSString *)bundleName config:(NSString *)configName extendedConf:(NSString *)extendedConf

Parameters

bundleName

Name of the configuration bundle (for example, “shape”).

configName

Name of the configuration mode (for example, “standard”).

extendedConf

Extended configuration (for example, change number of candidates).

Discussion

Configuration is a lengthy process that may take up to several seconds, depending on the handwriting resources to be configured. It is recommended to setup a configuration listener to detect the end of the configuration process.

Declared In

DIWDiagramView.h

exportAsGraphML

Get the recognition result as GraphML.

- (NSString *)exportAsGraphML

Return Value

GraphML description of the diagram.

Declared In

DIWDiagramView.h

exportAsImage

Get the diagram drawing as an image.

- (UIImage *)exportAsImage

Return Value

A UIImage similar to what is is displayed by the Geometrys Widget.

Declared In

DIWDiagramView.h

exportAsSVG

Get the recognition result as SVG.

- (NSString *)exportAsSVG

Return Value

SVG description of the diagram.

Declared In

DIWDiagramView.h

penAbort

Simulate a pen abort event. This simulates a user writing.

- (void)penAbort

Declared In

DIWDiagramView.h

penDown:

Simulate a pen down event. This simulates a user that starts writing.

- (void)penDown:(DIWCaptureInfo *)captureInfo

Parameters

captureInfo

Capture information.

Declared In

DIWDiagramView.h

penMove:

Simulate a pen move event. This simulates a user writing.

- (void)penMove:(DIWCaptureInfo *)captureInfo

Parameters

captureInfo

Capture information.

Declared In

DIWDiagramView.h

penUp:

Simulate a pen up event. This simulates a user that ends writing.

- (void)penUp:(DIWCaptureInfo *)captureInfo

Parameters

captureInfo

Capture information.

Declared In

DIWDiagramView.h

recognize

Launch recognition of handwritten ink

- (void)recognize

Declared In

DIWDiagramView.h

redo

Performs one redo step.

- (void)redo

Declared In

DIWDiagramView.h

registerCertificate:

Register MyScript engine certificate.

- (BOOL)registerCertificate:(NSData *)certificate

Parameters

certificate

The data object containing the certificate.

Return Value

YES if the certificate is registered, NO on failure or if a certificate is already registered.

Declared In

DIWDiagramView.h

serialize

Serialize the current input.

- (NSData *)serialize

Return Value

A data object containing the serialized equation.

Discussion

This method can be used to save an equation as binary data.

Declared In

DIWDiagramView.h

undo

Performs one undo step.

- (void)undo

Declared In

DIWDiagramView.h

unserialize:

Restore an input saved using the serialize method.

- (BOOL)unserialize:(NSData *)data

Parameters

data

The data to unserialize, provided by serialize.

Return Value

YES if the data was properly unserialized, NO otherwise.

Discussion

This method can be used to restore an equation from binary data.

Declared In

DIWDiagramView.h