Class Node

Represents a Node object.

Implements

Implements

Hierarchy

Implements

Constructors

  • constructor

    Parameters

    • flow: Flow

      a reference to the flow component

    • left: number

      The horizontal position of the node to create.

    • top: number

      The vertical position of the node to create.

    • width: number

      The width of the node to create.

    • height: number

      The height of the node to create.

    • Optional text: string

      A string to be displayed in the node to create.

    Returns Node

Properties

drawShape: ((ctx, x, y, w, h) => void)

Type declaration

    • (ctx, x, y, w, h): void
    • The method used to draw the contentItem shape if the shapeFamily property is 'other'

      Parameters

      • ctx: CanvasRenderingContext2D
      • x: number
      • y: number
      • w: number
      • h: number

      Returns void

      Default

      null
      
fillShape: ((ctx, x, y, w, h) => void)

Type declaration

    • (ctx, x, y, w, h): void
    • The method used to fill the contentItem shape.

      Parameters

      • ctx: CanvasRenderingContext2D
      • x: number
      • y: number
      • w: number
      • h: number

      Returns void

      Default

      null
      
fillStyle: string

The color used to fill the item

flow: Flow = null

A reference of the AddFlow component containing this item

font: string

The font used to display the text of the item

gradientFillStyle: string

The color used to create a gradient with the fillStyle color

image: HTMLImageElement = null

The image displayed in the contentItem

imageMargin: Margin = ...

Returns/sets the margins of the image in the contentItem.

imagePosition: ImagePosition = ImagePosition.CenterMiddle

Used to specify the position of the image in the contentItem. leftTop leftMiddle leftBottom rightTop rightMiddle rightBottom centerTop centerMiddle centerBottom

Default

centerMiddle
isContext: boolean = true

Determines if a context handle is displayed when the node is selected

Default

true
isExcludedFromLayout: boolean

Determines whether the item is excluded by a layout algorithm

Default

false
isHidden: boolean

Determines whether the item is hidden

Default

false
isHitTestVisible: boolean

Determines whether the item can be hit tested

Default

true
isInLinkable: boolean = true

Determines whether the node accept incoming links

Default

true
isOutLinkable: boolean = true

Determines whether the node can be vertically moved or not

Default

true
isSelectable: boolean

Determines whether the item is selectable by clicking on it with the mouse or unselectable (readonly or inactive)

Default

true
isShadowed: boolean

Determines whether a shadow is displayed for the item

Default

false
isXMoveable: boolean = true

Determines whether the contentItem can be moved horizontally moved or not

Default

true
isXSizeable: boolean = true

Determines whether the node can be resized horizontally resized or not.

Default

true
isYMoveable: boolean = true

Determines whether the contentItem can be moved vertically

Default

true
isYSizeable: boolean = true

Determines whether the node can be resized vertically resized or not.

Default

true
lineWidth: number

The thickness of the lines used to draw the item

Default

1
opacity: number

The opacity of the item

Default

1
pins: Point[] = []

Sets or gets the list of node pins

Default

null
polygon: Point[] = []

The set of points defining the contentItem shape if if the shapeFamily property is 'polygon'.

Default

null
shapeFamily: ShapeFamily = ShapeFamily.Ellipse

ellipse, rectangle, polygon, other

strokeStyle: string

The color used to draw the item

tag: any

Sets or returns a tag associated with the item.

Default

null
text: string

Sets or returns the text associated with the item. If the item is a node, the text is displayed inside the node. It is a multiline display. The text is wrapped automatically inside the node. Linefeed and carriage return characters are allowed.

textFillStyle: string

The color used to display the text of the item

textLineHeight: number = 8

The height of a line of the text of the contentItem

textMargin: Margin = ...

Returns/sets the margins of the text in the contentItem.

textPosition: TextPosition = TextPosition.CenterMiddle

Used to specify the position of the text in the contentItem. leftTop leftMiddle leftBottom rightTop rightMiddle rightBottom centerTop centerMiddle centerBottom

Default

centerMiddle

Accessors

  • get bounds(): Rect
  • The bounding rectangle of the moved item

    Returns Rect

  • set bounds(bounds): void
  • The bounding rectangle of the moved item

    Parameters

    Returns void

  • get isSelected(): boolean
  • Returns/sets a flag indicating if the item is selected or not.

    Returns boolean

  • set isSelected(value): void
  • Parameters

    • value: boolean

    Returns void

  • get labels(): Label[]
  • Returns the list of labels attached to this item.

    Returns Label[]

  • Returns the list of links attached to this node. If a link is reflexive, it is counted two times. So if a node has one reflexive link, this list will contain this reflexive two times.

    Returns Link[]

Methods

  • Clone the node

    Returns Node

  • Cause the item to be updated.

    Returns void

Generated using TypeDoc