tenthe commented on code in PR #1120:
URL: https://github.com/apache/streampipes/pull/1120#discussion_r1080552084


##########
ui/src/app/core-ui/image/image-labeling/image-labeling.component.ts:
##########
@@ -34,243 +33,358 @@ import { Label } from '@streampipes/platform-services';
 import { LabelService } from '../../labels/services/label.service';
 
 @Component({
-  selector: 'sp-image-labeling',
-  templateUrl: './image-labeling.component.html',
-  styleUrls: ['./image-labeling.component.css']
+    selector: 'sp-image-labeling',
+    templateUrl: './image-labeling.component.html',
+    styleUrls: ['./image-labeling.component.css'],
 })
 export class ImageLabelingComponent implements OnInit {
+    // label
+    public labels;
+    public selectedLabel: Label;
+
+    public _imagesRoutes;
+    @Input()
+    set imagesRoutes(routes) {
+        this._imagesRoutes = routes;
+        this.getCocoFile(this._imagesRoutes, 0);
+    }
 
-  // label
-  public labels;
-  public selectedLabel: Label;
-
-  public _imagesRoutes;
-  @Input()
-  set imagesRoutes(routes) {
-   this._imagesRoutes = routes;
-   this.getCocoFile(this._imagesRoutes, 0);
-  }
-
-  public imagesIndex = 0;
-
-  public cocoFile: CocoFormat;
-
-  public isHoverComponent;
-  public brushSize: number;
+    public imagesIndex = 0;
 
-  public isDrawing = false;
+    public cocoFile: CocoFormat;
 
-  @ViewChild(ImageContainerComponent) imageView: ImageContainerComponent;
+    public isHoverComponent;
+    public brushSize: number;
 
-  constructor(private reactLabelingService: ReactLabelingService,
-              private polygonLabelingService: PolygonLabelingService,
-              private brushLabelingService: BrushLabelingService,
-              private snackBar: MatSnackBar,
-              private cocoFormatService: CocoFormatService,
-              private labelService: LabelService,
-              public labelingMode: LabelingModeService) { }
+    public isDrawing = false;
 
-  ngOnInit(): void {
-    this.isHoverComponent = false;
-    this.brushSize = 5;
-    this.labelService.getAllLabels().subscribe(res => {
-       this.labels = res;
-    });
-    // this.labels = this.restService.getLabels();
-  }
+    @ViewChild(ImageContainerComponent) imageView: ImageContainerComponent;
 
-  handleImageIndexChange(index) {
-    this.save(this.imagesIndex);
-    this.getCocoFile(this._imagesRoutes, index);
-  }
+    constructor(
+        private reactLabelingService: ReactLabelingService,
+        private polygonLabelingService: PolygonLabelingService,
+        private brushLabelingService: BrushLabelingService,
+        private snackBar: MatSnackBar,
+        private cocoFormatService: CocoFormatService,
+        private labelService: LabelService,
+        public labelingMode: LabelingModeService,
+    ) {}
 
-  getCocoFile(routes, index) {
-      // This is relevant for coco
-      // this.restService.getCocoFileForImage(routes[index]).subscribe(
-      //   coco => {
-      //     if (coco === null) {
-      //       const cocoFile = new CocoFormat();
-      //       this.cocoFormatService.addImage(cocoFile, (routes[index]));
-      //       this.cocoFile = cocoFile;
-      //     } else {
-      //       this.cocoFile = coco as CocoFormat;
-      //     }
-      //     this.imagesIndex = index;
-      //   }
-      // );
-  }
+    ngOnInit(): void {
+        this.isHoverComponent = false;
+        this.brushSize = 5;
+        this.labelService.getAllLabels().subscribe(res => {
+            this.labels = res;
+        });
+        // this.labels = this.restService.getLabels();
+    }
 
-  /* sp-image-view handler */
-  handleMouseDownLeft(layer: Konva.Layer, shift: ICoordinates, position: 
ICoordinates) {
-    if (this.labelingEnabled()) {
-      switch (this.labelingMode.getMode()) {
-        case LabelingMode.ReactLabeling: 
this.reactLabelingService.startLabeling(position);
-          break;
-        case LabelingMode.PolygonLabeling: 
this.polygonLabelingService.startLabeling(position);
-          break;
-        case LabelingMode.BrushLabeling: 
this.brushLabelingService.startLabeling(position, this.brushSize);
-      }
+    handleImageIndexChange(index) {
+        this.save(this.imagesIndex);
+        this.getCocoFile(this._imagesRoutes, index);
     }
-  }
 
-  handleMouseMove(layer: Konva.Layer, shift: ICoordinates, position: 
ICoordinates) {
-    switch (this.labelingMode.getMode()) {
-      case LabelingMode.PolygonLabeling: {
-        this.polygonLabelingService.executeLabeling(position);
-        this.polygonLabelingService.tempDraw(layer, shift, this.selectedLabel);
-      }
+    getCocoFile(routes, index) {
+        // This is relevant for coco

Review Comment:
   ah ok, sorry, I thought you meant the whole class ;)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to