sesaparcours
    Preparing search index...

    Fake class which should be extended to avoid inheriting static properties

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    • Class for a workspace comment's SVG representation.

      Parameters

      • workspace: Blockly.Workspace

        The block's workspace.

      • content: string

        The content of this workspace comment.

      • height: number

        Height of the comment.

      • width: number

        Width of the comment.

      • Optionalopt_id: string

        Optional ID. Use this ID if provided, otherwise create a new ID.

      Returns WorkspaceCommentSvg__Class

    Properties

    id: string
    isComment: boolean
    workspace: Blockly.Workspace

    Methods

    • Focus this comment. Highlight it visually.

      Returns void

    • Select this comment. Highlight it visually.

      Returns void

    • Dispose of this comment.

      Returns void

    • Returns the coordinates of a bounding box describing the dimensions of this comment. Coordinate system: workspace coordinates.

      Returns Blockly.utils.Rect

      Object with coordinates of the bounding box.

    • Returns this comment's text.

      Returns string

      Comment text.

    • Get comment height.

      Returns number

      Comment height.

    • Return the coordinates of the top-left corner of this comment relative to the drawing surface's origin (0,0), in workspace units. If the comment is on the workspace, (0, 0) is the origin of the workspace coordinate system. This does not change with workspace scale.

      Returns Blockly.utils.Coordinate

      Object with .x and .y properties in workspace coordinates.

    • Return the root node of the SVG or null if none exists.

      Returns SVGElement

      The root SVG node (probably a group).

    • Get comment width.

      Returns number

      Comment width.

    • Create and initialize the SVG representation of a workspace comment. May be called more than once.

      Parameters

      • Optionalopt_noSelect: boolean

        Text inside text area will be selected if false

      Returns void

    • Get whether this comment is deletable or not.

      Returns boolean

      True if deletable.

    • Get whether this comment is editable or not.

      Returns boolean

      True if editable.

    • Get whether this comment is movable or not.

      Returns boolean

      True if movable.

    • Move a comment by a relative offset.

      Parameters

      • dx: number

        Horizontal offset, in workspace units.

      • dy: number

        Vertical offset, in workspace units.

      Returns void

    • Move this comment during a drag, taking into account whether we are using a drag surface to translate blocks.

      Parameters

      • dragSurface: BlockDragSurfaceSvg

        The surface that carries rendered items during a drag, or null if no drag surface is in use.

      • newLoc: Blockly.utils.Coordinate

        The location to translate to, in workspace coordinates.

      Returns void

    • Move the bubble group to the specified location in workspace coordinates.

      Parameters

      • x: number

        The x position to move to.

      • y: number

        The y position to move to.

      Returns void

    • Move this comment to its workspace's drag surface, accounting for positioning. Generally should be called at the same time as setDragging(true). Does nothing if useDragSurface_ is false.

      Returns void

    • Unfocus this comment. Remove its highlighting.

      Returns void

    • Unselect this comment. Remove its highlighting.

      Returns void

    • Select this comment. Highlight it visually.

      Returns void

    • Set whether auto-layout of this bubble is enabled. The first time a bubble is shown it positions itself to not cover any blocks. Once a user has dragged it to reposition, it renders where the user put it.

      Parameters

      • _enable: boolean

        True if auto-layout should be enabled, false otherwise.

      Returns void

    • Set this comment's content.

      Parameters

      • content: string

        Comment content.

      Returns void

    • Set whether this comment is deletable or not.

      Parameters

      • deletable: boolean

        True if deletable.

      Returns void

    • Update the cursor over this comment by adding or removing a class.

      Parameters

      • enable: boolean

        True if the delete cursor should be shown, false otherwise.

      Returns void

    • Recursively adds or removes the dragging class to this node and its children.

      Parameters

      • adding: boolean

        True if adding, false if removing.

      Returns void

    • Set whether this comment is editable or not.

      Parameters

      • editable: boolean

        True if editable.

      Returns void

    • Set comment height.

      Parameters

      • height: number

        Comment height.

      Returns void

    • Set whether this comment is movable or not.

      Parameters

      • movable: boolean

        True if movable.

      Returns void

    • Set comment width.

      Parameters

      • width: number

        comment width.

      Returns void

    • Show the context menu for this workspace comment.

      Parameters

      Returns void

    • Encode a comment for copying.

      Returns CopyData

      Copy metadata.

    • Encode a comment subtree as XML, but don't serialize the XY coordinates. This method avoids some expensive metrics-related calls that are made in toXmlWithXY().

      Parameters

      • Optionalopt_noId: boolean

        True if the encoder should skip the comment ID.

      Returns Element

      Tree of XML elements.

    • Encode a comment subtree as XML with XY coordinates.

      Parameters

      • Optionalopt_noId: boolean

        True if the encoder should skip the comment ID.

      Returns Element

      Tree of XML elements.

    • Transforms a comment by setting the translation on the transform attribute of the block's SVG.

      Parameters

      • x: number

        The x coordinate of the translation in workspace units.

      • y: number

        The y coordinate of the translation in workspace units.

      Returns void

    • Unselect this comment. Remove its highlighting.

      Returns void

    • Add or remove the UI indicating if this comment is movable or not.

      Returns void