| 
															
																@@ -6,6 +6,18 @@ import { selector as Selector } from "../../../core/application/selector"; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 import { LineSegmentModel } from "../models/line-segment-model"; 
															 | 
															
															 | 
															
																 import { LineSegmentModel } from "../models/line-segment-model"; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 import { PointDrawer } from "../../point-component/drawers/point-drawer"; 
															 | 
															
															 | 
															
																 import { PointDrawer } from "../../point-component/drawers/point-drawer"; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 import { objects as Objects } from "../../../core/application/objects"; 
															 | 
															
															 | 
															
																 import { objects as Objects } from "../../../core/application/objects"; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+import { app as App } from "../../../app"; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+import { stageManager as StageManager } from "../../../core/application/stage-manager"; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+const HOVER_STYLE = { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+  fill: "#33BCFF", 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+  strokeWidth: 4, 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+  stroke: "#33BCFF" 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+}; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+const STYLE = { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+  fill: "grey", 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+  strokeWidth: 2, 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+  stroke: "grey" 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+}; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 export class LineSegmentDrawer extends Drawer { 
															 | 
															
															 | 
															
																 export class LineSegmentDrawer extends Drawer { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																   static FIRST_POINT_STATE() { 
															 | 
															
															 | 
															
																   static FIRST_POINT_STATE() { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     return "FIRST_POINT"; 
															 | 
															
															 | 
															
																     return "FIRST_POINT"; 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -26,6 +38,7 @@ export class LineSegmentDrawer extends Drawer { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     ]; 
															 | 
															
															 | 
															
																     ]; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     this.lineSegment; 
															 | 
															
															 | 
															
																     this.lineSegment; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     this.pointDrawer = new PointDrawer(); 
															 | 
															
															 | 
															
																     this.pointDrawer = new PointDrawer(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+    super.setElementClass(ELEMENTS_CLASS.LINE_SEGMENT); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																   } 
															 | 
															
															 | 
															
																   } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																   setPointA(point) { 
															 | 
															
															 | 
															
																   setPointA(point) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     this.pointA = point; 
															 | 
															
															 | 
															
																     this.pointA = point; 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -44,8 +57,7 @@ export class LineSegmentDrawer extends Drawer { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																   draw() { 
															 | 
															
															 | 
															
																   draw() { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     const points = Selector.getSelectedPoints(); 
															 | 
															
															 | 
															
																     const points = Selector.getSelectedPoints(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																- 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-    if (points == undefined || points.length < 1) { 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+    if (points == undefined || points.length == 0) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																       this.drawByState(); 
															 | 
															
															 | 
															
																       this.drawByState(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     } 
															 | 
															
															 | 
															
																     } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     this.drawByPoints(points); 
															 | 
															
															 | 
															
																     this.drawByPoints(points); 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -65,8 +77,6 @@ export class LineSegmentDrawer extends Drawer { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         [this.aggregatorA, this.aggregatorB] 
															 | 
															
															 | 
															
																         [this.aggregatorA, this.aggregatorB] 
															 | 
														
													
												
													
														
															| 
															 | 
															
																       ); 
															 | 
															
															 | 
															
																       ); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																       super.setState(undefined); 
															 | 
															
															 | 
															
																       super.setState(undefined); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-    } else { 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-      super.setState(undefined); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     } 
															 | 
															
															 | 
															
																     } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																   } 
															 | 
															
															 | 
															
																   } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -155,9 +165,24 @@ export class LineSegmentDrawer extends Drawer { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     return line; 
															 | 
															
															 | 
															
																     return line; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																   } 
															 | 
															
															 | 
															
																   } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																   static configureLineEvents(line) { 
															 | 
															
															 | 
															
																   static configureLineEvents(line) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-    line.on("click tap", function(e) { 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-      this.pointDrawer.drawPoint(); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+    line.on("mouseover", function() { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+      const selectedTool = App.getSelectedTool(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+      if ( 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+        selectedTool != undefined && 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+        selectedTool.drawer != undefined && 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+        selectedTool.drawer.elementClass == ELEMENTS_CLASS.INTERSECTION_POINT 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+      ) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+        this.strokeWidth(HOVER_STYLE.strokeWidth); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+        this.stroke(HOVER_STYLE.stroke); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+        StageManager.getCurrentKonvaStage().draw(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+      } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     }); 
															 | 
															
															 | 
															
																     }); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+    line.on("mouseout", function() { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+      this.strokeWidth(STYLE.strokeWidth); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+      this.stroke(STYLE.stroke); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+      StageManager.getCurrentKonvaStage().draw(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+    }); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     return line; 
															 | 
															
															 | 
															
																     return line; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																   } 
															 | 
															
															 | 
															
																   } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 |