Class: Drawer
Defined in: packages/blockly/core/renderers/geras/drawer.ts:23
An object that draws a block based on the given rendering information, customized for the geras renderer.
Extends
Properties index
| Property | Description |
|---|---|
| block_ | - |
| info_ | - |
| topLeft_ | - |
| outlinePath_ | - |
| inlinePath_ | - |
| highlighter_ | - |
| constants_ | - |
Methods index
| Method | Description |
|---|---|
| recordSizeOnBlock_ | Save sizing information back to the block Most of the rendering information can be thrown away at the end of the render. Anything that needs to be kept around should be set in this function. |
| drawOutline_ | Create the outline of the block. This is a single continuous path. |
| drawInternals_ | Draw the internals of the block: inline inputs, fields, and icons. These do not depend on the outer path for placement. |
| layoutField_ | Push a field or icon's new position to its SVG root. |
| positionPreviousConnection_ | Position the previous connection on a block. |
| positionOutputConnection_ | Position the output connection on a block. |
| updateConnectionHighlights | Updates the path object to reflect which connections on the block are highlighted. |
| drawConnectionHighlightPath | Returns a path to highlight the given connection. |
| draw | Draw the block to the workspace. Here "drawing" means setting SVG path elements and moving fields, icons, and connections on the screen. |
| drawTop_ | Add steps for the top corner of the block, taking into account details such as hats and rounded corners. |
| drawJaggedEdge_ | Add steps for the jagged edge of a row on a collapsed block. |
| drawValueInput_ | Add steps for an external value input, rendered as a notch in the side of the block. |
| drawStatementInput_ | Add steps for a statement input. |
| drawRightSideRow_ | Add steps for the right side of a row that does not have value or statement input connections. |
| drawBottom_ | Add steps for the bottom edge of a block, possibly including a notch for the next connection. |
| drawLeft_ | Add steps for the left side of the block, which may include an output connection |
| drawInlineInput_ | Add steps for an inline input. |
| positionInlineInputConnection_ | Position the connection on an inline value input, taking into account RTL and the small gap between the parent block and child block which lets the parent block's dark path show through. |
| positionStatementInputConnection_ | Position the connection on a statement input, taking into account RTL and the small gap between the parent block and child block which lets the parent block's dark path show through. |
| positionExternalValueConnection_ | Position the connection on an external value input, taking into account RTL and the small gap between the parent block and child block which lets the parent block's dark path show through. |
| positionNextConnection_ | Position the next connection on a block. |
Constructors
Constructor
new Drawer(block, info): Drawer;
Defined in: packages/blockly/core/renderers/geras/drawer.ts:33
Parameters
| Parameter | Type | Description |
|---|---|---|
block | BlockSvg | The block to render. |
info | RenderInfo | An object containing all information needed to render this block. |
Returns
Drawer
Overrides
Properties
block_
block_: BlockSvg;
Defined in: packages/blockly/core/renderers/common/drawer.ts:28
Inherited from
info_
info_: RenderInfo;
Defined in: packages/blockly/core/renderers/common/drawer.ts:29
Inherited from
topLeft_
topLeft_: Coordinate;
Defined in: packages/blockly/core/renderers/common/drawer.ts:30
Inherited from
outlinePath_
outlinePath_: string = '';
Defined in: packages/blockly/core/renderers/common/drawer.ts:31
Inherited from
inlinePath_
inlinePath_: string = '';
Defined in: packages/blockly/core/renderers/common/drawer.ts:32
Inherited from
highlighter_
highlighter_: Highlighter;
Defined in: packages/blockly/core/renderers/geras/drawer.ts:24
constants_
constants_: ConstantProvider;
Defined in: packages/blockly/core/renderers/geras/drawer.ts:26
Overrides
Methods
recordSizeOnBlock_()
protected recordSizeOnBlock_(): void;
Defined in: packages/blockly/core/renderers/common/drawer.ts:76
Save sizing information back to the block Most of the rendering information can be thrown away at the end of the render. Anything that needs to be kept around should be set in this function.
Returns
void
Inherited from
drawOutline_()
protected drawOutline_(): void;
Defined in: packages/blockly/core/renderers/common/drawer.ts:85
Create the outline of the block. This is a single continuous path.
Returns
void
Inherited from
drawInternals_()
protected drawInternals_(): void;
Defined in: packages/blockly/core/renderers/common/drawer.ts:265
Draw the internals of the block: inline inputs, fields, and icons. These do not depend on the outer path for placement.
Returns
void
Inherited from
layoutField_()
protected layoutField_(fieldInfo): void;
Defined in: packages/blockly/core/renderers/common/drawer.ts:282
Push a field or icon's new position to its SVG root.
Parameters
| Parameter | Type | Description |
|---|---|---|
fieldInfo | | Icon | Field | The rendering information for the field or icon. |
Returns
void
Inherited from
positionPreviousConnection_()
protected positionPreviousConnection_(): void;
Defined in: packages/blockly/core/renderers/common/drawer.ts:398
Position the previous connection on a block.
Returns
void
Inherited from
Drawer.positionPreviousConnection_
positionOutputConnection_()
protected positionOutputConnection_(): void;
Defined in: packages/blockly/core/renderers/common/drawer.ts:420
Position the output connection on a block.
Returns
void
Inherited from
Drawer.positionOutputConnection_
updateConnectionHighlights()
protected updateConnectionHighlights(): void;
Defined in: packages/blockly/core/renderers/common/drawer.ts:436
Updates the path object to reflect which connections on the block are highlighted.
Returns
void
Inherited from
Drawer.updateConnectionHighlights
drawConnectionHighlightPath()
drawConnectionHighlightPath(measurable): SVGElement | undefined;
Defined in: packages/blockly/core/renderers/common/drawer.ts:454
Returns a path to highlight the given connection.
Parameters
| Parameter | Type |
|---|---|
measurable | Connection |
Returns
SVGElement | undefined
Inherited from
Drawer.drawConnectionHighlightPath
draw()
draw(): void;
Defined in: packages/blockly/core/renderers/geras/drawer.ts:39
Draw the block to the workspace. Here "drawing" means setting SVG path elements and moving fields, icons, and connections on the screen.
The pieces of the paths are pushed into arrays of "steps", which are then joined with spaces and set directly on the block. This guarantees that the steps are separated by spaces for improved readability, but isn't required.
Returns
void
Overrides
drawTop_()
drawTop_(): void;
Defined in: packages/blockly/core/renderers/geras/drawer.ts:53
Add steps for the top corner of the block, taking into account details such as hats and rounded corners.
Returns
void
Overrides
drawJaggedEdge_()
drawJaggedEdge_(row): void;
Defined in: packages/blockly/core/renderers/geras/drawer.ts:60
Add steps for the jagged edge of a row on a collapsed block.
Parameters
| Parameter | Type | Description |
|---|---|---|
row | Row | The row to draw the side of. |
Returns
void
Overrides
drawValueInput_()
drawValueInput_(row): void;
Defined in: packages/blockly/core/renderers/geras/drawer.ts:66
Add steps for an external value input, rendered as a notch in the side of the block.
Parameters
| Parameter | Type | Description |
|---|---|---|
row | Row | The row that this input belongs to. |
Returns
void
Overrides
drawStatementInput_()
drawStatementInput_(row): void;
Defined in: packages/blockly/core/renderers/geras/drawer.ts:72
Add steps for a statement input.
Parameters
| Parameter | Type | Description |
|---|---|---|
row | Row | The row that this input belongs to. |
Returns
void
Overrides
drawRightSideRow_()
drawRightSideRow_(row): void;
Defined in: packages/blockly/core/renderers/geras/drawer.ts:78
Add steps for the right side of a row that does not have value or statement input connections.
Parameters
| Parameter | Type | Description |
|---|---|---|
row | Row | The row to draw the side of. |
Returns
void
Overrides
drawBottom_()
drawBottom_(): void;
Defined in: packages/blockly/core/renderers/geras/drawer.ts:86
Add steps for the bottom edge of a block, possibly including a notch for the next connection.
Returns
void
Overrides
drawLeft_()
protected drawLeft_(): void;
Defined in: packages/blockly/core/renderers/geras/drawer.ts:96
Add steps for the left side of the block, which may include an output connection
Returns
void
Overrides
drawInlineInput_()
drawInlineInput_(input): void;
Defined in: packages/blockly/core/renderers/geras/drawer.ts:102
Add steps for an inline input.
Parameters
| Parameter | Type | Description |
|---|---|---|
input | InlineInput | The information about the input to render. |
Returns
void
Overrides
positionInlineInputConnection_()
positionInlineInputConnection_(input): void;
Defined in: packages/blockly/core/renderers/geras/drawer.ts:108
Position the connection on an inline value input, taking into account RTL and the small gap between the parent block and child block which lets the parent block's dark path show through.
Parameters
| Parameter | Type | Description |
|---|---|---|
input | InlineInput | The information about the input that the connection is on. |
Returns
void
Overrides
Drawer.positionInlineInputConnection_
positionStatementInputConnection_()
positionStatementInputConnection_(row): void;
Defined in: packages/blockly/core/renderers/geras/drawer.ts:125
Position the connection on a statement input, taking into account RTL and the small gap between the parent block and child block which lets the parent block's dark path show through.
Parameters
| Parameter | Type | Description |
|---|---|---|
row | Row | The row that the connection is on. |
Returns
void
Overrides
Drawer.positionStatementInputConnection_
positionExternalValueConnection_()
positionExternalValueConnection_(row): void;
Defined in: packages/blockly/core/renderers/geras/drawer.ts:141
Position the connection on an external value input, taking into account RTL and the small gap between the parent block and child block which lets the parent block's dark path show through.
Parameters
| Parameter | Type | Description |
|---|---|---|
row | Row | The row that the connection is on. |
Returns
void
Overrides
Drawer.positionExternalValueConnection_
positionNextConnection_()
positionNextConnection_(): void;
Defined in: packages/blockly/core/renderers/geras/drawer.ts:152
Position the next connection on a block.
Returns
void