Constructor

Cursor

new Cursor()

Class for a cursor. A cursor controls how a user navigates the Blockly AST.

Methods

getCurNode

getCurNode() returns Blockly.ASTNode

Gets the current location of the cursor.

Returns

Blockly.ASTNode The current field, connection, or block the cursor is on.

getDrawer

getDrawer() returns Blockly.CursorSvg

Get the current drawer for the cursor.

Returns

Blockly.CursorSvg The object in charge of drawing the cursor.

hide

hide()

Hide the cursor SVG.

in

in() returns Blockly.ASTNode

Find the in connection or field.

Returns

Blockly.ASTNode The in element, or null if the current node is not set or there is no in value.

next

next() returns Blockly.ASTNode

Find the next connection, field, or block.

Returns

Blockly.ASTNode The next element, or null if the current node is not set or there is no next value.

out

out() returns Blockly.ASTNode

Find the out connection, field, or block.

Returns

Blockly.ASTNode The out element, or null if the current node is not set or there is no out value.

prev

prev() returns Blockly.ASTNode

Find the previous connection, field, or block.

Returns

Blockly.ASTNode The previous element, or null if the current node is not set or there is no previous value.

setCurNode

setCurNode(newNode)

Set the location of the cursor and call the update method. Setting isStack to true will only work if the newLocation is the top most output or previous connection on a stack.

Parameter

newNode

Blockly.ASTNode

The new location of the cursor.

setDrawer

setDrawer(drawer)

Sets the object in charge of drawing the cursor.

Parameter

drawer

Blockly.CursorSvg

The object in charge of drawing the cursor.