Class: Renderer

Constructor

Renderer

new Renderer(name)

The zelos renderer.

Parameter

name

string

The renderer name.

Extends
Blockly.blockRendering.Renderer

Properties

name

package

unknown

The renderer name.

Inherited from
Blockly.blockRendering.Renderer#name

overrides

package

unknown

Rendering constant overrides, passed in through options.

Inherited from
Blockly.blockRendering.Renderer#overrides

Methods

createDom

package

createDom(svg, theme)

Create any DOM elements that this renderer needs.

Parameter

svg

The root of the workspace's SVG.

Value must not be null.

theme

The workspace theme object.

Value must not be null.

Inherited from
Blockly.blockRendering.Renderer#createDom

dispose

package

dispose()

Dispose of this renderer. Delete all DOM elements that this renderer and its constants created.

Inherited from
Blockly.blockRendering.Renderer#dispose

getClassName

package

getClassName() returns string

Gets the class name that identifies this renderer.

Inherited from
Blockly.blockRendering.Renderer#getClassName
Returns

The CSS class name.

getConnectionPreviewMethod

package

getConnectionPreviewMethod(closest, local, topBlock) returns Blockly.InsertionMarkerManager.PREVIEW_TYPE

Chooses a connection preview method based on the available connection, the current dragged connection, and the block being dragged.

Parameter

closest

The available connection.

Value must not be null.

local

The connection currently being dragged.

Value must not be null.

topBlock

The block currently being dragged.

Value must not be null.

Inherited from
Blockly.zelos.Renderer#getConnectionPreviewMethod
Returns

The preview type to display.

getConstants

package

getConstants() returns Blockly.blockRendering.ConstantProvider

Get the current renderer's constant provider. We assume that when this is called, the renderer has already been initialized.

Inherited from
Blockly.blockRendering.Renderer#getConstants
Returns

The constant provider.

init

package

init(theme, opt_rendererOverrides)

Initialize the renderer.

Parameter

theme

The workspace theme object.

Value must not be null.

opt_rendererOverrides

Optional

Rendering constant overrides.

Inherited from
Blockly.blockRendering.Renderer#init

makeConstants_

protected

makeConstants_() returns Blockly.zelos.ConstantProvider

Create a new instance of the renderer's constant provider.

Inherited from
Blockly.zelos.Renderer#makeConstants_
Returns

The constant provider.

makeDebugger_

protected

makeDebugger_() returns Blockly.blockRendering.Debug

Create a new instance of the renderer's debugger.

Inherited from
Blockly.blockRendering.Renderer#makeDebugger_
Returns

The renderer debugger.

makeDrawer_

protected

makeDrawer_(block, info) returns Blockly.zelos.Drawer

Create a new instance of the renderer's drawer.

Parameter

block

The block to render.

Value must not be null.

info

An object containing all information needed to render this block.

Value must not be null.

Inherited from
Blockly.zelos.Renderer#makeDrawer_
Returns

The drawer.

makeMarkerDrawer

package

makeMarkerDrawer(workspace, marker) returns Blockly.blockRendering.MarkerSvg

Create a new instance of the renderer's cursor drawer.

Parameter

workspace

The workspace the cursor belongs to.

Value must not be null.

marker

The marker.

Value must not be null.

Inherited from
Blockly.zelos.Renderer#makeMarkerDrawer
Returns

The object in charge of drawing the marker.

makePathObject

package

makePathObject(root, style) returns Blockly.zelos.PathObject

Create a new instance of a renderer path object.

Parameter

root

The root SVG element.

Value must not be null.

style

The style object to use for colouring.

Value must not be null.

Inherited from
Blockly.zelos.Renderer#makePathObject
Returns

The renderer path object.

makeRenderInfo_

protected

makeRenderInfo_(block) returns Blockly.zelos.RenderInfo

Create a new instance of the renderer's render info object.

Parameter

block

The block to measure.

Value must not be null.

Inherited from
Blockly.zelos.Renderer#makeRenderInfo_
Returns

The render info object.

orphanCanConnectAtEnd

package

orphanCanConnectAtEnd(topBlock, orphanBlock, localType) returns boolean

Checks if an orphaned block can connect to the "end" of the topBlock's block-clump. If the clump is a row the end is the last input. If the clump is a stack, the end is the last next connection. If the clump is neither, then this returns false.

Parameter

topBlock

The top block of the block clump we want to try and connect to.

Value must not be null.

orphanBlock

The orphan block that wants to find a home.

Value must not be null.

localType

The type of the connection being dragged.

Inherited from
Blockly.blockRendering.Renderer#orphanCanConnectAtEnd
Returns

Whether there is a home for the orphan or not.

refreshDom

package

refreshDom(svg, theme)

Refresh the renderer after a theme change.

Parameter

svg

The root of the workspace's SVG.

Value must not be null.

theme

The workspace theme object.

Value must not be null.

Inherited from
Blockly.blockRendering.Renderer#refreshDom

render

package

render(block)

Render the block.

Parameter

block

The block to render.

Value must not be null.

Inherited from
Blockly.blockRendering.Renderer#render

shouldHighlightConnection

package

shouldHighlightConnection(_conn) returns boolean

Determine whether or not to highlight a connection.

Parameter

_conn

The connection to determine whether or not to highlight.

Inherited from
Blockly.zelos.Renderer#shouldHighlightConnection
Returns

True if we should highlight the connection.