LEADTOOLS JavaScript Object Module

Summary

The LEADTOOLS JavaScript libraries use an object module similar to the Microsoft .NET or Java object class library.

The following members are available in each LEADTOOLS type In addition to the other properties and methods described in the members page.

Type refers to the LEADTOOLS type, such as lt.Controls.ImageViewer. All the functions listed below are "static" methods that must be called directly on the type itself and not an instance of the type.

Type.prototype

[Type].registerNamespace(name)

Registers a new LEADTOOLS namespace

Parameters

name: String containing the fully qualified name of the namespace. Must not be omitted or null

Returns

Example

Refer to the sample source code at the end of this document.

[Type].registerClass(name, baseType, interfaceType)

Registers a new LEADTOOLS class type

Parameters

name: String containing the fully qualified type name (namespace.name). Must not be omitted or null

baseType: Base type. Can be omitted or null if the class does not derive from a LEADTOOLS base class.

interfaceType: Interface type implemented by the class.  Can be omitted or null if the class does not implement a LEADTOOLS interface

Returns

Example

Refer to the sample source code at the end of this document.

[Type].registerInterface(name)

Registers a new LEADTOOLS class type

Parameters

name: String containing the fully qualified namespace name. Must not be omitted or null

Returns

[Type].registerEnum(name)

Registers a new LEADTOOLS enumeration

Parameters

name: String containing the fully qualified enumeration name. Must not be omitted or null

flags: true if the members of this enumuration can be OR'ed together, otherwise; false. Treated as false if omitted or null

Returns

[Type].initializeBase(instance, args)

Initializes the base class of a LEADTOOLS derived class from the constructor

Parameters

instance: The derived class instance. In almost all cases, this can be set to 'this'. Must not be omitted or null

args: An array containing the arguments to pass to the base class. Can be mitted or null if the base class constructor does not required other arguments.

If you derive a new class from a LEADTOOLS class, then you must call this method in your constructor to initialize the base class.

Returns

Example

Refer to the sample source code at the end of this document.

[Type].callBaseMethod(instance, name, args)

Calls a function from the base class of a LEADTOOLS derived class

Parameters

instance: The derived class instance. In almost all cases, this can be set to 'this'. Must not be omitted or null

name: String containing the name of the function to call. Must not be omitted or null

args: An array containing the arguments to pass to the base class method. Can be omitted or null if the base class constructor does not have arguments.

Returns

The return value from the base method (if any)

Example

Refer to the sample source code at the end of this document.

[Type].get_baseType()

Gets the base type of this type

Parameters

None

Returns

The base type.

Example

// This will show 'lt.Controls.ImageViewerInteractiveMode' since ImageViewerPanZoomInteractiveMode // derives from ImageViewerInteractiveMode

alert(lt.Controls.ImageViewerPanZoomInteractiveMode.get_baseType().get_fullName());

[Type].get_fullName()

Returns the full name (namespace.name) of this type

Parameters

None

Returns

The fully qualified name of the type

Example

// This will show 'lt.Controls.ImageViewerPanZoomInteractiveMode'

alert(lt.Controls.ImageViewerPanZoomInteractiveMode.get_fullName());

[Type].get_name()

Returns the name of this type

Parameters

None

Returns

The fully qualified name of the type

Example

// This will show 'ImageViewerPanZoomInteractiveMode'

alert(lt.Controls.ImageViewerPanZoomInteractiveMode.get_name());

[Type].prototype.isInstanceOfType(instance)

Determines if the specified object is an instance of this class or one of its derived classes

Parameters

Instance: object instance to check.

Returns

True if the specified object is an instance of this class or one of its derived classes, otherwise; false.

Example

var instance = new lt.Controls.ImageViewerPanZoomInteractiveMode();

// This will show true, same type

alert(lt.Controls.ImageViewerPanZoomInteractiveMode.isInstanceOfType(instance));

// This will show true, derived type

alert(lt.Controls.ImageViewerInteractiveMode.isInstanceOfType(instance));

instance = new lt.LeadPointD();

// This will show false 

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS HTML5 JavaScript