Stay organized with collections Save and categorize content based on your preferences.

blockly > Icon

Icon class

Class for an icon.

Signature:

export declare abstract class Icon 

Constructors

Constructor Modifiers Description
(constructor)(block) Constructs a new instance of the Icon class

Properties

Property Modifiers Type Description
block_ protected BlockSvg | null
bubble_ protected Bubble | null Bubble UI (if visible).
collapseHidden boolean Whether this icon gets hidden when the block is collapsed.
iconGroup_ SVGGElement | null The icon SVG group.
iconXY_ protected Coordinate | null Absolute coordinate of icon's center.
SIZE readonly (not declared) Height and width of icons.

Methods

Method Modifiers Description
applyColour() Change the colour of the associated bubble to match its block.
computeIconLocation() Notification that the icon has moved, but we don't really know where. Recompute the icon's location from scratch.
createIcon() Create the icon on the block.
dispose() Dispose of this icon.
drawIcon_(_group) protected Draw the icon.
getBlock() protected Returns the block this icon is attached to.
getCorrectedSize() Get the size of the icon as used for rendering. This differs from the actual size of the icon, because it bulges slightly out of its row rather than increasing the height of its row.
getIconLocation() Returns the center of the block's icon relative to the surface.
iconClick_(e) protected Clicking on the icon toggles if the bubble is visible.
isVisible() Is the associated bubble visible?
setIconLocation(xy) Notification that the icon has moved. Update the arrow accordingly.
setVisible(_visible) Show or hide the icon.
updateEditable() Add or remove the UI indicating if this icon may be clicked or not.