Class: PathObject

Constructor

PathObject

new PathObject(root, style, constants)

An object that handles creating and setting each of the SVG elements used by the renderer.

Parameter

root

SVGElement

The root SVG element.

Value must not be null.

style

Blockly.Theme.BlockStyle

The style object to use for colouring.

Value must not be null.

constants

Blockly.geras.ConstantProvider

The renderer's constants.

Value must not be null.

Extends
Blockly.blockRendering.PathObject

Properties

colourDark

package

string

The colour of the dark path on the block in '#RRGGBB' format.

constants

non-null Blockly.geras.ConstantProvider

The renderer's constant provider.

cursorSvg

package

unknown

Holds the cursors svg element when the cursor is attached to the block. This is null if there is no cursor on the block.

Inherited from
Blockly.blockRendering.PathObject#cursorSvg
Implements
Blockly.blockRendering.IPathObject#cursorSvg

markerSvg

package

unknown

Holds the markers svg element when the marker is attached to the block. This is null if there is no marker on the block.

Inherited from
Blockly.blockRendering.PathObject#markerSvg
Implements
Blockly.blockRendering.IPathObject#markerSvg

style

package

non-null Blockly.Theme.BlockStyle

The style object to use when colouring block paths.

svgPath

package

non-null SVGElement

The primary path of the block.

svgPathDark

package

SVGElement

The dark path of the block.

svgPathLight

package

SVGElement

The light path of the block.

svgRoot

unknown

Inherited from
Blockly.blockRendering.PathObject#svgRoot

Methods

applyColour

package

applyColour(block)

Apply the stored colours to the block's path, taking into account whether the paths belong to a shadow block.

Parameter

block

The source block.

Value must not be null.

Inherited from
Blockly.geras.PathObject#applyColour
Implements
Blockly.blockRendering.IPathObject#applyColour

flipRTL

package

flipRTL()

Flip the SVG paths in RTL.

Inherited from
Blockly.geras.PathObject#flipRTL
Implements
Blockly.blockRendering.IPathObject#flipRTL

setClass_

protected

setClass_(className, add)

Add or remove the given CSS class on the path object's root SVG element.

Parameter

className

The name of the class to add or remove

add

True if the class should be added. False if it should be removed.

Inherited from
Blockly.blockRendering.PathObject#setClass_

setCursorSvg

package

setCursorSvg(cursorSvg)

Add the cursor svg to this block's svg group.

Parameter

cursorSvg

The svg root of the cursor to be added to the block svg group.

Inherited from
Blockly.blockRendering.PathObject#setCursorSvg
Implements
Blockly.blockRendering.IPathObject#setCursorSvg

setHighlightPath

package

setHighlightPath(highlightPath)

Set the highlight path generated by the renderer onto the SVG element.

Parameter

highlightPath

string

The highlight path.

setMarkerSvg

package

setMarkerSvg(markerSvg)

Add the marker svg to this block's svg group.

Parameter

markerSvg

The svg root of the marker to be added to the block svg group.

Inherited from
Blockly.blockRendering.PathObject#setMarkerSvg
Implements
Blockly.blockRendering.IPathObject#setMarkerSvg

setPath

package

setPath(pathString)

Set the path generated by the renderer onto the respective SVG element.

Parameter

pathString

The path.

Inherited from
Blockly.geras.PathObject#setPath
Implements
Blockly.blockRendering.IPathObject#setPath

setStyle

package

setStyle(blockStyle)

Set the style.

Parameter

blockStyle

The block style to use.

Value must not be null.

Inherited from
Blockly.geras.PathObject#setStyle
Implements
Blockly.blockRendering.IPathObject#setStyle

updateDisabled_

protected

updateDisabled_(disabled)

Updates the look of the block to reflect a disabled state.

Parameter

disabled

True if disabled.

Inherited from
Blockly.geras.PathObject#updateDisabled_

updateDraggingDelete

package

updateDraggingDelete(enable)

Add or remove styling showing that a block is dragged over a delete area.

Parameter

enable

True if the block is being dragged over a delete area, false otherwise.

Inherited from
Blockly.blockRendering.PathObject#updateDraggingDelete
Implements
Blockly.blockRendering.IPathObject#updateDraggingDelete

updateHighlighted

package

updateHighlighted(enable)

Set whether the block shows a highlight or not. Block highlighting is often used to visually mark blocks currently being executed.

Parameter

enable

True if highlighted.

Inherited from
Blockly.geras.PathObject#updateHighlighted
Implements
Blockly.blockRendering.IPathObject#updateHighlighted

updateInsertionMarker

package

updateInsertionMarker(enable)

Add or remove styling showing that a block is an insertion marker.

Parameter

enable

True if the block is an insertion marker, false otherwise.

Inherited from
Blockly.blockRendering.PathObject#updateInsertionMarker
Implements
Blockly.blockRendering.IPathObject#updateInsertionMarker

updateMovable

package

updateMovable(enable)

Add or remove styling showing that a block is movable.

Parameter

enable

True if the block is movable, false otherwise.

Inherited from
Blockly.blockRendering.PathObject#updateMovable
Implements
Blockly.blockRendering.IPathObject#updateMovable

updateReplacementFade

package

updateReplacementFade(enable)

Add or remove styling that shows that if the dragging block is dropped, this block will be replaced. If a shadow block, it will disappear. Otherwise it will bump.

Parameter

enable

True if styling should be added.

Inherited from
Blockly.blockRendering.PathObject#updateReplacementFade
Implements
Blockly.blockRendering.IPathObject#updateReplacementFade

updateSelected

package

updateSelected(enable)

Add or remove styling showing that a block is selected.

Parameter

enable

True if selection is enabled, false otherwise.

Inherited from
Blockly.blockRendering.PathObject#updateSelected
Implements
Blockly.blockRendering.IPathObject#updateSelected

updateShadow_

protected

updateShadow_(shadow)

Updates the look of the block to reflect a shadow state.

Parameter

shadow

True if the block is a shadow block.

Inherited from
Blockly.geras.PathObject#updateShadow_

updateShapeForInputHighlight

package

updateShapeForInputHighlight(_conn, _enable)

Add or remove styling that shows that if the dragging block is dropped, this block will be connected to the input.

Parameter

_conn

The connection on the input to highlight.

_enable

True if styling should be added.

Inherited from
Blockly.blockRendering.PathObject#updateShapeForInputHighlight