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.zelos.ConstantProvider

The renderer's constants.

Value must not be null.

Extends
Blockly.blockRendering.PathObject

Properties

constants_

non-null Blockly.zelos.ConstantProvider

The renderer's constant provider.

outputShapeType

package

The type of block's output connection shape. This is set when a block with an output connection is drawn.

style

package

unknown

The style object to use when colouring block paths.

Inherited from
Blockly.blockRendering.PathObject#style

svgPath

package

unknown

The primary path of the block.

Inherited from
Blockly.blockRendering.PathObject#svgPath

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.zelos.PathObject#applyColour
Implements
Blockly.blockRendering.IPathObject#applyColour

beginDrawing

package

beginDrawing()

Method that's called when the drawer is about to draw the block.

endDrawing

package

endDrawing()

Method that's called when the drawer is done drawing.

flipRTL

package

flipRTL()

Flip the SVG paths in RTL.

Inherited from
Blockly.zelos.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

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

setOutlinePath

package

setOutlinePath(name, pathString)

Set the path generated by the renderer for an outline path on the respective outline path SVG element.

Parameter

name

string

The input name.

pathString

string

The path.

setPath

package

setPath(pathString)

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

Parameter

pathString

The path.

Inherited from
Blockly.zelos.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.blockRendering.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.blockRendering.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.blockRendering.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

updateReplacementHighlight

package

updateReplacementHighlight(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.zelos.PathObject#updateReplacementHighlight
Implements
Blockly.blockRendering.IPathObject#updateReplacementHighlight

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.zelos.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.blockRendering.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.zelos.PathObject#updateShapeForInputHighlight