RenderedConnection class
Class for a connection between blocks that may be rendered on screen.
Signature:
export declare class RenderedConnection extends Connection implements IContextMenu, IFocusableNode
Extends: Connection
Implements: IContextMenu, IFocusableNode
Constructors
Constructor | Modifiers | Description |
|---|---|---|
Constructs a new instance of the |
Properties
Property | Modifiers | Type | Description |
|---|---|---|---|
RenderedConnection | null | Connection this connection connects to. Null if not connected. |
Methods
Method | Modifiers | Description |
|---|---|---|
See IFocusableNode.canBeFocused. | ||
Find the closest compatible connection to this connection. All parameters are in workspace units. | ||
| Connect two connections together. This is the connection on the superior block. Rerender blocks as needed. | |
Disconnect two blocks that are connected by this connection. | ||
Returns the distance between this connection and another connection in workspace units. | ||
See IFocusableNode.getFocusableElement. | ||
See IFocusableNode.getFocusableTree. | ||
Get the offset of this connection relative to the top left of its block. | ||
Get the source block for this connection. | ||
Add highlighting around this connection. | ||
Returns true if this connection is highlighted, false otherwise. | ||
Change the connection's coordinates. | ||
Change the connection's coordinates. | ||
Move this connection to the location given by its offset within the block and the location of the block's top left corner. | ||
| Function to be called when this connection's compatible types have changed. | |
See IFocusableNode.onNodeBlur. | ||
See IFocusableNode.onNodeFocus. | ||
| Respawn the shadow block if there was one connected to the this connection. Render/rerender blocks as needed. | |
Change a connection's compatibility. Rerender blocks as needed. | ||
Set the offset of this connection relative to the top left of its block. | ||
Handles showing the context menu when it is opened on a connection. Note that typically the context menu can't be opened with the mouse on a connection, because you can't select a connection. But keyboard users may open the context menu with a keyboard shortcut. | ||
Start tracking this connection, as well as all down-stream connections on any block attached to this connection. This happens when a block is expanded. | ||
Returns the block that this connection connects to. | ||
Remove the highlighting around this connection. |