sesaparcours
    Preparing search index...

    Fake class which should be extended to avoid inheriting static properties

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    disposed: boolean

    Has this connection been disposed of?

    targetConnection: Blockly.RenderedConnection

    Connection this connection connects to. Null if not connected.

    type: number
    x: number

    Horizontal location of this connection.

    y: number

    Vertical location of this connection.

    Methods

    • Move the block(s) belonging to the connection to a point where they don't visually interfere with the specified connection.

      Parameters

      Returns void

    • Checks whether the current connection can connect with the target connection.

      Parameters

      Returns number

      Blockly.Connection.CAN_CONNECT if the connection is legal, an error code otherwise.

      July 2020. Will be deleted July 2021. Use the workspace's connectionChecker instead.

    • Checks whether the current connection and target connection are compatible and throws an exception if they are not.

      Parameters

      Returns void

      July 2020. Will be deleted July 2021. Use the workspace's connectionChecker instead.

    • Is this connection compatible with another connection with respect to the value type system. E.g. square_root("Hello") is not compatible.

      Parameters

      Returns boolean

      True if the connections share a type.

      July 2020. Will be deleted July 2021. Use the workspace's connectionChecker instead.

    • Find the closest compatible connection to this connection. All parameters are in workspace units.

      Parameters

      • maxLimit: number

        The maximum radius to another connection.

      • dxy: Blockly.utils.Coordinate

        Offset between this connection's location in the database and the current location (as a result of dragging).

      Returns { connection: Blockly.Connection; radius: number }

      Contains two properties: 'connection' which is either another connection or null, and 'radius' which is the distance.

    • Connect this connection to another connection.

      Parameters

      Returns void

    • Disconnect this connection.

      Returns void

    • Dispose of this connection and deal with connected blocks.

      Returns void

    • Returns the distance between this connection and another connection in workspace units.

      Parameters

      Returns number

      The distance between connections, in workspace units.

    • Get a connection's compatibility.

      Returns any[]

      List of compatible value types. Null if all types are compatible.

    • Get the offset of this connection relative to the top left of its block.

      Returns Blockly.utils.Coordinate

      The offset of the connection.

    • Get the parent input of a connection.

      Returns Input

      The input that the connection belongs to or null if no parent exists.

    • Returns the xml representation of the connection's shadow block.

      Parameters

      • OptionalreturnCurrent: boolean

        If true, and the shadow block is currently attached to this connection, this serializes the state of that block and returns it (so that field values are correct). Otherwise the saved shadowDom is just returned.

      Returns Element

      Shadow DOM representation of a block or null.

    • Add highlighting around this connection.

      Returns void

    • Is the connection connected?

      Returns boolean

      True if connection is connected to another connection.

    • Check if the two connections can be dragged to connect to each other.

      Parameters

      • candidate: Blockly.Connection

        A nearby connection to check.

      • OptionalmaxRadius: number

        The maximum radius allowed for connections, in workspace units.

      Returns boolean

      True if the connection is allowed, false otherwise.

      July 2020

    • Does the connection belong to a superior block (higher in the source stack)?

      Returns boolean

      True if connection faces down or right.

    • Change the connection's coordinates.

      Parameters

      • dx: number

        Change to x coordinate, in workspace units.

      • dy: number

        Change to y coordinate, in workspace units.

      Returns void

    • Change the connection's coordinates.

      Parameters

      • x: number

        New absolute x coordinate, in workspace coordinates.

      • y: number

        New absolute y coordinate, in workspace coordinates.

      Returns void

    • Move this connection to the location given by its offset within the block and the location of the block's top left corner.

      Parameters

      Returns void

    • Find all nearby compatible connections to this connection. Type checking does not apply, since this function is used for bumping.

      Parameters

      • maxLimit: number

        The maximum radius to another connection, in workspace units.

      Returns Blockly.Connection[]

      List of connections.

    • Behavior after a connection attempt fails. Bumps this connection away from the other connection. Called when an attempted connection fails.

      Parameters

      • otherConnection: Blockly.Connection

        Connection that this connection failed to connect to.

      Returns void

    • Change a connection's compatibility.

      Parameters

      • check: string | string[]

        Compatible value type or list of value types. Null if all types are compatible.

      Returns Blockly.Connection

      The connection being modified (to allow chaining).

    • Set the offset of this connection relative to the top left of its block.

      Parameters

      • x: number

        The new relative x, in workspace units.

      • y: number

        The new relative y, in workspace units.

      Returns void

    • Changes the connection's shadow block.

      Parameters

      • shadow: Element

        DOM representation of a block or null.

      Returns void

    • Set whether this connections is tracked in the database or not.

      Parameters

      • doTracking: boolean

        If true, start tracking. If false, stop tracking.

      Returns void

    • 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 Blockly.Block[]

      List of blocks to render.

    • Stop tracking this connection, as well as all down-stream connections on any block attached to this connection. This happens when a block is collapsed.

      Also closes down-stream icons/bubbles.

      Returns void

    • Returns the block that this connection connects to.

      Returns Blockly.Block

      The connected block or null if none is connected.

    • Move the blocks on either side of this connection right next to each other.

      Returns void

    • This method returns a string describing this Connection in developer terms (English only). Intended to on be used in console logs and errors.

      Returns string

      The description.

    • Remove the highlighting around this connection.

      Returns void