@@ -60,6 +60,7 @@ class AnnotatedShape(AbstractShape):
6060 """
6161
6262 __implements__ = (IBasePlotItem , ISerializableType )
63+ _icon_name = "annotation.png"
6364 SHAPE_CLASS : type [AbstractShape ] = RectangleShape # to be overridden
6465 LABEL_ANCHOR : str = ""
6566
@@ -88,7 +89,6 @@ def info_callback(annotation: AnnotatedShape) -> str:
8889 else :
8990 self .annotationparam = annotationparam
9091 self .annotationparam .update_item (self )
91- self .setIcon (get_icon ("annotation.png" ))
9292
9393 def types (self ) -> tuple [type [IItemType ], ...]:
9494 """Returns a group or category for this item.
@@ -485,6 +485,7 @@ class AnnotatedPoint(AnnotatedShape):
485485 *annotationparam* (see :py:class:`.styles.AnnotationParam`)
486486 """
487487
488+ _icon_name = "point_shape.png"
488489 SHAPE_CLASS = PointShape
489490 LABEL_ANCHOR = "TL"
490491
@@ -498,7 +499,6 @@ def __init__(
498499 super ().__init__ (annotationparam , info_callback )
499500 self .shape : PointShape
500501 self .set_pos (x , y )
501- self .setIcon (get_icon ("point_shape.png" ))
502502
503503 # ----Public API-------------------------------------------------------------
504504 def set_pos (self , x , y ):
@@ -547,6 +547,7 @@ class AnnotatedSegment(AnnotatedShape):
547547 (see :py:class:`.styles.AnnotationParam`)
548548 """
549549
550+ _icon_name = "segment.png"
550551 SHAPE_CLASS = SegmentShape
551552 LABEL_ANCHOR = "C"
552553
@@ -562,7 +563,6 @@ def __init__(
562563 super ().__init__ (annotationparam , info_callback )
563564 self .shape : SegmentShape
564565 self .set_rect (x1 , y1 , x2 , y2 )
565- self .setIcon (get_icon ("segment.png" ))
566566
567567 # ----Public API-------------------------------------------------------------
568568 def set_rect (self , x1 , y1 , x2 , y2 ):
@@ -619,6 +619,7 @@ class AnnotatedPolygon(AnnotatedShape):
619619 annotationparam: Annotation parameters
620620 """
621621
622+ _icon_name = "polygon.png"
622623 SHAPE_CLASS = PolygonShape
623624 LABEL_ANCHOR = "C"
624625
@@ -635,7 +636,6 @@ def __init__(
635636 self .set_points (points )
636637 if closed is not None :
637638 self .set_closed (closed )
638- self .setIcon (get_icon ("polygon.png" ))
639639
640640 # ----Public API-------------------------------------------------------------
641641 def set_points (self , points : list [tuple [float , float ]] | np .ndarray | None ) -> None :
@@ -775,6 +775,7 @@ class AnnotatedRectangle(AnnotatedShape):
775775 (see :py:class:`.styles.AnnotationParam`)
776776 """
777777
778+ _icon_name = "rectangle.png"
778779 SHAPE_CLASS = RectangleShape
779780 LABEL_ANCHOR = "TL"
780781
@@ -790,7 +791,6 @@ def __init__(
790791 super ().__init__ (annotationparam , info_callback )
791792 self .shape : RectangleShape
792793 self .set_rect (x1 , y1 , x2 , y2 )
793- self .setIcon (get_icon ("rectangle.png" ))
794794
795795 # ----Public API-------------------------------------------------------------
796796 def set_rect (self , x1 , y1 , x2 , y2 ):
@@ -842,6 +842,7 @@ class AnnotatedObliqueRectangle(AnnotatedRectangle):
842842 (see :py:class:`.styles.AnnotationParam`)
843843 """
844844
845+ _icon_name = "oblique_rectangle.png"
845846 SHAPE_CLASS = ObliqueRectangleShape
846847 LABEL_ANCHOR = "C"
847848
@@ -851,7 +852,6 @@ def __init__(
851852 AnnotatedShape .__init__ (self , annotationparam )
852853 self .shape : ObliqueRectangleShape
853854 self .set_rect (x0 , y0 , x1 , y1 , x2 , y2 , x3 , y3 )
854- self .setIcon (get_icon ("oblique_rectangle.png" ))
855855
856856 # ----Public API-------------------------------------------------------------
857857 def get_tr_angle (self ):
@@ -940,6 +940,7 @@ class AnnotatedEllipse(AnnotatedShape):
940940 (see :py:class:`.styles.AnnotationParam`)
941941 """
942942
943+ _icon_name = "ellipse_shape.png"
943944 SHAPE_CLASS = EllipseShape
944945 LABEL_ANCHOR = "C"
945946
@@ -955,7 +956,6 @@ def __init__(
955956 super ().__init__ (annotationparam , info_callback )
956957 self .shape : EllipseShape
957958 self .set_xdiameter (x1 , y1 , x2 , y2 )
958- self .setIcon (get_icon ("ellipse_shape.png" ))
959959 self .switch_to_ellipse ()
960960
961961 # ----Public API-------------------------------------------------------------
0 commit comments