123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- import { SGraphItem } from "@saga-web/graph/lib";
- import { SPoint } from "@saga-web/draw/lib";
- import { SLineItem } from '@saga-web/big/lib';
- import { Marker } from '../types/Marker';
- /**
- * 标识对象Item(线类型)
- *
- * * @author 张宇(taohuzy@163.com)
- */
- export class SLineMarkerItem extends SLineItem {
- /** 标识对象数据 */
- data: Marker;
- /**
- * 构造函数
- *
- * @param parent 指向父对象
- * @param data 标识对象数据
- */
- constructor(parent: SGraphItem | null, data: Marker) {
- super(parent);
- this.data = data;
- this.id = data.ID;
- this.name = data.Name;
- this.moveTo(data.Pos.X, data.Pos.Y);
- if (data.Properties && data.Properties.Line) {
- this.line = data.Properties.Line;
- }
- if (data.Properties && data.Properties.LineWidth) {
- this.lineWidth = data.Properties.LineWidth;
- }
- if (data.Properties && data.Properties.LineStyle) {
- this.lineStyle = data.Properties.LineStyle;
- }
- if (data.Properties && data.Properties.StrokeColor) {
- this.strokeColor = data.Properties.StrokeColor;
- }
- } // Constructor
- toData(): Marker {
- this.data.Pos = {X: this.x, Y: this.y};
- this.data.Properties.Line = this.line;
- this.data.Properties.LineWidth = this.lineWidth;
- this.data.Properties.StrokeColor = this.strokeColor;
- this.data.Properties.LineStyle = this.lineStyle;
- return this.data;
- }
-
- } // Class SLineMarkerItem
|