Example #1
0
 def save(self, save_func):
     NamedLine.save(self, save_func)
     save_func('show-direction', self._show_direction)
     if self._head_end.subject:
         save_func('head-subject', self._head_end.subject)
     if self._tail_end.subject:
         save_func('tail-subject', self._tail_end.subject)
Example #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')
Example #3
0
 def save(self, save_func):
     NamedLine.save(self, save_func)
     save_func("show-direction", self._show_direction)
     if self._head_end.subject:
         save_func("head-subject", self._head_end.subject)
     if self._tail_end.subject:
         save_func("tail-subject", self._tail_end.subject)
Example #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('subject<Association>.ownedEnd') \
            .watch('subject<Association>.navigableOwnedEnd')
Example #5
0
 def save(self, save_func):
     NamedLine.save(self, save_func)
     save_func("show-direction", self._show_direction)
     if self._head_end.subject:
         save_func("head-subject", self._head_end.subject)
     if self._tail_end.subject:
         save_func("tail-subject", self._tail_end.subject)
Example #6
0
 def save(self, save_func):
     NamedLine.save(self, save_func)
     save_func('show-direction', self._show_direction)
     if self._head_end.subject:
         save_func('head-subject', self._head_end.subject)
     if self._tail_end.subject:
         save_func('tail-subject', self._tail_end.subject)
Example #7
0
 def load(self, name, value):
     # end_head and end_tail were used in an older Gaphor version
     if name in ("head_end", "head_subject", "head-subject"):
         # type(self._head_end).subject.load(self._head_end, value)
         # self._head_end.load('subject', value)
         self._head_end.subject = value
     elif name in ("tail_end", "tail_subject", "tail-subject"):
         # type(self._tail_end).subject.load(self._tail_end, value)
         # self._tail_end.load('subject', value)
         self._tail_end.subject = value
     else:
         NamedLine.load(self, name, value)
Example #8
0
 def load(self, name, value):
     # end_head and end_tail were used in an older Gaphor version
     if name in ('head_end', 'head_subject', 'head-subject'):
         #type(self._head_end).subject.load(self._head_end, value)
         #self._head_end.load('subject', value)
         self._head_end.subject = value
     elif name in ('tail_end', 'tail_subject', 'tail-subject'):
         #type(self._tail_end).subject.load(self._tail_end, value)
         #self._tail_end.load('subject', value)
         self._tail_end.subject = value
     else:
         NamedLine.load(self, name, value)
Example #9
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"
        )
Example #10
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")
Example #11
0
 def postload(self):
     NamedLine.postload(self)
     self._head_end.set_text()
     self._tail_end.set_text()
Example #12
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)
Example #13
0
 def __init__(self, id=None):
     NamedLine.__init__(self, id)
     self.watch('subject<Extension>.ownedEnd')
Example #14
0
 def postload(self):
     NamedLine.postload(self)
     self._head_end.set_text()
     self._tail_end.set_text()
Example #15
0
File: flow.py Project: 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)
Example #16
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)
Example #17
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)
Example #18
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)
Example #19
0
 def __init__(self, id=None, model=None):
     NamedLine.__init__(self, id, model)
     self.watch("subject<Extension>.ownedEnd")
Example #20
0
 def __init__(self, id=None):
     NamedLine.__init__(self, id)
     self.watch("subject<Extension>.ownedEnd")