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)
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')
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)
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)
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)
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" )
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")
def postload(self): NamedLine.postload(self) self._head_end.set_text() self._tail_end.set_text()
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)
def __init__(self, id=None): NamedLine.__init__(self, id) self.watch('subject<Extension>.ownedEnd')
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)
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)
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)
def __init__(self, id=None, model=None): NamedLine.__init__(self, id, model) self.watch("subject<Extension>.ownedEnd")
def __init__(self, id=None): NamedLine.__init__(self, id) self.watch("subject<Extension>.ownedEnd")