示例#1
0
文件: block.py 项目: taroyuyu/gaphor
    def __init__(self, diagram, id=None):
        super().__init__(diagram, id)

        self.watch("show_stereotypes", self.update_shapes).watch(
            "show_parts", self.update_shapes).watch(
                "show_references",
                self.update_shapes).watch("subject[NamedElement].name").watch(
                    "subject[NamedElement].namespace.name").watch(
                        "subject[Classifier].isAbstract",
                        self.update_shapes).watch(
                            "subject[Class].ownedAttribute.aggregation",
                            self.update_shapes)
        attribute_watches(self, "Block")
        stereotype_watches(self)
示例#2
0
    def __init__(self, connections, id=None, model=None):
        super().__init__(connections, id, model)

        self.watch("show_stereotypes", self.update_shapes).watch(
            "show_attributes", self.update_shapes).watch(
                "show_operations",
                self.update_shapes).watch("subject[NamedElement].name").watch(
                    "subject[NamedElement].namespace.name").watch(
                        "subject[Classifier].isAbstract",
                        self.update_shapes).watch(
                            "subject[AbstractRequirement].externalId",
                            self.update_shapes).watch(
                                "subject[AbstractRequirement].text",
                                self.update_shapes)
        attribute_watches(self, "Requirement")
        operation_watches(self, "Requirement")
        stereotype_watches(self)
示例#3
0
    def __init__(self, id=None, model=None):
        super().__init__(id, model)
        self._folded = Folded.NONE
        self.side = Side.N

        handles = self.handles()
        h_nw = handles[NW]
        h_ne = handles[NE]
        h_sw = handles[SW]
        h_se = handles[SE]

        def is_folded():
            return self._folded != Folded.NONE

        # edge of element define default element ports
        self._ports = [
            InterfacePort(h_nw.pos, h_ne.pos, is_folded, Side.N),
            InterfacePort(h_ne.pos, h_se.pos, is_folded, Side.E),
            InterfacePort(h_se.pos, h_sw.pos, is_folded, Side.S),
            InterfacePort(h_sw.pos, h_nw.pos, is_folded, Side.W),
        ]

        self.watch("show_stereotypes", self.update_shapes).watch(
            "show_attributes", self.update_shapes
        ).watch("show_operations", self.update_shapes).watch(
            "subject[NamedElement].name"
        ).watch(
            "subject[NamedElement].namespace.name"
        ).watch(
            "subject.appliedStereotype", self.update_shapes
        ).watch(
            "subject.appliedStereotype.classifier.name"
        ).watch(
            "subject.appliedStereotype.slot", self.update_shapes
        ).watch(
            "subject.appliedStereotype.slot.definingFeature.name"
        ).watch(
            "subject.appliedStereotype.slot.value", self.update_shapes
        ).watch(
            "subject[Interface].supplierDependency", self.update_shapes
        )
        attribute_watches(self, "Interface")
        operation_watches(self, "Interface")