Blockly. Mutator
Class for a mutator dialog.
Constructor
Mutator
new Mutator(quarkNames)
Parameter |
|
---|---|
quarkNames |
List of names of sub-blocks for flyout. 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
unknown
Whether this icon gets hidden when the block is collapsed.
- Inherited from
- Blockly.Icon#collapseHidden
iconGroup_
non-null Element
iconGroup_
non-null Element
iconXY_
non-null Blockly.utils.Coordinate
SIZE
Height and width of icons.
- Inherited from
- Blockly.Icon#SIZE
Methods
findParentWs
findParentWs(workspace) returns Blockly.WorkspaceSvg
Get the parent workspace of a workspace that is inside a mutator, taking into account whether it is a flyout.
Parameter |
|
---|---|
workspace |
The workspace that is inside a mutator. |
- Returns
-
nullable Blockly.WorkspaceSvg
The mutator's parent workspace or null.
reconnect
reconnect(connectionChild, block, inputName) returns boolean
Reconnect an block to a mutated input.
Parameter |
|
---|---|
connectionChild |
Connection on child block. |
block |
Parent block. Value must not be null. |
inputName |
string Name of input on parent block. |
- Returns
-
boolean
True iff a reconnection was made, false otherwise.
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 mutator.
drawIcon_
drawIcon_(group)
Draw the mutator icon.
Parameter |
|
---|---|
group |
Element The icon group. Value must not be null. |
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.
getWorkspace
getWorkspace() returns Blockly.WorkspaceSvg
Returns the workspace inside this mutator icon's bubble.
- Returns
-
nullable Blockly.WorkspaceSvg
The workspace inside this mutator icon's bubble or null if the mutator isn't open.
iconClick_
iconClick_(e)
Clicking on the icon toggles if the mutator bubble is visible. Disable if block is uneditable.
Parameter |
|
---|---|
e |
Mouse click event. Value must not be null. |
- Inherited from
- Blockly.Mutator#iconClick_
isVisible
isVisible() returns boolean
Is the associated bubble visible?
- Inherited from
- Blockly.Icon#isVisible
- Returns
-
True if the bubble is visible.
setBlock
setBlock(block)
Set the block this mutator is associated with.
Parameter |
|
---|---|
block |
The block associated with this mutator. Value must not be null. |
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 mutator bubble.
Parameter |
|
---|---|
visible |
boolean True if the bubble should be visible. |
updateBlockStyle
updateBlockStyle()
Update the styles on all blocks in the mutator.
updateEditable
updateEditable()
Add or remove the UI indicating if this icon may be clicked or not.