# Class Link

Represents a Link object.

#### Implements

#### Hierarchy

- Item
  - Link

#### Implements

- IHasContext

- Defined in flow.ts:3541

#####
Index

### Constructors

constructor

### Properties

arrowDst
arrowOrg
fillStyle
flow
font
gradientFillStyle
isContext
isExcludedFromLayout
isHidden
isHitTestVisible
isOpaque
isOrientedText
isSelectable
isShadowed
isStretchable
jumpSize
lineWidth
opacity
orthoMargin
points
roundedCornerSize
strokeStyle
tag
text
textFillStyle

### Accessors

dst
isDstPointAdjustable
isOrgPointAdjustable
isSelected
labels
lineStyle
org
pinDst
pinOrg

### Methods

addPoint
clearPoints
clone
countPoints
drawPolylineInter
drawPolylineRounded
getContextHandle
getPoint
refresh
removePoint
setPoint

## Constructors

### constructor

- new Link(flow, org, dst, text?, pinOrg?, pinDst?): Link

- constructor

  #### Parameters

  - ##### flow: Flow

    a reference to the flow component

  - ##### org: Node

    The origin node of the link to create.

  - ##### dst: Node

    The destination node of the link to create.

  - ##### `Optional` text: string

    A string to be displayed in the node to create.

  - ##### `Optional` pinOrg: number

    The pin of the origin node of the link to create.

  - ##### `Optional` pinDst: number

    The pin of the destination node of the link to create.

  #### Returns Link

  Overrides Item.constructor

  - Defined in flow.ts:3552

## Properties

### arrowDst

arrowDst: Point[] = Link.defArrow

Returns/sets the shape of the link destination arrow head

- Defined in flow.ts:3581

### arrowOrg

arrowOrg: Point[] = null

Returns/sets the shape of the link origin arrow head

- Defined in flow.ts:3584

### fillStyle

fillStyle: string

The color used to fill the item

Inherited from Item.fillStyle

- Defined in flow.ts:2231

### flow

flow: Flow = null

A reference of the AddFlow component containing this item

Inherited from Item.flow

- Defined in flow.ts:2210

### font

font: string

The font used to display the text of the item

Inherited from Item.font

- Defined in flow.ts:2221

### gradientFillStyle

gradientFillStyle: string

The color used to create a gradient with the fillStyle color

Inherited from Item.gradientFillStyle

- Defined in flow.ts:2234

### isContext

isContext: boolean = true

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

#### Default

    true

Implementation of IHasContext.isContext

- Defined in flow.ts:3597

### isExcludedFromLayout

isExcludedFromLayout: boolean

Determines whether the item is excluded by a layout algorithm

#### Default

    false

Inherited from Item.isExcludedFromLayout

- Defined in flow.ts:2262

### isHidden

isHidden: boolean

Determines whether the item is hidden

#### Default

    false

Inherited from Item.isHidden

- Defined in flow.ts:2258

### isHitTestVisible

isHitTestVisible: boolean

Determines whether the item can be hit tested

#### Default

    true

Inherited from Item.isHitTestVisible

- Defined in flow.ts:2254

### isOpaque

isOpaque: boolean = false

Determines whether the background of the text of the link is opaque.

#### Default

    false

- Defined in flow.ts:3602

### isOrientedText

isOrientedText: boolean = false

Determines whether the text of the link is aligned with the link.

#### Default

    false

- Defined in flow.ts:3593

### isSelectable

isSelectable: boolean

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

#### Default

    true

Inherited from Item.isSelectable

- Defined in flow.ts:2250

### isShadowed

isShadowed: boolean

Determines whether a shadow is displayed for the item

#### Default

    false

Inherited from Item.isShadowed

- Defined in flow.ts:2225

### isStretchable

isStretchable: boolean = true

Determines whether the link can be stretched or not

#### Default

    true

- Defined in flow.ts:3588

### jumpSize

jumpSize: number = 3

Returns/sets the size of the jumps at the intersection of links.<

#### Default

    3

- Defined in flow.ts:3618

### lineWidth

lineWidth: number

The thickness of the lines used to draw the item

#### Default

    1

Inherited from Item.lineWidth

- Defined in flow.ts:2241

### opacity

opacity: number

The opacity of the item

#### Default

    1

Inherited from Item.opacity

- Defined in flow.ts:2245

### orthoMargin

orthoMargin: number = 30

The margin used to display orthogonal links

- Defined in flow.ts:3605

### points

points: Point[]

The collection of link points. Don't use this property which is only provided for the AddFlow infrastructure. To manipulate the collection of link points, you should use instead the methods addPoint, removePoint, clearPoints, countPoints, getPoint and setPoint.

- Defined in flow.ts:3572

### roundedCornerSize

roundedCornerSize: number = 0

Determines the size of the rounded corner at the intersection point of 2 segments. This property will have not any effect if the style property of the link is bezier.

#### Default

    0

- Defined in flow.ts:3614

### strokeStyle

strokeStyle: string

The color used to draw the item

Inherited from Item.strokeStyle

- Defined in flow.ts:2228

### tag

tag: any

Sets or returns a tag associated with the item.

#### Default

    null

Inherited from Item.tag

- Defined in flow.ts:2272

### text

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.

Inherited from Item.text

