annotation.dart 1005 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import 'package:fis_common/event/event_type.dart';
  2. import 'package:fis_measure/interfaces/date_types/point.dart';
  3. import 'package:fis_measure/interfaces/enums/annotation.dart';
  4. import 'package:fis_measure/interfaces/process/workspace/point_info.dart';
  5. import 'package:flutter/painting.dart';
  6. /// 注释
  7. abstract class IAnnotationItem {
  8. /// 类型
  9. AnnotationType get type;
  10. /// 状态
  11. AnnotationStates get state;
  12. /// 记录集合
  13. List<IAnnotationItemFeature> get features;
  14. /// 当前注释
  15. IAnnotationItemFeature? get feature;
  16. /// 注释文本
  17. String? get text;
  18. set text(String? value);
  19. /// 处理手势
  20. bool execute(PointInfo args);
  21. /// 结束最后一次操作状态
  22. void finishLast();
  23. /// Feature更新
  24. late final FEventHandler<IAnnotationItemFeature?> featureUpdated;
  25. }
  26. /// 注释记录
  27. abstract class IAnnotationItemFeature {
  28. /// 坐标
  29. DPoint get position;
  30. /// 是否活动
  31. bool get isActive;
  32. /// 绘制
  33. void paint(Canvas canvas, Size size);
  34. }