Prizm Content Connect
Class: MouseTool

Class: MouseTool

PCCViewer. MouseTool

This object represents an instance of a mouse tool. Each mouse tool is given a name and type when it is created. The name is used as a handle to the mouse tool. The type defines the behavior and properties of the mouse tool.

A named mouse tool is a global tool that is available to all viewers. Each viewer instance can access the same MouseTool object by name. This permits one mouse tool to be used by two different viewer instances at the same time.

new MouseTool()

The MouseTool constructor is for internal use only. The appropriate way to create and register a new named mouse tool is to use the method PCCViewer.MouseTools.createMouseTool.

See:
Throws:

If the type is unknown. See PCCViewer.MouseTool.Type for a list of known tool types.

Type
RangeError
Example
// use the PCCViewer.MouseTools.createMouseTool(name, type) 
// function instead of this constructor.
PCCViewer.MouseTools.createMouseTool("myMouseTool", "LineAnnotation");

Members

<static, readonly> Type :string

This enumerable contains a list of all known tool types. There are used to create new PCCViewer.MouseTool objects, and are the known types returned PCCViewer.MouseTool#getType.

Type:
  • string
Properties:
Name Type Default Description
Magnifier string Magnifier

Use the magnifier mouse tool type to display a magnifying glass on left click and drag.

SelectToZoom string SelectToZoom

Use the select to zoom mouse tool type to select an area of the page to zoom in on.

Pan string Pan

Use the pan mouse tool type to drag the image up, down, left, or right.

PanAndEdit string PanAndEdit

Use the mouse or touch to drag the image up, down, left, or right. When clicking or touching over an annotation, the annotation will be selected, edited, moved, or resized, based on user actions.

SelectText string SelectText

Use the select text mouse tool type to select text in the document.

EditMarks string EditMarks

Use the edit marks mouse tool type to select one or more marks (annotations and redactions) in the document. A mark can be clicked on for editing, or a rectangle can be drawn to select multiple marks.

LineAnnotation string LineAnnotation

Use the line annotation tool mouse tool type to draw a line annotation.

RectangleAnnotation string RectangleAnnotation

Use the rectangle annotation mouse tool type to draw a rectangle annotation.

EllipseAnnotation string EllipseAnnotation

Use the ellipse annotation mouse tool type to draw an ellipse annotation.

TextAnnotation string TextAnnotation

Use the text annotation mouse tool type to draw a text annotation.

StampAnnotation string StampAnnotation

Use the stamp annotation mouse tool type to draw a stamp annotation.

HighlightAnnotation string HighlightAnnotation

Use the highlight annotation mouse tool type to select text and create a highlight annotation.

FreehandAnnotation string FreehandAnnotation

Use the freehand annotation tool mouse tool type to draw a freehand annotation.

RectangleRedaction string RectangleRedaction

Use the rectangle redaction mouse tool type to draw a rectangle redaction.

TransparentRectangleRedaction string TransparentRectangleRedaction

Use the transparent rectangle redaction mouse tool type to draw a transparent rectangle redaction.

TextRedaction string TextRedaction

Use the text redaction mouse tool type to draw a text redaction.

StampRedaction string StampRedaction

Use the stamp redaction mouse tool type to draw a stamp redaction.

PlaceSignature string PlaceSignature

Use to click on the document and place a signature in that location.

TextSelectionRedaction string TextSelectionRedaction

Use the TextSelectionRedaction mouse tool type to select text and create a text selection redaction.

name :string

Gets the name of the mouse tool.

This is an ECMA 5 accessor property that is defined only in browsers supporting ECMA 5. This property is not available in the older browsers like IE8. For the greatest browser compatibility, use the corresponding getter method PCCViewer.MouseTool#getName.

Type:
  • string
See:
Example
// get the mouse tool's name
var mouseToolName = myMouseTool.name;

// do something with the name
alert("Mouse tool name is " + mouseToolName);

templateMark :PCCViewer.Mark

Gets the template mark associated with an annotation or redaction mouse tool.

This property is defined on MouseTool objects that are annotation or redaction types: LineAnnotation, RectangleAnnotation, EllipseAnnotation, TextAnnotation, StampAnnotation, HighlightAnnotation, RectangleRedaction, TransparentRectangleRedaction, TextRedaction, StampRedaction.

This is an ECMA 5 accessor property that is defined only in browsers supporting ECMA 5. This property is not available in the older browsers like IE8. For the greatest browser compatibility, use the corresponding getter method PCCViewer.MouseTool#getTemplateMark.

Type:
See:
Example
var myMouseTool = PCCViewer.MouseTools.getMouseTool(mouseToolName);

// Check if templateMark is a property in the MouseTool object
if (templateMark in myMouseTool) {
    // get the template mark
    var templateMark = myMouseTool.templateMark;

    // Do something with the template mark. For example, set the color.
    if (templateMark.setColor) {
        templateMark.setColor("#FF0000");
    }
}

type :string

Gets the type of the mouse tool.

This is an ECMA 5 accessor property that is defined only in browsers supporting ECMA 5. This property is not available in the older browsers like IE8. For the greatest browser compatibility, use the corresponding getter method PCCViewer.MouseTool#getType.

Type:
  • string
See:
Example
var myMouseTool = PCCViewer.MouseTools.getMouseTool(mouseToolName);

// get the mouse tool's type
var mouseToolType = myMouseTool.type;

// do something with the type
switch (mouseToolType) {
    case PCCViewer.MouseTool.Type.LineAnnotation:
        ...
        break;
    default:
        ...
}

Methods

getName() → {string}

Gets the name of the mouse tool.

See:
Returns:

The name of the mouse tool.

Type
string
Example
// get the mouse tool's name
var mouseToolName = myMouseTool.getName();

// do something with the name
alert("Mouse tool name is " + mouseToolName);

getTemplateMark() → {PCCViewer.Mark}

Gets the template mark associated with an annotation or redaction mouse tool.

This method is defined on MouseTool objects that are annotation or redaction types: LineAnnotation, RectangleAnnotation, EllipseAnnotation, TextAnnotation, StampAnnotation, HighlightAnnotation, RectangleRedaction, TransparentRectangleRedaction, TextRedaction, StampRedaction.

Returns:

The template mark for the mouse tool.

Type
PCCViewer.Mark
Example
var myMouseTool = PCCViewer.MouseTools.getMouseTool(mouseToolName);

// Check if getTemplateMark is defined
if (myMouseTool.getTemplateMark) {
    // get the template mark
    var templateMark = myMouseTool.getTemplateMark();

    // Do something with the template mark. For example, set the color.
    if (templateMark.setColor) {
        templateMark.setColor("#FF0000");
    }
}

getType() → {string}

Gets the type of the mouse tool.

See:
Returns:

The type of the mouse tool.

Type
string
Example
var myMouseTool = PCCViewer.MouseTools.getMouseTool(mouseToolName);

// get the mouse tool's type
var mouseToolType = myMouseTool.getType();

// do something with the type
switch (mouseToolType) {
    case PCCViewer.MouseTool.Type.LineAnnotation:
        ...
        break;
    default:
        ...
}

 

 


©2014. Accusoft Corporation. All Rights Reserved.

Send Feedback