Changeset 2287

Show
Ignore:
Timestamp:
04/07/08 01:21:21 (1 month ago)
Author:
arj..@yirdis.nl
Message:

Fixes #112 and make flow/fork/decision unit tests pass.

Files:

Legend:

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

    r2252 r2287  
    958958#        h1, h2 = self.element.handles() 
    959959#        return geometry.distance_line_point(h1.pos, h2.pos, (x, y))[1] 
     960         
     961        # No cyclic connect is possible on a Flow/Decision node: 
     962        line = self.line 
     963        subject = self.element.subject 
     964         
     965        if handle is line.head and line.tail.connected_to and line.tail.connected_to.subject is subject \ 
     966           or handle is line.tail and line.head.connected_to and line.head.connected_to.subject is subject: 
     967            return None 
    960968 
    961969        return super(FlowForkDecisionNodeConnect, self).glue(handle) 
  • gaphor/trunk/gaphor/diagram/activitynodes.py

    r2226 r2287  
    339339        subject = self.subject 
    340340        if subject and is_join_node(subject) and \ 
    341                 (event.element is subject.joinSpec or \ 
     341                (event is None or \ 
     342                 event.element is subject.joinSpec or \ 
    342343                 event.element is subject.joinSpec.value): 
    343344            if is_join_node(subject) and not (subject.joinSpec and subject.joinSpec.value):