Blockly. InsertionMarkerManager
Class that controls updates to connections during drags. It is primarily responsible for finding the closest eligible connection and highlighting or unhighlighting it as needed during a drag.
Constructor
InsertionMarkerManager
new InsertionMarkerManager(block)
Parameter |
|
---|---|
block |
The top block in the stack being dragged. Value must not be null. |
Enumeration
PREVIEW_TYPE
number
An enum describing different kinds of previews the InsertionMarkerManager could display.
Value |
|
---|---|
INSERTION_MARKER |
|
INPUT_OUTLINE |
|
REPLACEMENT_FADE |
Properties
PREVIEW_TYPE
number
An enum describing different kinds of previews the InsertionMarkerManager could display.
Value |
|
---|---|
INSERTION_MARKER |
|
INPUT_OUTLINE |
|
REPLACEMENT_FADE |
localConnection_
non-null Blockly.RenderedConnection
Methods
applyConnections
applyConnections()
Connect to the closest connection and render the results. This should be called at the end of a drag.
dispose
dispose()
Sever all links from this object.
getInsertionMarkers
getInsertionMarkers() returns Array of non-null Blockly.BlockSvg
Get a list of the insertion markers that currently exist. Drags have 0, 1, or 2 insertion markers.
- Returns
-
non-null Array of non-null Blockly.BlockSvg
A possibly empty list of insertion marker blocks.
update
update(dxy, dragTarget)
Update connections based on the most recent move location.
Parameter |
|
---|---|
dxy |
Position relative to drag start, in workspace units. Value must not be null. |
dragTarget |
The drag target that the block is currently over. Value may be null. |
updateAvailableConnections
updateAvailableConnections()
Update the available connections for the top block. These connections can change if a block is unplugged and the stack is healed.
wouldConnectBlock
wouldConnectBlock() returns boolean
Return whether the block would be connected if dropped immediately, based on information from the most recent move event.
- Returns
-
boolean
True if the block would be connected if dropped immediately.
wouldDeleteBlock
wouldDeleteBlock() returns boolean
Return whether the block would be deleted if dropped immediately, based on information from the most recent move event.
- Returns
-
boolean
True if the block would be deleted if dropped immediately.