File

packages/ast-to-mmd/src/app/graph-blocks/case-declaration.graph-block.ts

Extends

BlockDeclarationGraphBlock

Index

Properties
Methods
Accessors

Constructor

constructor(id: string, children: GraphBlock[], condition: string)
Parameters :
Name Type Optional
id string No
children GraphBlock[] No
condition string No

Properties

Public Readonly condition
Type : string
Private _lazyDependencies
Type : string[]
Default value : []
Inherited from GraphBlock
Defined in GraphBlock:30

Lazy dependencies ready to render when this node is rendered.

Private _parent
Type : GraphBlock | undefined
Default value : undefined
Inherited from GraphBlock
Defined in GraphBlock:25

Parent of current node in graph. Can be undefined.

Private _parentSiblingCondition
Type : SiblingCondition
Inherited from GraphBlock
Defined in GraphBlock:39

SiblingCondition for finding correct parent.

Private _siblingCondition
Type : SiblingCondition
Inherited from GraphBlock
Defined in GraphBlock:35
Private Static Readonly EMPTY_LINE_RENDERER_MODIFIER
Type : LineRendererModifier
Default value : () => {...}
Inherited from GraphBlock
Defined in GraphBlock:20

Empty implementation of LineRendererModifier.

Public Readonly id
Type : string
Inherited from GraphBlock
Defined in GraphBlock:46
Unique ID in the node graph.
Private Static Readonly POSITIVE_SIBLING_CONDITION
Type : SiblingCondition
Default value : new PositiveSiblingCondition()
Inherited from GraphBlock
Defined in GraphBlock:16

Positive sibling condition default for all GraphBlock.

Private Static Readonly SHAPE_RENDERER
Type : ShapeRenderer
Default value : new ShapeRenderer()
Inherited from GraphBlock
Defined in GraphBlock:12

Shape renderer for generating different shapes in graph.

Methods

Protected createLineBuilder
createLineBuilder(lhsId: string, rhsId: string)
Inherited from GraphBlock
Defined in GraphBlock:71
Parameters :
Name Type Optional
lhsId string No
rhsId string No
Returns : LineRenderer
Public render
render(_indent: number)
Inherited from GraphBlock
Defined in GraphBlock:13
Parameters :
Name Type Optional
_indent number No
Returns : string
Protected renderChildren
renderChildren(indent: number, children: GraphBlock[])
Parameters :
Name Type Optional
indent number No
children GraphBlock[] No
Returns : string
Protected renderDependencies
renderDependencies(_indent: number)
Parameters :
Name Type Optional
_indent number No
Returns : string
Private __multiFindChildIndex
__multiFindChildIndex(children: GraphBlock[][], child: GraphBlock)
Inherited from GraphBlock
Defined in GraphBlock:575

Private method for finding a child index of defined block in a multidimensional array of children.

Parameters :
Name Type Optional Description
children GraphBlock[][] No

[] Multidimensional array of children including the child.

child GraphBlock No

GraphBlock Wanted child.

Returns : | undefined

Coordinates of child block or undefined when block is not found.

Private __renderLines
__renderLines(indent: number, id: string, ids: string[], direction: "left" | "right", builderModifier: LineRendererModifier[])
Inherited from GraphBlock
Defined in GraphBlock:546

Private method for rendering lines between nodes in defined directions.

Parameters :
Name Type Optional Description
indent number No

Indentation from start of the line.

id string No

ID of one side of connection.

ids string[] No

Array of IDs of end of a connection.

direction "left" | "right" No

Direction of a line.

builderModifier LineRendererModifier[] No

Optional modifier of current line.

Returns : string

Rendered line.

Protected _assignParent
_assignParent(children: GraphBlock[])
Inherited from GraphBlock
Defined in GraphBlock:289

Helper method for assigning this parent into each children.

Parameters :
Name Type Optional Description
children GraphBlock[] No

[]GraphBlock Children where this parent is going to be assigned.

Returns : void
Protected _filterChildren
_filterChildren(children: GraphBlock[])
Inherited from GraphBlock
Defined in GraphBlock:466

Helper method for filtering array of children.

Parameters :
Name Type Optional Description
children GraphBlock[] No

[]GraphBlock Array of children.

Returns : GraphBlock[]
Protected _findParentBySiblingCondition
_findParentBySiblingCondition(child: GraphBlock, siblingCondition: SiblingCondition)
Inherited from GraphBlock
Defined in GraphBlock:521

Helper method for finding an indirect parent of defined child by SiblingCondition.

Parameters :
Name Type Optional Description
child GraphBlock No

GraphBlock Child whose parent is wanted.

siblingCondition SiblingCondition No

SiblingCondition.

Protected _findSiblingChild
_findSiblingChild(child: GraphBlock, parentSiblingCondition: SiblingCondition, siblingCondition: SiblingCondition)
Inherited from GraphBlock
Defined in GraphBlock:478

Helper method for finding a sibling of defined child in parents children.

Parameters :
Name Type Optional Default value Description
child GraphBlock No

GraphBlock Node which for sibling is looked for.

parentSiblingCondition SiblingCondition No this.siblingCondition

SiblingCondition.

