@@ -75,7 +75,7 @@ def __init__(self, annotationparam: AnnotationParam | None = None) -> None:
7575 )
7676 else :
7777 self .annotationparam = annotationparam
78- self .annotationparam .update_annotation (self )
78+ self .annotationparam .update_item (self )
7979 self .setIcon (get_icon ("annotation.png" ))
8080
8181 def types (self ) -> tuple [type [IItemType ], ...]:
@@ -98,8 +98,8 @@ def __setstate__(self, state: tuple) -> None:
9898 shape , label , param = state
9999 self .shape = shape
100100 self .label = label
101- self .annotationparam = param
102- self .annotationparam .update_annotation (self )
101+ self .annotationparam : AnnotationParam = param
102+ self .annotationparam .update_item (self )
103103
104104 def serialize (
105105 self ,
@@ -125,7 +125,7 @@ def deserialize(
125125 """
126126 self .annotationparam = AnnotationParam (_ ("Annotation" ), icon = "annotation.png" )
127127 reader .read ("annotationparam" , instance = self .annotationparam )
128- self .annotationparam .update_annotation (self )
128+ self .annotationparam .update_item (self )
129129 self .shape .deserialize (reader )
130130 self .label .deserialize (reader )
131131
@@ -434,7 +434,7 @@ def set_item_parameters(self, itemparams: ItemParameters) -> None:
434434 update_dataset (
435435 self .annotationparam , itemparams .get ("AnnotationParam" ), visible_only = True
436436 )
437- self .annotationparam .update_annotation (self )
437+ self .annotationparam .update_item (self )
438438 self .plot ().SIG_ANNOTATION_CHANGED .emit (self )
439439
440440 # Autoscalable types API
@@ -471,6 +471,7 @@ class AnnotatedPoint(AnnotatedShape):
471471
472472 def __init__ (self , x = 0 , y = 0 , annotationparam = None ):
473473 AnnotatedShape .__init__ (self , annotationparam )
474+ self .shape : PointShape
474475 self .set_pos (x , y )
475476 self .setIcon (get_icon ("point_shape.png" ))
476477
@@ -526,6 +527,7 @@ class AnnotatedSegment(AnnotatedShape):
526527
527528 def __init__ (self , x1 = 0 , y1 = 0 , x2 = 0 , y2 = 0 , annotationparam = None ):
528529 AnnotatedShape .__init__ (self , annotationparam )
530+ self .shape : SegmentShape
529531 self .set_rect (x1 , y1 , x2 , y2 )
530532 self .setIcon (get_icon ("segment.png" ))
531533
@@ -585,6 +587,7 @@ class AnnotatedRectangle(AnnotatedShape):
585587
586588 def __init__ (self , x1 = 0 , y1 = 0 , x2 = 0 , y2 = 0 , annotationparam = None ):
587589 AnnotatedShape .__init__ (self , annotationparam )
590+ self .shape : RectangleShape
588591 self .set_rect (x1 , y1 , x2 , y2 )
589592 self .setIcon (get_icon ("rectangle.png" ))
590593
@@ -645,6 +648,7 @@ def __init__(
645648 self , x0 = 0 , y0 = 0 , x1 = 0 , y1 = 0 , x2 = 0 , y2 = 0 , x3 = 0 , y3 = 0 , annotationparam = None
646649 ):
647650 AnnotatedShape .__init__ (self , annotationparam )
651+ self .shape : ObliqueRectangleShape
648652 self .set_rect (x0 , y0 , x1 , y1 , x2 , y2 , x3 , y3 )
649653 self .setIcon (get_icon ("oblique_rectangle.png" ))
650654
@@ -740,6 +744,7 @@ class AnnotatedEllipse(AnnotatedShape):
740744
741745 def __init__ (self , x1 = 0 , y1 = 0 , x2 = 0 , y2 = 0 , annotationparam = None ):
742746 AnnotatedShape .__init__ (self , annotationparam )
747+ self .shape : EllipseShape
743748 self .set_xdiameter (x1 , y1 , x2 , y2 )
744749 self .setIcon (get_icon ("ellipse_shape.png" ))
745750 self .switch_to_ellipse ()
0 commit comments