Changeset 2269

Show
Ignore:
Timestamp:
03/13/08 11:17:56 (2 months ago)
Author:
wrobe..@pld-linux.org
Message:

- finished Transition.guard updating implementation

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gaphor/trunk/gaphor/adapters/states/propertypages.py

    r2251 r2269  
    88import gtk 
    99 
    10 from gaphor.core import _, transactional 
     10from gaphor.core import _, inject, transactional 
     11from gaphor import UML 
    1112from gaphor.diagram import items 
    1213from gaphor.ui.interfaces import IPropertyPage 
     
    1819    Transition property page allows to edit guard specification. 
    1920    """ 
     21    element_factory = inject('element_factory') 
    2022 
    2123    interface.implements(IPropertyPage) 
     
    5052    def _on_guard_change(self, entry): 
    5153        value = entry.get_text().strip() 
    52         self.context.set_guard(value) 
     54        subject = self.context.subject 
     55        if subject.guard is None: 
     56            subject.guard = self.element_factory.create(UML.Constraint) 
     57            subject.guard.specification = self.element_factory.create(UML.LiteralSpecification) 
     58        subject.guard.specification.value = value 
    5359 
    5460 
  • gaphor/trunk/gaphor/diagram/states/transition.py

    r2264 r2269  
    44 
    55from gaphor import UML 
     6from gaphor.core import inject 
    67from gaphor.diagram.diagramline import NamedLine 
    78from gaphor.diagram.style import ALIGN_LEFT, ALIGN_RIGHT, ALIGN_TOP 
     
    1213    Representation of state transition. 
    1314    """ 
    14  
    1515    __uml__ = UML.Transition 
    1616 
     
    6363 
    6464 
    65     def set_guard(self, value): 
    66         self.subject.guard.specification.value = value 
    67         self._guard.text = value 
    68  
    69  
    7065# vim:sw=4:et:ai