Class: Renderer

Constructor

Renderer

new Renderer(name)

The geras renderer.

Parameter

name

string

The renderer name.

Extends
Blockly.blockRendering.Renderer

Properties

highlightConstants_

non-null Blockly.geras.HighlightConstantProvider

name

package

unknown

The renderer name.

Inherited from
Blockly.blockRendering.Renderer#name

Methods

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.

getHighlightConstants

package

getHighlightConstants() returns Blockly.geras.HighlightConstantProvider

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

Returns

non-null Blockly.geras.HighlightConstantProvider The highlight constant provider.

init

package

init()

Initialize the renderer. Geras has a highlight provider in addition to the normal constant provider.

Inherited from
Blockly.geras.Renderer#init

makeConstants_

protected

makeConstants_() returns Blockly.blockRendering.ConstantProvider

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

Inherited from
Blockly.geras.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.geras.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.geras.Renderer#makeDrawer_
Returns

The drawer.

makeHighlightConstants_

protected

makeHighlightConstants_() returns Blockly.geras.HighlightConstantProvider

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

Returns

non-null Blockly.geras.HighlightConstantProvider The highlight constant provider.

makeMarkerDrawer

package

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

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

Parameter

workspace

The workspace the marker belongs to.

Value must not be null.

marker

The marker.

Value must not be null.

Inherited from
Blockly.blockRendering.Renderer#makeMarkerDrawer
Returns

The object in charge of drawing the marker.

makePathObject

package

makePathObject(root, style) returns Blockly.geras.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.geras.Renderer#makePathObject
Returns

The renderer path object.

makeRenderInfo_

protected

makeRenderInfo_(block) returns Blockly.geras.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.geras.Renderer#makeRenderInfo_
Returns

The render info object.

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.blockRendering.Renderer#shouldHighlightConnection
Returns

True if we should highlight the connection.

shouldInsertDraggedBlock

package

shouldInsertDraggedBlock(block, conn) returns boolean

Determine whether or not to insert a dragged block into a stack.

Parameter

block

The target block.

Value must not be null.

conn

The closest connection.

Value must not be null.

Inherited from
Blockly.blockRendering.Renderer#shouldInsertDraggedBlock
Returns

True if we should insert the dragged block into the stack.