Blockly. Cursor
Constructor
Cursor
new Cursor()
Class for a cursor. A cursor controls how a user navigates the Blockly AST.
- Extends
- Blockly.Marker
- Implements
- Blockly.IBlocklyActionable
Properties
colour
unknown
The colour of the marker.
- Inherited from
- Blockly.Marker#colour
type
unknown
The type of the marker.
- Inherited from
- Blockly.Cursor#type
Methods
dispose
dispose()
Dispose of this marker.
- Inherited from
- Blockly.Marker#dispose
draw
draw()
Redraw the current marker.
- Inherited from
- Blockly.Marker#draw
getCurNode
getCurNode() returns Blockly.ASTNode
Gets the current location of the marker.
- Inherited from
- Blockly.Marker#getCurNode
- Returns
-
The current field, connection, or block the marker is on.
getDrawer
getDrawer() returns Blockly.blockRendering.MarkerSvg
Get the current drawer for the marker.
- Inherited from
- Blockly.Marker#getDrawer
- Returns
-
The object in charge of drawing the marker.
hide
hide()
Hide the marker SVG.
- Inherited from
- Blockly.Marker#hide
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.
onBlocklyAction
onBlocklyAction(action) returns boolean
Handles the given action. This is only triggered when keyboard navigation is enabled.
Parameter |
|
---|---|
action |
Blockly.ShortcutRegistry.KeyboardShortcut The action to be handled. Value must not be null. |
- Implements
- Blockly.IBlocklyActionable#onBlocklyAction
- Returns
-
boolean
True if the action has been handled, false otherwise.
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 marker 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 |
The new location of the marker. |
- Inherited from
- Blockly.Marker#setCurNode
setDrawer
setDrawer(drawer)
Sets the object in charge of drawing the marker.
Parameter |
|
---|---|
drawer |
The object in charge of drawing the marker. |
- Inherited from
- Blockly.Marker#setDrawer