예제 #1
0
파일: association.py 프로젝트: Nyox/gaphor
    def __init__(self, id=None):
        NamedLine.__init__(self, id)

        # AssociationEnds are really inseperable from the AssociationItem.
        # We give them the same id as the association item.
        self._head_end = AssociationEnd(owner=self, end="head")
        self._tail_end = AssociationEnd(owner=self, end="tail")

        # Direction depends on the ends that hold the ownedEnd attributes.
        self._show_direction = False
        self._dir_angle = 0
        self._dir_pos = 0, 0
        
        #self.watch('subject<Association>.ownedEnd')\
            #.watch('subject<Association>.memberEnd')

        # For the association ends:
        base = 'subject<Association>.memberEnd<Property>.'
        self.watch(base + 'name', self.on_association_end_value)\
            .watch(base + 'aggregation', self.on_association_end_value)\
            .watch(base + 'classifier', self.on_association_end_value)\
            .watch(base + 'visibility', self.on_association_end_value)\
            .watch(base + 'lowerValue', self.on_association_end_value)\
            .watch(base + 'upperValue', self.on_association_end_value)\
            .watch(base + 'owningAssociation', self.on_association_end_value) \
            .watch(base + 'type<Class>.ownedAttribute', self.on_association_end_value) \
            .watch(base + 'type<Interface>.ownedAttribute', self.on_association_end_value) \
            .watch('subject<Association>.ownedEnd') \
            .watch('subject<Association>.navigableOwnedEnd')
예제 #2
0
    def __init__(self, id=None):
        NamedLine.__init__(self, id)

        # AssociationEnds are really inseperable from the AssociationItem.
        # We give them the same id as the association item.
        self._head_end = AssociationEnd(owner=self, end="head")
        self._tail_end = AssociationEnd(owner=self, end="tail")

        # Direction depends on the ends that hold the ownedEnd attributes.
        self._show_direction = False
        self._dir_angle = 0
        self._dir_pos = 0, 0

        #self.watch('subject<Association>.ownedEnd')\
        #.watch('subject<Association>.memberEnd')

        # For the association ends:
        base = 'subject<Association>.memberEnd<Property>.'
        self.watch(base + 'name', self.on_association_end_value)\
            .watch(base + 'aggregation', self.on_association_end_value)\
            .watch(base + 'classifier', self.on_association_end_value)\
            .watch(base + 'visibility', self.on_association_end_value)\
            .watch(base + 'lowerValue', self.on_association_end_value)\
            .watch(base + 'upperValue', self.on_association_end_value)\
            .watch(base + 'owningAssociation', self.on_association_end_value) \
            .watch(base + 'type<Class>.ownedAttribute', self.on_association_end_value) \
            .watch(base + 'type<Interface>.ownedAttribute', self.on_association_end_value) \
            .watch('subject<Association>.ownedEnd') \
            .watch('subject<Association>.navigableOwnedEnd')
예제 #3
0
    def __init__(self, id=None):
        NamedLine.__init__(self, id)

        # AssociationEnds are really inseperable from the AssociationItem.
        # We give them the same id as the association item.
        self._head_end = AssociationEnd(owner=self, end="head")
        self._tail_end = AssociationEnd(owner=self, end="tail")

        # Direction depends on the ends that hold the ownedEnd attributes.
        self._show_direction = False
        self._dir_angle = 0
        self._dir_pos = 0, 0

        # self.watch('subject<Association>.ownedEnd')\
        # .watch('subject<Association>.memberEnd')

        # For the association ends:
        base = "subject<Association>.memberEnd<Property>."
        self.watch(base + "name", self.on_association_end_value).watch(
            base + "aggregation", self.on_association_end_value
        ).watch(base + "classifier", self.on_association_end_value).watch(
            base + "visibility", self.on_association_end_value
        ).watch(
            base + "lowerValue", self.on_association_end_value
        ).watch(
            base + "upperValue", self.on_association_end_value
        ).watch(
            base + "owningAssociation", self.on_association_end_value
        ).watch(
            base + "type<Class>.ownedAttribute", self.on_association_end_value
        ).watch(
            base + "type<Interface>.ownedAttribute", self.on_association_end_value
        ).watch(
            base + "appliedStereotype", self.on_association_end_value
        ).watch(
            base + "appliedStereotype.slot", self.on_association_end_value
        ).watch(
            base + "appliedStereotype.slot.definingFeature.name",
            self.on_association_end_value,
        ).watch(
            base + "appliedStereotype.slot.value", self.on_association_end_value
        ).watch(
            "subject<Association>.ownedEnd"
        ).watch(
            "subject<Association>.navigableOwnedEnd"
        )
