Blockly.Events. CommentMove
Constructor
CommentMove
new CommentMove(opt_comment)
Class for a comment move event. Created before the move.
Parameter |
|
---|---|
opt_comment |
Optional The comment that is being moved. Undefined for a blank event. Value must not be null. |
- Extends
- Blockly.Events.CommentBase
Properties
comment_
The comment that is being moved. Will be cleared after recording the new location.
commentId
unknown
The ID of the comment this event pertains to.
- Inherited from
- Blockly.Events.CommentBase#commentId
group
unknown
The event group id for the group this event belongs to. Groups define events that should be treated as an single action from the user's perspective, and should be undone together.
- Inherited from
- Blockly.Events.CommentBase#group
isBlank
unknown
Whether or not an event is blank.
- Inherited from
- Blockly.Events.CommentBase#isBlank
isUiEvent
unknown
Whether or not the event is a ui event.
- Inherited from
- Blockly.Events.Abstract#isUiEvent
newCoordinate_
The location after the move, in workspace coordinates.
oldCoordinate_
non-null Blockly.utils.Coordinate
The location before the move, in workspace coordinates.
recordUndo
unknown
Sets whether the event should be added to the undo stack.
- Inherited from
- Blockly.Events.CommentBase#recordUndo
type
string
Type of this event.
workspaceId
unknown
The workspace identifier for this event.
- Inherited from
- Blockly.Events.CommentBase#workspaceId
Methods
fromJson
fromJson(json)
Decode the JSON event.
Parameter |
|
---|---|
json |
Object JSON representation. Value must not be null. |
getEventWorkspace_
getEventWorkspace_() returns Blockly.Workspace
Get workspace the event belongs to.
- Inherited from
- Blockly.Events.Abstract#getEventWorkspace_
- Throws
-
if workspace is null.
- Returns
-
The workspace the event belongs to.
isNull
isNull() returns boolean
Does this event record any change of state?
- Returns
-
boolean
False if something changed.
recordNew
recordNew()
Record the comment's new location. Called after the move. Can only be called once.
run
run(forward)
Run a move event.
Parameter |
|
---|---|
forward |
boolean True if run forward, false if run backward (undo). |
setOldCoordinate
setOldCoordinate(xy)
Override the location before the move. Use this if you don't create the event until the end of the move, but you know the original location.
Parameter |
|
---|---|
xy |
The location before the move, in workspace coordinates. Value must not be null. |
toJson
toJson() returns Object
Encode the event as JSON.
- Returns
-
non-null Object
JSON representation.