def update_shapes(self, event=None): self.shape = Box( Box( Text(text=lambda: stereotypes_str(self.subject, ["requirement"]), ), EditableText( text=lambda: self.subject.name or "", width=lambda: self.width - 4, style={ "font-weight": FontWeight.BOLD, "font-style": FontStyle.ITALIC if self.subject and self.subject.isAbstract else FontStyle.NORMAL, }, ), Text( text=lambda: from_package_str(self), style={"font-size": "x-small"}, ), style={"padding": (12, 4, 12, 4)}, ), *(self.show_attributes and self.subject and [attributes_compartment(self.subject)] or []), *(self.show_operations and self.subject and [operations_compartment(self.subject)] or []), *(self.show_stereotypes and stereotype_compartments(self.subject) or []), self.id_and_text_compartment(), style={ "vertical-align": VerticalAlign.TOP, }, draw=draw_border, )
def update_shapes(self, event=None): self.shape = Box( Box( Text( text=lambda: stereotypes_str(self.subject, ["block"]), style={ "min-width": 0, "min-height": 0 }, ), EditableText( text=lambda: self.subject.name or "", width=lambda: self.width - 4, style={ "font-weight": FontWeight.BOLD, "font-style": FontStyle.ITALIC if self.subject and self.subject.isAbstract else FontStyle.NORMAL, }, ), Text( text=lambda: from_package_str(self), style={ "font-size": 10, "min-width": 0, "min-height": 0 }, ), style={"padding": (12, 4, 12, 4)}, ), *(self.show_parts and self.subject and [ self.block_compartment( gettext("parts"), lambda a: a.aggregation == "composite", ) ] or []), *(self.show_references and self.subject and [ self.block_compartment( gettext("references"), lambda a: a.aggregation != "composite", ) ] or []), *(self.show_stereotypes and stereotype_compartments(self.subject) or []), style={ "min-width": 100, "min-height": 50, "vertical-align": VerticalAlign.TOP, }, draw=draw_border, )