Skip to main content
Version: Next

TextAnnotationStore

Hierarchy

Index

Constructors

constructor

  • new TextAnnotationStore(backendService: BackendService, fileId: number, activeFrame: FrameStore, controlPoints: Point2D[], regionType: RegionType, regionId?: number, rotation?: number, name?: string, color?: string, lineWidth?: number, dashLength?: number): TextAnnotationStore
  • Parameters

    • backendService: BackendService
    • fileId: number
    • activeFrame: FrameStore
    • controlPoints: Point2D[]
    • regionType: RegionType
    • regionId: number = -1
    • rotation: number = 0
    • name: string = ""
    • color: string = Colors.TURQUOISE5
    • lineWidth: number = 2
    • dashLength: number = 0

    Returns TextAnnotationStore

Properties

activeFrame

activeFrame: FrameStore

color

color: string

controlPoints

controlPoints: Point2D[]

coordinate

coordinate: CoordinateMode

creating

creating: boolean

dashLength

dashLength: number

editing

editing: boolean

readonlyfileId

fileId: number

font

font: Font = Font.HELVETICA

fontSize

fontSize: number = 20

fontStyle

fontStyle: FontStyle = FontStyle.NORMAL

isSimplePolygon

isSimplePolygon: boolean

lineRegionSampleWidth

lineRegionSampleWidth: number = 3

lineWidth

lineWidth: number

locked

locked: boolean = false

publicmodifiedTimestamp

modifiedTimestamp: number

name

name: string

position

position: TextAnnotationPosition = CARTA.TextAnnotationPosition.CENTER

regionId

regionId: number

regionType

regionType: RegionType

rotation

rotation: number

text

text: string = "Double click to edit text"

staticreadonlyAVAILABLE_ANNOTATION_TYPES

AVAILABLE_ANNOTATION_TYPES: Map<RegionType, string> = ...

staticreadonlyAVAILABLE_REGION_TYPES

AVAILABLE_REGION_TYPES: Map<RegionType, string> = ...

staticreadonlyMAX_DASH_LENGTH

MAX_DASH_LENGTH: 50 = 50

staticreadonlyMAX_LINE_WIDTH

MAX_LINE_WIDTH: 10 = 10

staticreadonlyMIN_LINE_WIDTH

MIN_LINE_WIDTH: 0.5 = 0.5

staticreadonlyTARGET_VERTEX_COUNT

TARGET_VERTEX_COUNT: 200 = 200

Accessors

boundingBox

  • Returns Point2D

boundingBoxArea

  • get boundingBoxArea(): number
  • Returns number

center

  • Returns Point2D

isAnnotation

  • get isAnnotation(): boolean
  • Returns boolean

isClosedRegion

  • get isClosedRegion(): boolean
  • Returns boolean

isPreviewCut

  • get isPreviewCut(): boolean
  • Returns boolean

isTemporary

  • get isTemporary(): boolean
  • Returns boolean

isValid

  • get isValid(): boolean
  • Returns boolean

nameString

  • get nameString(): string
  • Returns string

regionProperties

  • get regionProperties(): string
  • Returns string

size

  • Returns the sizes of regions and annotations. For line regions and annotations, vector annotations, and ruler annotations, returns x and y absolute displacements.


    Returns Point2D

    The x and y size components.

wcsSize

  • Returns Point2D

Methods

beginCreating

  • beginCreating(): void
  • Returns void

beginEditing

  • beginEditing(): void
  • Returns void

endCreating

  • endCreating(): Generator<Promise<ISetRegionAck>, void, unknown>
  • Returns Generator<Promise<ISetRegionAck>, void, unknown>

endEditing

  • endEditing(): void
  • Returns void

focusCenter

  • focusCenter(): void
  • Returns void

publicgetAnnotationStyles

  • getAnnotationStyles(): { font: Font; fontSize: number; fontStyle: FontStyle; textLabel0: string; textPosition: TextAnnotationPosition }
  • Returns { font: Font; fontSize: number; fontStyle: FontStyle; textLabel0: string; textPosition: TextAnnotationPosition }

    • font: Font
    • fontSize: number
    • fontStyle: FontStyle
    • textLabel0: string
    • textPosition: TextAnnotationPosition

publicgetAnnotationStylesForExport

  • getAnnotationStylesForExport(): { font: Font; fontSize: number; fontStyle: FontStyle; textLabel0: string; textPosition: TextAnnotationPosition }
  • Returns { font: Font; fontSize: number; fontStyle: FontStyle; textLabel0: string; textPosition: TextAnnotationPosition }

    • font: Font
    • fontSize: number
    • fontStyle: FontStyle
    • textLabel0: string
    • textPosition: TextAnnotationPosition

