| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- /*
- * ********************************************************************************************************************
- *
- * :*$@@%$*: ;: ;; ;;
- * :@@%! :!@@%: %! ;%%@@%$ =@@@@@@@%; @%@@@%%%%@@@@@
- * :@%; :$= %%$$$%$$ ;$$ ;$@= !@$
- * =@! %! @ $=;% !@@@%: !$$$$$$$$$$$$$$=
- * =@* %! @ $= % %@= =%@! %=
- * *$%%! @@= ;=$%%%$*: %! @ $= % =%%%%%%@$ *%: =%
- * %@@!: !@@@%=$@@@@%! :*@@$: %! @ $= % $* ;@ @* :%*
- * ;@@! ;!!!;: ;@%: =======@%========* @ $$ % $%*****$@ :@$=*********=@$
- * $@* ;@@@%=!: *@*
- * =@$ ;;;!=%@@@@=! =@!
- * %@$: =@%: :*@@@* %@= Copyright (c) 2016-2019. 北京上格云技术有限公司
- * ;%@@$=$@@%* *@@@$=%@@%;
- * ::;:: ::;:: All rights reserved.
- *
- * ********************************************************************************************************************
- */
- import { FloorScene } from "./FloorScene";
- import { SMouseEvent } from "@sybotan-web/graphy/lib";
- import { SColor, SPoint, SRect } from "@sybotan-web/draw/lib";
- import { UserMark } from "./items/UserMark";
- /**
- * 划分业务空间
- *
- * @author 郝建龙
- */
- export class DivideFloorScene extends FloorScene {
- /** 是否开启用户标记 */
- _isMarking: boolean = false;
- get isMarking(): boolean {
- return this._isMarking;
- } // Get isMarking
- set isMarking(v: boolean) {
- if (this._isMarking === v) {
- return;
- }
- this._isMarking = v;
- } // Set isMarking
- /**
- * 构造函数
- *
- * @param data
- */
- constructor() {
- super();
- } // Constructor
- /** 清除切割 */
- clearUserMark(): void {
- if (this.grabItem) {
- this.removeItem(this.grabItem);
- this.grabItem = null;
- this.isMarking = false;
- }
- } // Function clearUserMark()
- /**
- * 点击事件
- *
- * @param event 保存事件参数
- * @return boolean
- */
- onMouseDown(event: SMouseEvent): boolean {
- if (this.isMarking) {
- if (this.grabItem) {
- this.grabItem.onMouseDown(event);
- } else {
- let point = new SPoint(event.x, event.y);
- let userM = new UserMark(null, point);
- this.addItem(userM);
- this.grabItem = userM;
- }
- } else {
- super.onMouseDown(event);
- }
- return false;
- } // Function onClick()
- } // Class DivideFloorScene
|