Constructor

Mutator

new Mutator(quarkNames)

Class for a mutator dialog.

Parameter

quarkNames

Array of string

List of names of sub-blocks for flyout.

Value must not be null.

Extends
Blockly.Icon

Properties

bubble_

protected

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

iconXY_

protected

unknown

Absolute coordinate of icon's center.

Inherited from
Blockly.Icon#iconXY_

SIZE

Height and width of icons.

Inherited from
Blockly.Icon#SIZE

Methods

findParentWs

public   static

findParentWs(workspace) returns Blockly.Workspace

Get the parent workspace of a workspace that is inside a mutator, taking into account whether it is a flyout.

Parameter

workspace

Blockly.Workspace

The workspace that is inside a mutator.

Value may be null.

Returns

nullable Blockly.Workspace The mutator's parent workspace or null.

reconnect

static

reconnect(connectionChild, block, inputName) returns boolean

Reconnect an block to a mutated input.

Parameter

connectionChild

Blockly.Connection

Connection on child block.

block

Blockly.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.

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.

getIconLocation

getIconLocation() returns goog.math.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_

protected

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.

renderIcon

renderIcon(cursorX) returns number

Render the icon.

Parameter

cursorX

Horizontal offset at which to position the icon.

Inherited from
Blockly.Icon#renderIcon
Returns

Horizontal offset for next item to draw.

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.

updateColour

updateColour()

Change the colour of the associated bubble to match its block.

Inherited from
Blockly.Icon#updateColour

updateEditable

updateEditable()

Add or remove the UI indicating if this icon may be clicked or not.