publicgetRegionApproximation

  • getRegionApproximation(astTransform: Mapping): Point2D[]
  • Parameters

    • astTransform: Mapping

    Returns Point2D[]

publicinitializeStyles

  • initializeStyles(annotationStyles: { font: Font; fontSize: number; fontStyle: FontStyle; textLabel0: string; textPosition: TextAnnotationPosition }): void
  • Parameters

    • annotationStyles: { font: Font; fontSize: number; fontStyle: FontStyle; textLabel0: string; textPosition: TextAnnotationPosition }

    Returns void

setCenter

  • setCenter(p: Point2D, skipUpdate?: boolean): void
  • Parameters

    • p: Point2D
    • skipUpdate: boolean = false

    Returns void

setColor

  • setColor(color: string): void
  • Parameters

    • color: string

    Returns void

setControlPoint

  • setControlPoint(index: number, p: Point2D, skipUpdate?: boolean): void
  • Parameters

    • index: number
    • p: Point2D
    • skipUpdate: boolean = false

    Returns void

setControlPoints

  • setControlPoints(points: Point2D[], skipUpdate?: boolean, shapeChanged?: boolean): void
  • Parameters

    • points: Point2D[]
    • skipUpdate: boolean = false
    • shapeChanged: boolean = true

    Returns void

setCoordinate

  • Parameters

    Returns void

setDashLength

  • setDashLength(dashLength: number): void
  • Parameters

    • dashLength: number

    Returns void

setFont

  • setFont(font: Font): void
  • Parameters

    Returns void

setFontSize

  • setFontSize(fontSize: number): void
  • Parameters

    • fontSize: number

    Returns void

setFontStyle

  • setFontStyle(fontStyle: string): void
  • Parameters

    • fontStyle: string

    Returns void

setLineWidth

  • setLineWidth(lineWidth: number): void
  • Parameters

    • lineWidth: number

    Returns void

setLocked

  • setLocked(locked: boolean): void
  • Parameters

    • locked: boolean

    Returns void

setName

  • setName(name: string): void
  • Parameters

    • name: string

    Returns void

setPosition

  • setPosition(position: TextAnnotationPosition): void
  • Parameters

    • position: TextAnnotationPosition

    Returns void

setRegionId

  • setRegionId(id: number): void
  • Parameters

    • id: number

    Returns void

setRotation

  • setRotation(angle: number, skipUpdate?: boolean): void
  • Parameters

    • angle: number
    • skipUpdate: boolean = false

    Returns void

setSize

  • setSize(p: Point2D, skipUpdate?: boolean): void
  • Sets the size for regions and annotations


    Parameters

    • p: Point2D

      Specifies the x and y size components. For line regions and annotations, vector annotations, and ruler annotations, the function sets the new start and end positions while keeping the rotation within the same quadrant.

    • skipUpdate: boolean = false

      Whether to update the changes with the backend.

    Returns void

setText

  • setText(text: string): void
  • Parameters

    • text: string

    Returns void

toggleLock

  • toggleLock(): void
  • Returns void

publicstaticGetRegionProperties

  • GetRegionProperties(regionType: RegionType, controlPoints: Point2D[], rotation: number): string
  • Parameters

    • regionType: RegionType
    • controlPoints: Point2D[]
    • rotation: number

    Returns string

publicstaticIsRegionCustomIcon

  • IsRegionCustomIcon(regionType: RegionType): boolean
  • Parameters

    • regionType: RegionType

    Returns boolean

publicstaticIsRegionDashLengthValid

  • IsRegionDashLengthValid(regionDashLength: number): boolean
  • Parameters

    • regionDashLength: number

    Returns boolean

publicstaticIsRegionLineWidthValid

  • IsRegionLineWidthValid(regionLineWidth: number): boolean
  • Parameters

    • regionLineWidth: number

    Returns boolean

publicstaticIsRegionTypeValid

  • IsRegionTypeValid(regionType: RegionType): boolean
  • Parameters

    • regionType: RegionType

    Returns boolean

publicstaticRegionIconString

  • RegionIconString(regionType: RegionType): any
  • Parameters

    • regionType: RegionType

    Returns any

publicstaticRegionTypeString

  • RegionTypeString(regionType: RegionType): string
  • Parameters

    • regionType: RegionType

    Returns string