BaseRelationItem.ts 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * ********************************************************************************************************************
  3. *
  4. * :*$@@%$*: ;: ;; ;;
  5. * :@@%! :!@@%: %! ;%%@@%$ =@@@@@@@%; @%@@@%%%%@@@@@
  6. * :@%; :$= %%$$$%$$ ;$$ ;$@= !@$
  7. * =@! %! @ $=;% !@@@%: !$$$$$$$$$$$$$$=
  8. * =@* %! @ $= % %@= =%@! %=
  9. * *$%%! @@= ;=$%%%$*: %! @ $= % =%%%%%%@$ *%: =%
  10. * %@@!: !@@@%=$@@@@%! :*@@$: %! @ $= % $* ;@ @* :%*
  11. * ;@@! ;!!!;: ;@%: =======@%========* @ $$ % $%*****$@ :@$=*********=@$
  12. * $@* ;@@@%=!: *@*
  13. * =@$ ;;;!=%@@@@=! =@!
  14. * %@$: =@%: :*@@@* %@= Copyright (c) 2016-2020. 北京上格云技术有限公司
  15. * ;%@@$=$@@%* *@@@$=%@@%;
  16. * ::;:: ::;:: All rights reserved.
  17. *
  18. * ********************************************************************************************************************
  19. */
  20. import { SGraphyItem } from "@saga-web/graphy/lib";
  21. import { SPainter, SPoint, SRect } from "@saga-web/draw/lib";
  22. import { Relation } from "../types/Relation";
  23. import { SMouseEvent } from "@saga-web/base/lib";
  24. /**
  25. * 关系item
  26. *
  27. * @author 郝建龙
  28. */
  29. export class BaseRelationItem extends SGraphyItem {
  30. /** X坐标最小值 */
  31. minX = Number.MAX_SAFE_INTEGER;
  32. /** X坐标最大值 */
  33. maxX = Number.MIN_SAFE_INTEGER;
  34. /** Y坐标最小值 */
  35. minY = Number.MAX_SAFE_INTEGER;
  36. /** Y坐标最大值 */
  37. maxY = Number.MIN_SAFE_INTEGER;
  38. /**
  39. * Item对象边界区域
  40. *
  41. * @return SRect
  42. */
  43. boundingRect(): SRect {
  44. return new SRect(
  45. this.minX,
  46. this.minY,
  47. this.maxX - this.minX,
  48. this.maxY - this.minY
  49. );
  50. } // Function boundingRect()
  51. } // Class BaseRelationItem