|
@@ -12,6 +12,7 @@ abstract class TopMeasureItem<T extends MeasureItemFeature>
|
|
|
final List<IMeasureItem> _childItems = [];
|
|
|
int _childIndex = 0;
|
|
|
|
|
|
+ bool get ifAutoStart => false;
|
|
|
bool get ifAutoFinish => false;
|
|
|
|
|
|
TopMeasureItem(ItemMeta meta) : super(meta) {
|
|
@@ -44,6 +45,12 @@ abstract class TopMeasureItem<T extends MeasureItemFeature>
|
|
|
|
|
|
@override
|
|
|
bool onExecuteMouse(PointInfo args) {
|
|
|
+ if (ifAutoStart) {
|
|
|
+ if (feature == null) {
|
|
|
+ feature = buildFeature();
|
|
|
+ listenChildrenUpdate();
|
|
|
+ }
|
|
|
+ }
|
|
|
if (args.pointType == PointInfoType.mouseDown) {
|
|
|
if (feature == null) {
|
|
|
feature = buildFeature();
|
|
@@ -58,11 +65,10 @@ abstract class TopMeasureItem<T extends MeasureItemFeature>
|
|
|
if (result) {
|
|
|
doCalculate();
|
|
|
}
|
|
|
- //TODO:[Gavin] Sometimes Need Auto Finish
|
|
|
if (ifAutoFinish) {
|
|
|
if (args.pointType == PointInfoType.mouseDown) {
|
|
|
if (childrenAllDone) {
|
|
|
- print("此时应该结束测量");
|
|
|
+ application.switchItem(meta);
|
|
|
}
|
|
|
}
|
|
|
}
|