- Defined in flow.ts:2268

### textFillStyle

textFillStyle: string

The color used to display the text of the item

Inherited from Item.textFillStyle

- Defined in flow.ts:2237

## Accessors

### dst

- get dst(): Node

- Returns/sets the destination node of the link

  #### Returns Node

  - Defined in flow.ts:3781
- set dst(dst): void

- #### Parameters

  - ##### dst: Node

  #### Returns void

  - Defined in flow.ts:3785

### isDstPointAdjustable

- get isDstPointAdjustable(): boolean

- Returns/sets a boolean value indicating whether the last link point can be changed.

  #### Returns boolean

  #### Default

      false

  - Defined in flow.ts:3659
- set isDstPointAdjustable(value): void

- #### Parameters

  - ##### value: boolean

  #### Returns void

  - Defined in flow.ts:3663

### isOrgPointAdjustable

- get isOrgPointAdjustable(): boolean

- Returns/sets a boolean value indicating whether the first link point can be changed.

  #### Returns boolean

  #### Default

      false

  - Defined in flow.ts:3627
- set isOrgPointAdjustable(value): void

- #### Parameters

  - ##### value: boolean

  #### Returns void

  - Defined in flow.ts:3631

### isSelected

- get isSelected(): boolean

- Returns/sets a flag indicating if the item is selected or not.

  #### Returns boolean

  Inherited from Item.isSelected

  - Defined in flow.ts:2298
- set isSelected(value): void

- #### Parameters

  - ##### value: boolean

  #### Returns void

  Inherited from Item.isSelected

  - Defined in flow.ts:2302

### labels

- get labels(): Label[]

- Returns the list of labels attached to this item.

  #### Returns Label[]

  Inherited from Item.labels

  - Defined in flow.ts:2216

### lineStyle

- get lineStyle(): LineStyle

- Returns/sets the link line style (polyline, orthogonal, ...)

  #### Returns LineStyle

  - Defined in flow.ts:3690
- set lineStyle(value): void

- #### Parameters

  - ##### value: LineStyle

  #### Returns void

  - Defined in flow.ts:3694

### org

- get org(): Node

- Returns/sets the origin node of the link

  #### Returns Node

  - Defined in flow.ts:3727
- set org(org): void

- #### Parameters

  - ##### org: Node

  #### Returns void

  - Defined in flow.ts:3731

### pinDst

- get pinDst(): number

- Returns/sets the pin index of destination node of the link

  #### Returns number

  - Defined in flow.ts:3868
- set pinDst(value): void

- #### Parameters

  - ##### value: number

  #### Returns void

  - Defined in flow.ts:3872

### pinOrg

- get pinOrg(): number

- Returns/sets the pin index of origin node of the link

  #### Returns number

  - Defined in flow.ts:3836
- set pinOrg(value): void

- #### Parameters

  - ##### value: number

  #### Returns void

  - Defined in flow.ts:3840

## Methods

### addPoint

- addPoint(pt): void

- Add a point to the collection of points of a link. This method will work only if the link lineStyle allows adding points to the link. For instance, it will not work if the link has a bezier lineStyle.

  #### Parameters

  - ##### pt: Point

  #### Returns void

  - Defined in flow.ts:3908

### clearPoints

- clearPoints(): void

- Clears the collection of points of the link, removing all points except the first and the last since a link points collection is never empty and contains at least 2 points. This method will work only if the link lineStyle allows removing points to the link. For instance, it will not work if the link has a bezier lineStyle.

  #### Returns void

  - Defined in flow.ts:3947

### clone

- clone(): Link

- Clone the link

  #### Returns Link

  - Defined in flow.ts:3899

### countPoints

- countPoints(): number

- Gets the total number of points in the collection of points of a link.

  #### Returns number

  - Defined in flow.ts:3963

### `Private` drawPolylineInter

- drawPolylineInter(ctx): void

- #### Parameters

  - ##### ctx: CanvasRenderingContext2D

  #### Returns void

  - Defined in flow.ts:4757

### `Private` drawPolylineRounded

- drawPolylineRounded(ctx): void

- #### Parameters

  - ##### ctx: CanvasRenderingContext2D

  #### Returns void

  - Defined in flow.ts:4736

### getContextHandle

- getContextHandle(): Rect

- Gets the context handle rectangle

  #### Returns Rect

  Implementation of IHasContext.getContextHandle

  - Defined in flow.ts:4061

### getPoint

- getPoint(index): Point

- Returns the point at the specified index.

  #### Parameters

  - ##### index: number

  #### Returns Point

  - Defined in flow.ts:3968

### refresh

- refresh(): void

- Cause the item to be updated.

  #### Returns void

  Inherited from Item.refresh

  - Defined in flow.ts:2332

### removePoint

- removePoint(index): void

- Removes the point at the specified index from the collection of points of the link. This method will work only if the link lineStyle allows removing points to the link. For instance, it will not work if the link has a bezier lineStyle.

  #### Parameters

  - ##### index: number

  #### Returns void

  - Defined in flow.ts:3927

### setPoint

- setPoint(pt, index): void

- Sets a point at the specified index.

  #### Parameters

  - ##### pt: Point

  - ##### index: number

  #### Returns void

  - Defined in flow.ts:3976

Generated using TypeDoc