Class gui.AnnotationViewManager
Defined in: AnnotationViewManager.js.
Constructor Attributes | Constructor Name and Description |
---|---|
gui.AnnotationViewManager(canvas, odfFragment, annotationsPane, showAnnotationRemoveButton)
A GUI class for wrapping Annotation nodes inside html wrappers, positioning
them on the sidebar, drawing connectors, and highlighting comments.
|
Method Attributes | Method Name and Description |
---|---|
<inner> |
addAnnotations(annotationElements)
Adds annotations to track, and wraps and highlights them
|
<inner> |
forgetAnnotation(annotation)
Unhighlights, unwraps, and ejects an annotation from the tracking
|
<inner> |
Untracks, unwraps, and unhighlights all annotations
|
<inner> |
Reports the minimum height in pixels needed to display all
annotation notes in the annotation pane.
|
<inner> |
highlightAnnotation(annotation)
Highlights the text between the annotation node and it's end
Only highlights text that has not already been highlighted
|
<inner> |
isNodeWithinAnnotationHighlight(node, annotationName)
Returns true if the given node is within the highlighted range of
the given annotation, else returns false.
|
<inner> |
lineDistance(point1, point2)
|
<inner> |
Re-highlights the annotations' spans.
|
<inner> |
renderAnnotation(annotation)
Recalculates the positions, widths, and rotation angles of things like the annotation note and it's
connectors.
|
<inner> |
Recalculates the rendering - positions, rotation angles for connectors,
etc - for all tracked annotations.
|
<inner> |
showAnnotationsPane(show)
Show or hide annotations pane
|
<inner> |
Sorts the internal annotations array by order of occurence in the document.
|
<inner> |
unhighlightAnnotation(annotation)
Unhighlights the text between the annotation node and it's end
|
<inner> |
unwrapAnnotation(annotation)
Unwraps an annotation
|
<inner> |
wrapAnnotation(annotation)
Wraps an annotation with various HTML elements for styling, including connectors
|
Class Detail
gui.AnnotationViewManager(canvas, odfFragment, annotationsPane, showAnnotationRemoveButton)
A GUI class for wrapping Annotation nodes inside html wrappers, positioning
them on the sidebar, drawing connectors, and highlighting comments.
- Parameters:
- {!gui.AnnotatableCanvas} canvas
- {!Element} odfFragment
- {!Element} annotationsPane
- {!boolean} showAnnotationRemoveButton
Method Detail
<inner>
{undefined}
addAnnotations(annotationElements)
Adds annotations to track, and wraps and highlights them
- Parameters:
- {!Array.} annotationElements
- Returns:
- {undefined}
<inner>
{undefined}
forgetAnnotation(annotation)
Unhighlights, unwraps, and ejects an annotation from the tracking
- Parameters:
- {!odf.AnnotationElement} annotation
- Returns:
- {undefined}
<inner>
{undefined}
forgetAnnotations()
Untracks, unwraps, and unhighlights all annotations
- Returns:
- {undefined}
<inner>
{?string}
getMinimumHeightForAnnotationPane()
Reports the minimum height in pixels needed to display all
annotation notes in the annotation pane.
If there is no pane shown or are no annotations, null is returned.
- Returns:
- {?string}
<inner>
{undefined}
highlightAnnotation(annotation)
Highlights the text between the annotation node and it's end
Only highlights text that has not already been highlighted
- Parameters:
- {!odf.AnnotationElement} annotation
- Returns:
- {undefined}
<inner>
{!boolean}
isNodeWithinAnnotationHighlight(node, annotationName)
Returns true if the given node is within the highlighted range of
the given annotation, else returns false.
- Parameters:
- {!Node} node
- {!string} annotationName
- Returns:
- {!boolean}
<inner>
{number}
lineDistance(point1, point2)
- Parameters:
- {!{x:number|y:number}} point1
- {!{x:number|y:number}} point2
- Returns:
- {number}
<inner>
{undefined}
rehighlightAnnotations()
Re-highlights the annotations' spans. To be used when a span is broken by, say,
splitting a paragraph.
- Returns:
- {undefined}
<inner>
{undefined}
renderAnnotation(annotation)
Recalculates the positions, widths, and rotation angles of things like the annotation note and it's
connectors. Can and should be called frequently to update the UI
- Parameters:
- {!odf.AnnotationElement} annotation
- Returns:
- {undefined}
<inner>
{undefined}
rerenderAnnotations()
Recalculates the rendering - positions, rotation angles for connectors,
etc - for all tracked annotations.
- Returns:
- {undefined}
<inner>
{undefined}
showAnnotationsPane(show)
Show or hide annotations pane
- Parameters:
- {!boolean} show
- Returns:
- {undefined}
<inner>
{undefined}
sortAnnotations()
Sorts the internal annotations array by order of occurence in the document.
Useful for calculating the order of annotations in the sidebar, and positioning them
accordingly
- Returns:
- {undefined}
<inner>
{undefined}
unhighlightAnnotation(annotation)
Unhighlights the text between the annotation node and it's end
- Parameters:
- {!odf.AnnotationElement} annotation
- Returns:
- {undefined}
<inner>
{undefined}
unwrapAnnotation(annotation)
Unwraps an annotation
- Parameters:
- {!odf.AnnotationElement} annotation
- Returns:
- {undefined}
<inner>
{undefined}
wrapAnnotation(annotation)
Wraps an annotation with various HTML elements for styling, including connectors
- Parameters:
- {!odf.AnnotationElement} annotation
- Returns:
- {undefined}