def update_avoid(self, *args, **kw): src = avoid.ConnEnd(avoid.Point(self.source[0], self.source[1])) dest = avoid.ConnEnd(avoid.Point(self.dest[0], self.dest[1])) if self.avoid_conn is None: self.avoid_conn = avoid.ConnRef(router, src, dest) else: self.avoid_conn.setEndpoints(src, dest) router.processTransaction()
def _update_avoid(self): if self.parentItem(): avoid_router = self.parentItem().avoid_router src = avoid.ConnEnd(avoid.Point(self.x1, self.y1)) if self.isVisible(): dest = avoid.ConnEnd(avoid.Point(self.x2, self.y2)) else: dest = src # Don't route duplicate connection if self.avoid_conn is None: self.avoid_conn = avoid.ConnRef(avoid_router, src, dest) else: self.avoid_conn.setEndpoints(src, dest)
def on_dest(self, *args, **kw): if self.dest is not None: pin = avoid.ShapeConnectionPin(self.dest.avoid_shape, 1, avoid.ATTACH_POS_LEFT, avoid.ATTACH_POS_CENTRE, True, -buffer_distance, avoid.ConnDirLeft) dest = avoid.ConnEnd(self.dest.avoid_shape, 1) self.avoid_conn.setDestEndpoint(dest) self.update_avoid()
def on_source(self, *args, **kw): if self.source is not None: pin = avoid.ShapeConnectionPin(self.source.avoid_shape, 1, avoid.ATTACH_POS_RIGHT, avoid.ATTACH_POS_CENTRE, True, buffer_distance, avoid.ConnDirRight) src = avoid.ConnEnd(self.source.avoid_shape, 1) self.avoid_conn.setSourceEndpoint(src) self.update_avoid()