Blockly.geras. 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
unknown
The renderer name.
- Inherited from
- Blockly.blockRendering.Renderer#name
overrides
unknown
Rendering constant overrides, passed in through options.
- Inherited from
- Blockly.blockRendering.Renderer#overrides
Methods
createDom
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
dispose()
Dispose of this renderer. Delete all DOM elements that this renderer and its constants created.
- Inherited from
- Blockly.blockRendering.Renderer#dispose
getClassName
getClassName() returns string
Gets the class name that identifies this renderer.
- Inherited from
- Blockly.blockRendering.Renderer#getClassName
- Returns
-
The CSS class name.
getConnectionPreviewMethod
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.blockRendering.Renderer#getConnectionPreviewMethod
- Returns
-
The preview type to display.
getConstants
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
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
init(theme, opt_rendererOverrides)
Initialize the renderer. Geras has a highlight provider in addition to the normal constant provider.
Parameter |
|
---|---|
theme |
The workspace theme object. Value must not be null. |
opt_rendererOverrides |
Optional Rendering constant overrides. |
- Inherited from
- Blockly.geras.Renderer#init
makeConstants_
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_
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_
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_
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
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
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_
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.
orphanCanConnectAtEnd
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
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.geras.Renderer#refreshDom
render
render(block)
Render the block.
Parameter |
|
---|---|
block |
The block to render. Value must not be null. |
- Inherited from
- Blockly.blockRendering.Renderer#render
shouldHighlightConnection
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.