Class Link

Represents a Link object.

Implements

Hierarchy

Implements

Constructors

  • 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

Properties

arrowDst: Point[] = Link.defArrow

Returns/sets the shape of the link destination arrow head

arrowOrg: Point[] = null

Returns/sets the shape of the link origin arrow head

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

isContext: boolean = true

Determines if a context handle is displayed when the link 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
isOpaque: boolean = false

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

Default

false
isOrientedText: boolean = false

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

Default

false
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
isStretchable: boolean = true

Determines whether the link can be stretched or not

Default

true
jumpSize: number = 3

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

Default

3
lineWidth: number

The thickness of the lines used to draw the item

Default

1
opacity: number

The opacity of the item

Default

1
orthoMargin: number = 30

The margin used to display orthogonal links

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.

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
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

Accessors

  • get dst(): Node
  • Returns/sets the destination node of the link

    Returns Node

  • set dst(dst): void
  • Parameters

    Returns void

  • get isDstPointAdjustable(): boolean
  • Returns/sets a boolean value indicating whether the last link point can be changed.

    Returns boolean

    Default

    false
    
  • set isDstPointAdjustable(value): void
  • Parameters

    • value: boolean

    Returns void

  • get isOrgPointAdjustable(): boolean
  • Returns/sets a boolean value indicating whether the first link point can be changed.

    Returns boolean

    Default

    false
    
  • set isOrgPointAdjustable(value): void
  • Parameters

    • value: boolean

    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[]

  • get lineStyle(): LineStyle
  • Returns/sets the link line style (polyline, orthogonal, ...)

    Returns LineStyle

  • set lineStyle(value): void
  • Parameters

    Returns void

  • get org(): Node
  • Returns/sets the origin node of the link

    Returns Node

  • set org(org): void
  • Parameters

    Returns void

  • get pinDst(): number
  • Returns/sets the pin index of destination node of the link

    Returns number

  • set pinDst(value): void
  • Parameters

    • value: number

    Returns void

  • get pinOrg(): number
  • Returns/sets the pin index of origin node of the link

    Returns number

  • set pinOrg(value): void
  • Parameters

    • value: number

    Returns void

Methods

  • 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

    Returns 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

  • Clone the link

    Returns Link

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

    Returns number

  • Parameters

    • ctx: CanvasRenderingContext2D

    Returns void

  • Parameters

    • ctx: CanvasRenderingContext2D

    Returns void

  • Returns the point at the specified index.

    Parameters

    • index: number

    Returns Point

  • Cause the item to be updated.

    Returns 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

  • Sets a point at the specified index.

    Parameters

    Returns void

Generated using TypeDoc