siblingCondition SiblingCondition No this.siblingCondition

SiblingCondition.

Protected _generateSpace
_generateSpace(count: number)
Inherited from GraphBlock
Defined in GraphBlock:301

Helper method for generating space.

Parameters :
Name Type Optional Description
count number No

Count of space.

Returns : string

Space of defined length.

Protected _multiFilterChildren
_multiFilterChildren(children: GraphBlock[][])
Inherited from GraphBlock
Defined in GraphBlock:456

Helper method for filtering children in multidimensional array of children.

Parameters :
Name Type Optional Description
children GraphBlock[][] No

[] Array of children.

Returns : [][]
Protected _renderConnectionWithParent
_renderConnectionWithParent(indent: number, children: GraphBlock, lastIds: string[], priorityBuilderModifier: LineRendererModifier[])
Inherited from GraphBlock
Defined in GraphBlock:410
Parameters :
Name Type Optional
indent number No
children GraphBlock No
lastIds string[] No
priorityBuilderModifier LineRendererModifier[] No
Returns : string
Protected _renderDependencies
_renderDependencies(indent: number, blocks: GraphBlock[])
Inherited from GraphBlock
Defined in GraphBlock:346

Helper method for rendering dependencies with defined indent between blocks.

Parameters :
Name Type Optional Description
indent number No

Indentation from start of the line.

blocks GraphBlock[] No

[]GraphBlock Blocks to render dependencies between each node.

Returns : string

Dependencies of blocks.

Protected _renderLine
_renderLine(indent: number, lhsId: string, rhsId: string, builderModifier: LineRendererModifier[])
Inherited from GraphBlock
Defined in GraphBlock:314

Helper method for generating line between two nodes.

Parameters :
Name Type Optional Description
indent number No

Indentation from start of the line.

lhsId string No

ID of start node.

rhsId string No

ID of end node.

builderModifier LineRendererModifier[] No
Returns : string

Line definition between two nodes.

Protected _renderLinesL2R
_renderLinesL2R(indent: number, toId: string, fromIds: string[], builderModifier: LineRendererModifier[])
Inherited from GraphBlock
Defined in GraphBlock:383

Helper method for rendering line starting in one node and ending in multiple nodes.

Parameters :
Name Type Optional Description
indent number No

Indentation from start of the line.

toId string No

ID of start node.

fromIds string[] No

Array of end nodes.

builderModifier LineRendererModifier[] No

Optional modifier of current line.

Returns : string

Rendered line.

Protected _renderLinesR2L
_renderLinesR2L(indent: number, fromId: string, toIds: string[], builderModifier: LineRendererModifier[])
Inherited from GraphBlock
Defined in GraphBlock:401

Helper method for rendering line starting in multiple nodes and ending in one node.

Parameters :
Name Type Optional Description
indent number No

Indentation from start of the line.

fromId string No

Array of start nodes.

toIds string[] No

ID of end node.

builderModifier LineRendererModifier[] No

Optional modifier of current line.

Returns : string

Rendered line.

Protected _renderShape
_renderShape(text: string, shape: Shape)
Inherited from GraphBlock
Defined in GraphBlock:335

Helper method for rendering defined shape with text.

Parameters :
Name Type Optional Description
text string No

Text in shape.

shape Shape No

Shape Type of shape.

Returns : string

Rendered shape with text.

Protected renderInSubgraph
renderInSubgraph(_indent: number, id: string, text: string, bodyRenderer: (indent: number) => void, direction: "TB" | "TD" | "BT" | "LR" | "RL")
Inherited from GraphBlock
Defined in GraphBlock:86

Renders current node wrapped in a subgraph.

Direction options:

  • TB - top to bottom (default)
  • TD - top-down / same as top to bottom
  • BT - bottom to top
  • LR - left to rignt
  • RL - right to left
Parameters :
Name Type Optional Default value Description
_indent number No

Indentation from start of the line.

id string No

ID of a subgraph.

text string No

Name of a subgraph.

bodyRenderer function No

Callback responsible for rendering real node content.

direction "TB" | "TD" | "BT" | "LR" | "RL" No 'TB'

Direction of a subgraph.

Returns : string

Graph wrapped in a subgraph.

Public renderLazyDependencies
renderLazyDependencies(_indent: number)
Inherited from GraphBlock
Defined in GraphBlock:63

Renders lazy dependencies of current node.

Parameters :
Name Type Optional Description
_indent number No

Indentiation from start of the line.

Returns : string
Public toString
toString()
Inherited from GraphBlock
Defined in GraphBlock:589
Returns : string

Accessors

blockKind
getblockKind()
import { BlockKind } from '../block.kind';
import { BlockDeclarationGraphBlock } from './block-declaration.graph-block';
import { GraphBlock } from './graph-block';

export class CaseDeclarationGraphBlock extends BlockDeclarationGraphBlock {

  constructor(id: string, children: GraphBlock[], public readonly condition: string) {
    super(id, children);
  }

  public override get blockKind(): BlockKind {
    return BlockKind.CASE_DECLARATION;
  }

  // public override get firstBlock(): GraphBlock {
  //   return this;
  // }

}

results matching ""

    No results matching ""