@@ -60,6 +60,7 @@ class AnnotatedShape(AbstractShape):
60
60
"""
61
61
62
62
__implements__ = (IBasePlotItem , ISerializableType )
63
+ _icon_name = "annotation.png"
63
64
SHAPE_CLASS : type [AbstractShape ] = RectangleShape # to be overridden
64
65
LABEL_ANCHOR : str = ""
65
66
@@ -88,7 +89,6 @@ def info_callback(annotation: AnnotatedShape) -> str:
88
89
else :
89
90
self .annotationparam = annotationparam
90
91
self .annotationparam .update_item (self )
91
- self .setIcon (get_icon ("annotation.png" ))
92
92
93
93
def types (self ) -> tuple [type [IItemType ], ...]:
94
94
"""Returns a group or category for this item.
@@ -485,6 +485,7 @@ class AnnotatedPoint(AnnotatedShape):
485
485
*annotationparam* (see :py:class:`.styles.AnnotationParam`)
486
486
"""
487
487
488
+ _icon_name = "point_shape.png"
488
489
SHAPE_CLASS = PointShape
489
490
LABEL_ANCHOR = "TL"
490
491
@@ -498,7 +499,6 @@ def __init__(
498
499
super ().__init__ (annotationparam , info_callback )
499
500
self .shape : PointShape
500
501
self .set_pos (x , y )
501
- self .setIcon (get_icon ("point_shape.png" ))
502
502
503
503
# ----Public API-------------------------------------------------------------
504
504
def set_pos (self , x , y ):
@@ -547,6 +547,7 @@ class AnnotatedSegment(AnnotatedShape):
547
547
(see :py:class:`.styles.AnnotationParam`)
548
548
"""
549
549
550
+ _icon_name = "segment.png"
550
551
SHAPE_CLASS = SegmentShape
551
552
LABEL_ANCHOR = "C"
552
553
@@ -562,7 +563,6 @@ def __init__(
562
563
super ().__init__ (annotationparam , info_callback )
563
564
self .shape : SegmentShape
564
565
self .set_rect (x1 , y1 , x2 , y2 )
565
- self .setIcon (get_icon ("segment.png" ))
566
566
567
567
# ----Public API-------------------------------------------------------------
568
568
def set_rect (self , x1 , y1 , x2 , y2 ):
@@ -619,6 +619,7 @@ class AnnotatedPolygon(AnnotatedShape):
619
619
annotationparam: Annotation parameters
620
620
"""
621
621
622
+ _icon_name = "polygon.png"
622
623
SHAPE_CLASS = PolygonShape
623
624
LABEL_ANCHOR = "C"
624
625
@@ -635,7 +636,6 @@ def __init__(
635
636
self .set_points (points )
636
637
if closed is not None :
637
638
self .set_closed (closed )
638
- self .setIcon (get_icon ("polygon.png" ))
639
639
640
640
# ----Public API-------------------------------------------------------------
641
641
def set_points (self , points : list [tuple [float , float ]] | np .ndarray | None ) -> None :
@@ -775,6 +775,7 @@ class AnnotatedRectangle(AnnotatedShape):
775
775
(see :py:class:`.styles.AnnotationParam`)
776
776
"""
777
777
778
+ _icon_name = "rectangle.png"
778
779
SHAPE_CLASS = RectangleShape
779
780
LABEL_ANCHOR = "TL"
780
781
@@ -790,7 +791,6 @@ def __init__(
790
791
super ().__init__ (annotationparam , info_callback )
791
792
self .shape : RectangleShape
792
793
self .set_rect (x1 , y1 , x2 , y2 )
793
- self .setIcon (get_icon ("rectangle.png" ))
794
794
795
795
# ----Public API-------------------------------------------------------------
796
796
def set_rect (self , x1 , y1 , x2 , y2 ):
@@ -842,6 +842,7 @@ class AnnotatedObliqueRectangle(AnnotatedRectangle):
842
842
(see :py:class:`.styles.AnnotationParam`)
843
843
"""
844
844
845
+ _icon_name = "oblique_rectangle.png"
845
846
SHAPE_CLASS = ObliqueRectangleShape
846
847
LABEL_ANCHOR = "C"
847
848
@@ -851,7 +852,6 @@ def __init__(
851
852
AnnotatedShape .__init__ (self , annotationparam )
852
853
self .shape : ObliqueRectangleShape
853
854
self .set_rect (x0 , y0 , x1 , y1 , x2 , y2 , x3 , y3 )
854
- self .setIcon (get_icon ("oblique_rectangle.png" ))
855
855
856
856
# ----Public API-------------------------------------------------------------
857
857
def get_tr_angle (self ):
@@ -940,6 +940,7 @@ class AnnotatedEllipse(AnnotatedShape):
940
940
(see :py:class:`.styles.AnnotationParam`)
941
941
"""
942
942
943
+ _icon_name = "ellipse_shape.png"
943
944
SHAPE_CLASS = EllipseShape
944
945
LABEL_ANCHOR = "C"
945
946
@@ -955,7 +956,6 @@ def __init__(
955
956
super ().__init__ (annotationparam , info_callback )
956
957
self .shape : EllipseShape
957
958
self .set_xdiameter (x1 , y1 , x2 , y2 )
958
- self .setIcon (get_icon ("ellipse_shape.png" ))
959
959
self .switch_to_ellipse ()
960
960
961
961
# ----Public API-------------------------------------------------------------
0 commit comments