blockly > comments > RenderedWorkspaceComment
comments.RenderedWorkspaceComment class
Signature:
export declare class RenderedWorkspaceComment extends WorkspaceComment implements IBoundedElement, IRenderedElement, IDraggable, ISelectable, IDeletable, ICopyable<WorkspaceCommentCopyData>, IContextMenu
Extends: WorkspaceComment
Implements: IBoundedElement, IRenderedElement, IDraggable, ISelectable, IDeletable, ICopyable<WorkspaceCommentCopyData>, IContextMenu
Constructors
Constructor | Modifiers | Description |
---|---|---|
(constructor)(workspace, id) | Constructs the workspace comment, including the view. |
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
workspace | readonly |
WorkspaceSvg |
Methods
Method | Modifiers | Description |
---|---|---|
dispose() | Disposes of the view. | |
drag(newLoc) | Drags the comment to the given location. | |
endDrag() | Ends the drag on the comment. | |
getBoundingRectangle() | Returns the bounding rectangle of this comment in workspace coordinates. Respects collapsing. | |
getSize() | Returns the comment's size in workspace units. Does not respect collapsing. | |
getSvgRoot() | Returns the root SVG element of this comment. | |
isMovable() | Returns whether this comment is movable or not. | |
moveBy(dx, dy, reason) | Move the comment by the given amounts in workspace coordinates. | |
moveTo(location, reason) | Moves the comment to the given location in workspace coordinates. | |
revertDrag() | Moves the comment back to where it was at the start of a drag. | |
select() | Visually highlights the comment. | |
setCollapsed(collapsed) | Sets whether the comment is collapsed or not. | |
setDeleteStyle(wouldDelete) | Visually indicates that this comment would be deleted if dropped. | |
setEditable(editable) | Sets whether the comment is editable or not. | |
setSize(size) | Sets the size of the comment. | |
setText(text) | Sets the text of the comment. | |
showContextMenu(e) | Show a context menu for this comment. | |
snapToGrid() | Snap this comment to the nearest grid point. | |
startDrag() | Starts a drag on the comment. | |
toCopyData() | Returns a JSON serializable representation of this comment's state that can be used for pasting. | |
unselect() | Visually unhighlights the comment. |