Blockly. Comment
Constructor
Comment
new Comment(block)
Class for a comment.
Parameter |
|
---|---|
block |
The block associated with this comment. Value must not be null. |
- Extends
- Blockly.Icon
Properties
block_
non-null Blockly.BlockSvg
bubble_
unknown
Bubble UI (if visible).
- Inherited from
- Blockly.Icon#bubble_
collapseHidden
Does this icon get hidden when the block is collapsed.
- Inherited from
- Blockly.Icon#collapseHidden
iconGroup_
unknown
The icon SVG group.
- Inherited from
- Blockly.Icon#iconGroup_
iconXY_
non-null Blockly.utils.Coordinate
iconXY_
non-null Blockly.utils.Coordinate
SIZE
Height and width of icons.
- Inherited from
- Blockly.Icon#SIZE
Methods
applyColour
applyColour()
Change the colour of the associated bubble to match its block.
- Inherited from
- Blockly.Icon#applyColour
computeIconLocation
computeIconLocation()
Notification that the icon has moved, but we don't really know where. Recompute the icon's location from scratch.
- Inherited from
- Blockly.Icon#computeIconLocation
createIcon
createIcon()
Create the icon on the block.
- Inherited from
- Blockly.Icon#createIcon
dispose
dispose()
Dispose of this comment.
If you want to receive a comment "delete" event (newValue: null), then this should not be called directly. Instead call block.setCommentText(null);
drawIcon_
drawIcon_(group)
Draw the comment icon.
Parameter |
|
---|---|
group |
Element The icon group. Value must not be null. |
getBubbleSize
getBubbleSize() returns Blockly.utils.Size
Get the dimensions of this comment's bubble.
- Returns
-
Blockly.utils.Size
Object with width and height properties.
getCorrectedSize
getCorrectedSize() returns Blockly.utils.Size
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.
- Inherited from
- Blockly.Icon#getCorrectedSize
- Returns
-
Height and width.
getIconLocation
getIconLocation() returns Blockly.utils.Coordinate
Returns the center of the block's icon relative to the surface.
- Inherited from
- Blockly.Icon#getIconLocation
- Returns
-
Object with x and y properties in workspace coordinates.
iconClick_
iconClick_(e)
Clicking on the icon toggles if the bubble is visible.
Parameter |
|
---|---|
e |
Mouse click event. Value must not be null. |
- Inherited from
- Blockly.Icon#iconClick_
isVisible
isVisible() returns boolean
Is the associated bubble visible?
- Inherited from
- Blockly.Icon#isVisible
- Returns
-
True if the bubble is visible.
setBubbleSize
setBubbleSize(width, height)
Size this comment's bubble.
Parameter |
|
---|---|
width |
number Width of the bubble. |
height |
number Height of the bubble. |
setIconLocation
setIconLocation(xy)
Notification that the icon has moved. Update the arrow accordingly.
Parameter |
|
---|---|
xy |
Absolute location in workspace coordinates. Value must not be null. |
- Inherited from
- Blockly.Icon#setIconLocation
setVisible
setVisible(visible)
Show or hide the comment bubble.
Parameter |
|
---|---|
visible |
boolean True if the bubble should be visible. |
updateEditable
updateEditable()
Add or remove editability of the comment.
- Inherited from
- Blockly.Comment#updateEditable
updateText
updateText()
Update the comment's view to match the model.