def __init__(self, nodes, tail, head, cnt, *rest): self.tail = nodes[forceunicode(tail)] self.head = nodes[forceunicode(head)] cnt = int(cnt) self.points = [(float(rest[i]), float(rest[i+1])) for i in range(0, cnt*2, 2)] rest = rest[cnt*2:] if len(rest) > 2: label, xl, yl = rest[:3] self.label = forceunicode(label) self.xl = float(xl) self.yl = float(yl) rest = rest[3:] self.style, self.color = rest linematch = re_linewidth.match(self.style) if linematch: num = linematch.group(1) self.linewidth = int(round(float(num))) self.style = self.style[linematch.end(0):] else: self.linewidth = 1 self.highlight = False self.cachedbezierpoints = None self.cachedarrowhead = None self.cachedlimits = None
def __init__(self, name, x, y, w, h, label, style, shape, color, fillcolor): self.name = forceunicode(name) self.x = float(x) self.y = float(y) self.w = float(w) self.h = float(h) self.label = forceunicode(label) self.style = style self.shape = shape self.color = color self.fillcolor = fillcolor self.highlight = False
def __init__(self, nodes, tail, head, cnt, *rest): self.tail = nodes[forceunicode(tail)] self.head = nodes[forceunicode(head)] cnt = int(cnt) self.points = [(float(rest[i]), float(rest[i+1])) for i in range(0, cnt*2, 2)] rest = rest[cnt*2:] if len(rest) > 2: self.label, xl, yl = rest[:3] self.xl = float(xl) self.yl = float(yl) rest = rest[3:] self.style, self.color = rest linematch = re_linewidth.match(self.style) if linematch: num = linematch.group(1) self.linewidth = int(round(float(num))) self.style = self.style[linematch.end(0):] else: self.linewidth = 1 self.highlight = False self.cachedbezierpoints = None self.cachedarrowhead = None self.cachedlimits = None
def setstatusbar(self, text, fgcolor=None, bgcolor=None): info = (forceunicode(text), fgcolor or self.STATUSBAR_FGCOLOR, bgcolor or self.STATUSBAR_BGCOLOR) if info != self.statusbarinfo: self.statusbarinfo = info self.must_redraw = True