# Class ContentItem`Abstract`

Represents a ContentItem object. This is an abstract class.

#### Implements

#### Hierarchy

- Item
  - ContentItem
    - Node
    - Label

#### Implements

- IMoveable
- ISizeable

- Defined in flow.ts:2355

#####
Index

### Constructors

constructor

### Properties

drawShape
fillShape
fillStyle
flow
font
gradientFillStyle
image
imageMargin
imagePosition
isExcludedFromLayout
isHidden
isHitTestVisible
isSelectable
isShadowed
isXMoveable
isXSizeable
isYMoveable
isYSizeable
lineWidth
opacity
polygon
shapeFamily
strokeStyle
tag
text
textFillStyle
textLineHeight
textMargin
textPosition

### Accessors

bounds
isSelected
labels

### Methods

refresh
setRect

## Constructors

### constructor

- new ContentItem(): ContentItem

- #### Returns ContentItem

  Overrides Item.constructor

  - Defined in flow.ts:2356

## Properties

### drawShape

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

- Defined in flow.ts:2390

### fillShape

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

- Defined in flow.ts:2394

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

### image

image: HTMLImageElement = null

The image displayed in the contentItem

- Defined in flow.ts:2397

### imageMargin

imageMargin: Margin = ...

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

- Defined in flow.ts:2418

### imagePosition

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

- Defined in flow.ts:2409

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

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

### isXMoveable

isXMoveable: boolean = true

Determines whether the contentItem can be moved horizontally moved or not

#### Default

    true

Implementation of IMoveable.isXMoveable

- Defined in flow.ts:2363

### isXSizeable

isXSizeable: boolean = true

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

#### Default

    true

Implementation of ISizeable.isXSizeable

- Defined in flow.ts:2372

### isYMoveable

isYMoveable: boolean = true

Determines whether the contentItem can be moved vertically

#### Default

    true

Implementation of IMoveable.isYMoveable

- Defined in flow.ts:2367

### isYSizeable

isYSizeable: boolean = true

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

#### Default

    true

Implementation of ISizeable.isYSizeable

- Defined in flow.ts:2377

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

### polygon

polygon: Point[] = []

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

#### Default

    null

- Defined in flow.ts:2385

### shapeFamily

shapeFamily: ShapeFamily = ShapeFamily.Ellipse

ellipse, rectangle, polygon, other

- Defined in flow.ts:2380

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

### textLineHeight

textLineHeight: number = 8

The height of a line of the text of the contentItem

- Defined in flow.ts:2412

### textMargin

textMargin: Margin = ...

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

- Defined in flow.ts:2415

### textPosition

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

- Defined in flow.ts:2403

## Accessors

### bounds

- get bounds(): Rect

- The bounding rectangle of the moved item

  #### Returns Rect

  Implementation of ISizeable.bounds

  - Defined in flow.ts:2420
- set bounds(bounds): void

- The bounding rectangle of the moved item

  #### Parameters

  - ##### bounds: Rect

  #### Returns void

  Implementation of ISizeable.bounds

  - Defined in flow.ts:2424

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

## Methods

### refresh

- refresh(): void

- Cause the item to be updated.

  #### Returns void

  Inherited from Item.refresh

  - Defined in flow.ts:2332

### `Abstract` setRect

- setRect(rect): void

- #### Parameters

  - ##### rect: Rect

  #### Returns void

  - Defined in flow.ts:2782

Generated using TypeDoc