-
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.
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 Magnifierstring Magnifier Use the magnifier mouse tool type to display a magnifying glass on left click and drag.
SelectToZoomstring SelectToZoom Use the select to zoom mouse tool type to select an area of the page to zoom in on.
Panstring Pan Use the pan mouse tool type to drag the image up, down, left, or right.
PanAndEditstring 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.
SelectTextstring SelectText Use the select text mouse tool type to select text in the document.
EditMarksstring 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.
LineAnnotationstring LineAnnotation Use the line annotation tool mouse tool type to draw a line annotation.
RectangleAnnotationstring RectangleAnnotation Use the rectangle annotation mouse tool type to draw a rectangle annotation.
EllipseAnnotationstring EllipseAnnotation Use the ellipse annotation mouse tool type to draw an ellipse annotation.
TextAnnotationstring TextAnnotation Use the text annotation mouse tool type to draw a text annotation.
StampAnnotationstring StampAnnotation Use the stamp annotation mouse tool type to draw a stamp annotation.
HighlightAnnotationstring HighlightAnnotation Use the highlight annotation mouse tool type to select text and create a highlight annotation.
FreehandAnnotationstring FreehandAnnotation Use the freehand annotation tool mouse tool type to draw a freehand annotation.
RectangleRedactionstring RectangleRedaction Use the rectangle redaction mouse tool type to draw a rectangle redaction.
TransparentRectangleRedactionstring TransparentRectangleRedaction Use the transparent rectangle redaction mouse tool type to draw a transparent rectangle redaction.
TextRedactionstring TextRedaction Use the text redaction mouse tool type to draw a text redaction.
StampRedactionstring StampRedaction Use the stamp redaction mouse tool type to draw a stamp redaction.
PlaceSignaturestring PlaceSignature Use to click on the document and place a signature in that location.
TextSelectionRedactionstring TextSelectionRedaction Use the TextSelectionRedaction mouse tool type to select text and create a text selection redaction.
ImageStampAnnotationstring ImageStampAnnotation Use the ImageStampAnnotation mouse tool type to place ImageStamp annotation.
ImageStampRedactionstring ImageStampRedaction Use the ImageStampAnnotation mouse tool type to place ImageStamp 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
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:
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:
-
- PCCViewer.MouseTool.Type for a list of possible mouse tool types.
- PCCViewer.MouseTool#getType
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.
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:
-
- PCCViewer.MouseTool.Type for a list of possible mouse tool types.
- PCCViewer.MouseTool#type
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: ... }