예제 #4
0
    def __init__(self, id=None):
        NamedLine.__init__(self, id)

        # AssociationEnds are really inseperable from the AssociationItem.
        # We give them the same id as the association item.
        self._head_end = AssociationEnd(owner=self, end="head")
        self._tail_end = AssociationEnd(owner=self, end="tail")

        # Direction depends on the ends that hold the ownedEnd attributes.
        self._show_direction = False
        self._dir_angle = 0
        self._dir_pos = 0, 0

        # self.watch('subject<Association>.ownedEnd')\
        # .watch('subject<Association>.memberEnd')

        # For the association ends:
        base = "subject<Association>.memberEnd<Property>."
        self.watch(base + "name", self.on_association_end_value).watch(
            base + "aggregation", self.on_association_end_value
        ).watch(base + "classifier", self.on_association_end_value).watch(
            base + "visibility", self.on_association_end_value
        ).watch(base + "lowerValue", self.on_association_end_value).watch(
            base + "upperValue", self.on_association_end_value).watch(
                base + "owningAssociation",
                self.on_association_end_value).watch(
                    base + "type<Class>.ownedAttribute",
                    self.on_association_end_value).watch(
                        base + "type<Interface>.ownedAttribute",
                        self.on_association_end_value).watch(
                            base + "appliedStereotype",
                            self.on_association_end_value).watch(
                                base + "appliedStereotype.slot",
                                self.on_association_end_value
                            ).watch(
                                base +
                                "appliedStereotype.slot.definingFeature.name",
                                self.on_association_end_value,
                            ).watch(
                                base + "appliedStereotype.slot.value",
                                self.on_association_end_value).watch(
                                    "subject<Association>.ownedEnd"
                                ).watch(
                                    "subject<Association>.navigableOwnedEnd")
예제 #5
0
 def __init__(self, id=None):
     NamedLine.__init__(self, id)
     self._guard = self.add_text("guard.specification", editable=True)
     self.watch("subject<Transition>.guard<Constraint>.specification",
                self.on_guard)
예제 #6
0
 def __init__(self, id=None):
     NamedLine.__init__(self, id)
     self.watch('subject<Extension>.ownedEnd')
예제 #7
0
파일: flow.py 프로젝트: Nyox/gaphor
 def __init__(self, id = None):
     NamedLine.__init__(self, id)
     self._guard = self.add_text('guard.value', editable=True)
     self.watch('subject<ControlFlow>.guard', self.on_control_flow_guard)
     self.watch('subject<ObjectFlow>.guard', self.on_control_flow_guard)
예제 #8
0
 def __init__(self, id=None):
     NamedLine.__init__(self, id)
     self._guard = self.add_text('guard.value', editable=True)
     self.watch('subject<ControlFlow>.guard', self.on_control_flow_guard)
     self.watch('subject<ObjectFlow>.guard', self.on_control_flow_guard)
예제 #9
0
 def __init__(self, id = None):
     NamedLine.__init__(self, id)
     self._guard = self.add_text('guard.specification.value', editable=True)
     self.watch('subject<Transition>.guard<Constraint>.specification<LiteralSpecification>.value', self.on_guard)
예제 #10
0
 def __init__(self, id=None):
     NamedLine.__init__(self, id)
     self._guard = self.add_text("guard.specification", editable=True)
     self.watch("subject<Transition>.guard<Constraint>.specification", self.on_guard)
예제 #11
0
 def __init__(self, id=None):
     NamedLine.__init__(self, id)
     self.watch("subject<Extension>.ownedEnd")
예제 #12
0
 def __init__(self, id=None, model=None):
     NamedLine.__init__(self, id, model)
     self.watch("subject<Extension>.ownedEnd")