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
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 |
|
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 bubble. |
updateEditable() |
|
Add or remove the UI indicating if this icon may be clicked or not. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2022-12-15 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]