import { Rectangle } from "@devexpress/utils/lib/geometry/rectangle"; import { Point } from "@devexpress/utils/lib/geometry/point"; import { Metrics } from "@devexpress/utils/lib/geometry/metrics"; import { Connector } from "./Connectors/Connector"; import { SvgPrimitive } from "../Render/Primitives/Primitive"; import { ObjectUtils } from "../Utils"; import { IKeyOwner } from "../Interfaces"; import { Style, TextStyle } from "./Style"; import { ConnectionPoint } from "./ConnectionPoint"; import { Shape } from "./Shapes/Shape"; import { INativeItem } from "../Api/INativeItem"; import { DiagramUnit } from "../Enums"; export enum ConnectionPointSide { Undefined = -1, North = 0, East = 1, South = 2, West = 3 } export type ItemKey = string; export type ItemDataKey = string | number; export type ItemsMap = {[key: string]: boolean}; export const DEFAULT_ZINDEX = 0; export abstract class DiagramItem implements IKeyOwner { key: ItemKey = undefined; dataKey: ItemDataKey = undefined; customData: any = undefined; attachedConnectors: Connector[] = []; zIndex: number = DEFAULT_ZINDEX; locked: boolean = false; container: Shape = undefined; style: Style = new Style(); styleText: TextStyle = new TextStyle(); abstract createPrimitives(instanceId: string): SvgPrimitive[]; abstract createSelectorPrimitives(): SvgPrimitive[]; assign(item: DiagramItem) { item.key = this.key; item.dataKey = this.dataKey; item.customData = ObjectUtils.cloneObject(this.customData); item.locked = this.locked; item.attachedConnectors = this.attachedConnectors.slice(); item.style =