Changeset 2254
- Timestamp:
- 03/05/08 12:50:17 (2 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
gaphor/trunk/gaphor/diagram/states/tests/test_pseudostates.py
r2242 r2254 11 11 Initial pseudostate item test cases. 12 12 """ 13 13 14 def test_initial_pseudostate(self): 14 15 """Test creation of initial pseudostate gaphor/trunk/gaphor/diagram/states/transition.py
r2251 r2254 23 23 NamedLine.__init__(self, id) 24 24 self._guard = self.add_text('guard.specification.value', editable=True) 25 self.add_watch(UML.Transition.guard )26 self.add_watch(UML.Constraint.specification )27 self.add_watch(UML.LiteralSpecification.value )25 self.add_watch(UML.Transition.guard, self.on_guard) 26 self.add_watch(UML.Constraint.specification, self.on_guard) 27 self.add_watch(UML.LiteralSpecification.value, self.on_guard) 28 28 29 29 … … 35 35 self._guard.text = self.subject.guard.specification.value 36 36 super(TransitionItem, self).postload() 37 38 39 def on_guard(self, event): 40 if not self.subject: 41 return 42 element = event.element 43 guard = self.subject.guard 44 if event is None or \ 45 (element is self.subject) or \ 46 (element is guard) or \ 47 (guard and element is guard.specification): 48 try: 49 self._guard.text = self.subject.guard.specification.value or '' 50 except AttributeError: 51 # Have a no-value here 52 self._guard.text = '' 53 self.request_update() 37 54 38 55
