Class: PathObject
Defined in: packages/blockly/core/renderers/zelos/path_object.ts:21
An object that handles creating and setting each of the SVG elements used by the renderer.
Extends
Properties index
| Property | Description |
|---|---|
| svgRoot | - |
| svgPath | The primary path of the block. |
| style | The primary path of the block. |
| outputShapeType | The type of block's output connection shape. This is set when a block with an output connection is drawn. |
| constants | The renderer's constant provider. |
Methods index
| Method | Description |
|---|---|
| setStyle | Set the style. |
| setClass_ | Add or remove the given CSS class on the path object's root SVG element. |
| updateHighlighted | Set whether the block shows a highlight or not. Block highlighting is often used to visually mark blocks currently being executed. |
| updateShadow_ | Updates the look of the block to reflect a shadow state. |
| updateDisabled_ | Updates the look of the block to reflect a disabled state. |
| updateDraggingDelete | Add or remove styling showing that a block is dragged over a delete area. |
| updateInsertionMarker | Add or remove styling showing that a block is an insertion marker. |
| updateMovable | Add or remove styling showing that a block is movable. |
| updateReplacing | Add or remove styling indicating that a block will be bumped out and replaced by another block that is mid-move. |
| addConnectionHighlight | Adds the given path as a connection highlight for the given connection. |
| removeConnectionHighlight | Removes any highlight associated with the given connection, if it exists. |
| setPath | Set the path generated by the renderer onto the respective SVG element. |
| applyColour | Apply the stored colours to the block's path, taking into account whether the paths belong to a shadow block. |
| flipRTL | Flip the SVG paths in RTL. |
| updateSelected | Add or remove styling showing that a block is selected. |
| beginDrawing | Method that's called when the drawer is about to draw the block. |
| endDrawing | Method that's called when the drawer is done drawing. |
| setOutlinePath | Set the path generated by the renderer for an outline path on the respective outline path SVG element. |
Constructors
Constructor
new PathObject(
root,
style,
constants
): PathObject;
Defined in: packages/blockly/core/renderers/zelos/path_object.ts:49
Parameters
| Parameter | Type | Description |
|---|---|---|
root | SVGElement | The root SVG element. |
style | BlockStyle | The style object to use for colouring. |
constants | ConstantProvider | The renderer's constants. |
Returns
PathObject
Overrides
Properties
svgRoot
svgRoot: SVGElement;
Defined in: packages/blockly/core/renderers/common/path_object.ts:23
Inherited from
svgPath
svgPath: SVGElement;
Defined in: packages/blockly/core/renderers/common/path_object.ts:24
The primary path of the block.
Inherited from
style
style: BlockStyle;
Defined in: packages/blockly/core/renderers/common/path_object.ts:27
The primary path of the block.
Inherited from
outputShapeType
outputShapeType: number | null = null;
Defined in: packages/blockly/core/renderers/zelos/path_object.ts:40
The type of block's output connection shape. This is set when a block with an output connection is drawn.
constants
constants: ConstantProvider;
Defined in: packages/blockly/core/renderers/zelos/path_object.ts:42
The renderer's constant provider.
Overrides
Methods
setStyle()
setStyle(blockStyle): void;
Defined in: packages/blockly/core/renderers/common/path_object.ts:95
Set the style.
Parameters
| Parameter | Type | Description |
|---|---|---|
blockStyle | BlockStyle | The block style to use. |
Returns
void
Inherited from
setClass_()
protected setClass_(className, add): void;
Defined in: packages/blockly/core/renderers/common/path_object.ts:106
Add or remove the given CSS class on the path object's root SVG element.
Parameters
| Parameter | Type | Description |
|---|---|---|
className | string | The name of the class to add or remove |
add | boolean | True if the class should be added. False if it should be removed. |
Returns
void
Inherited from
updateHighlighted()
updateHighlighted(enable): void;
Defined in: packages/blockly/core/renderers/common/path_object.ts:124
Set whether the block shows a highlight or not. Block highlighting is often used to visually mark blocks currently being executed.
Parameters
| Parameter | Type | Description |
|---|---|---|
enable | boolean | True if highlighted. |
Returns
void
Inherited from
updateShadow_()
protected updateShadow_(shadow): void;
Defined in: packages/blockly/core/renderers/common/path_object.ts:137
Updates the look of the block to reflect a shadow state.
Parameters
| Parameter | Type | Description |
|---|---|---|
shadow | boolean | True if the block is a shadow block. |
Returns
void
Inherited from
updateDisabled_()
protected updateDisabled_(disabled): void;
Defined in: packages/blockly/core/renderers/common/path_object.ts:152
Updates the look of the block to reflect a disabled state.
Parameters
| Parameter | Type | Description |
|---|---|---|
disabled | boolean | True if disabled. |
Returns
void
Inherited from
updateDraggingDelete()
updateDraggingDelete(enable): void;
Defined in: packages/blockly/core/renderers/common/path_object.ts:172
Add or remove styling showing that a block is dragged over a delete area.
Parameters
| Parameter | Type | Description |
|---|---|---|
enable | boolean | True if the block is being dragged over a delete area, false otherwise. |
Returns
void
Inherited from
PathObject.updateDraggingDelete
updateInsertionMarker()
updateInsertionMarker(enable): void;
Defined in: packages/blockly/core/renderers/common/path_object.ts:181
Add or remove styling showing that a block is an insertion marker.
Parameters
| Parameter | Type | Description |
|---|---|---|
enable | boolean | True if the block is an insertion marker, false otherwise. |
Returns
void
Inherited from
PathObject.updateInsertionMarker
updateMovable()
updateMovable(enable): void;
Defined in: packages/blockly/core/renderers/common/path_object.ts:190
Add or remove styling showing that a block is movable.
Parameters
| Parameter | Type | Description |
|---|---|---|
enable | boolean | True if the block is movable, false otherwise. |
Returns
void
Inherited from
updateReplacing()
updateReplacing(replacing): void;
Defined in: packages/blockly/core/renderers/common/path_object.ts:201
Add or remove styling indicating that a block will be bumped out and replaced by another block that is mid-move.
Parameters
| Parameter | Type | Description |
|---|---|---|
replacing | boolean | True if the block is at risk of being replaced, false otherwise. |
Returns
void
Inherited from
addConnectionHighlight()
addConnectionHighlight(
connection,
connectionPath,
offset,
rtl
): SVGElement;
Defined in: packages/blockly/core/renderers/common/path_object.ts:206
Adds the given path as a connection highlight for the given connection.
Parameters
| Parameter | Type |
|---|---|
connection | RenderedConnection |
connectionPath | string |
offset | Coordinate |
rtl | boolean |
Returns
SVGElement
Inherited from
PathObject.addConnectionHighlight
removeConnectionHighlight()
removeConnectionHighlight(connection): void;
Defined in: packages/blockly/core/renderers/common/path_object.ts:241
Removes any highlight associated with the given connection, if it exists.
Parameters
| Parameter | Type |
|---|---|
connection | RenderedConnection |
Returns
void
Inherited from
PathObject.removeConnectionHighlight
setPath()
setPath(pathString): void;
Defined in: packages/blockly/core/renderers/zelos/path_object.ts:59
Set the path generated by the renderer onto the respective SVG element.
Parameters
| Parameter | Type | Description |
|---|---|---|
pathString | string | The path. |
Returns
void
Overrides
applyColour()
applyColour(block): void;
Defined in: packages/blockly/core/renderers/zelos/path_object.ts:66
Apply the stored colours to the block's path, taking into account whether the paths belong to a shadow block.
Parameters
| Parameter | Type | Description |
|---|---|---|
block | BlockSvg | The source block. |
Returns
void
Overrides
flipRTL()
flipRTL(): void;
Defined in: packages/blockly/core/renderers/zelos/path_object.ts:80
Flip the SVG paths in RTL.
Returns
void
Overrides
updateSelected()
updateSelected(enable): void;
Defined in: packages/blockly/core/renderers/zelos/path_object.ts:89
Add or remove styling showing that a block is selected.
Parameters
| Parameter | Type | Description |
|---|---|---|
enable | boolean | True if selection is enabled, false otherwise. |
Returns
void
Overrides
beginDrawing()
beginDrawing(): void;
Defined in: packages/blockly/core/renderers/zelos/path_object.ts:119
Method that's called when the drawer is about to draw the block.
Returns
void
endDrawing()
endDrawing(): void;
Defined in: packages/blockly/core/renderers/zelos/path_object.ts:129
Method that's called when the drawer is done drawing.
Returns
void
setOutlinePath()
setOutlinePath(name, pathString): void;
Defined in: packages/blockly/core/renderers/zelos/path_object.ts:147
Set the path generated by the renderer for an outline path on the respective outline path SVG element.
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | The input name. |
pathString | string | The path. |
Returns
void