Blockly.zelos. PathObject
An object that handles creating and setting each of the SVG elements used by the renderer.
Constructor
PathObject
new PathObject(root, style, constants)
Parameter |
|
---|---|
root |
The root SVG element. Value must not be null. |
style |
The style object to use for colouring. Value must not be null. |
constants |
The renderer's constants. Value must not be null. |
Properties
constants
non-null Blockly.zelos.ConstantProvider
The renderer's constant provider.
cursorSvg
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
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
outputShapeType
The type of block's output connection shape. This is set when a block with an output connection is drawn.
style
unknown
The style object to use when colouring block paths.
- Inherited from
- Blockly.blockRendering.PathObject#style
- Implements
- Blockly.blockRendering.IPathObject#style
svgPath
unknown
The primary path of the block.
- Inherited from
- Blockly.blockRendering.PathObject#svgPath
- Implements
- Blockly.blockRendering.IPathObject#svgPath
svgRoot
unknown
- Inherited from
- Blockly.blockRendering.PathObject#svgRoot
Methods
applyColour
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
beginDrawing()
Method that's called when the drawer is about to draw the block.
endDrawing
endDrawing()
Method that's called when the drawer is done drawing.
flipRTL
flipRTL()
Flip the SVG paths in RTL.
- Inherited from
- Blockly.zelos.PathObject#flipRTL
- Implements
- Blockly.blockRendering.IPathObject#flipRTL
setClass_
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
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
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
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
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
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_
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
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
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
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
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
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.zelos.PathObject#updateReplacementFade
- Implements
- Blockly.blockRendering.IPathObject#updateReplacementFade
updateSelected
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_
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
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