Ejemplo n.º 1
0
 def draw_label(self):
     px, py = self.trot(0, 1.0)
     pic().draw_text(px,
                     py,
                     self.label,
                     anchor='south',
                     rotation=self.angle)
Ejemplo n.º 2
0
    def draw_label(self):

        if self.south_label:
            px, py = self.trot(0, -0.6)
            a = 'north'
        else:
            px, py = self.trot(0, 0.6)
            a = 'south'
        pic().draw_text(px, py, self.label, anchor=a, rotation=self.angle)
Ejemplo n.º 3
0
Archivo: node.py Proyecto: cbosoft/cpy
    def draw(self):
        paths = self.paths()

        pic().draw_paths_transformed(paths, shift=(self.x, self.y), rotation=(self.angle), scale=self.scale)

        if self.label:
            self.draw_label()

        if self.value:
            self.draw_value()
Ejemplo n.º 4
0
 def draw_value(self):
     if self.label:
         x, y = self.trot(0.5, -0.4)
     else:
         x, y = self.trot(0.5, 0.0)
     angle = int(self.angle) % 180
     if angle > 0:
         a = 'center'
     else:
         a = 'west'
     pic().draw_text(x, y, self.value, anchor=a)
Ejemplo n.º 5
0
    def draw_label(self):
        if self.show_named:
            for name, i in self.named_ports.items():
                px, py = self.port(i)
                if py > 0:
                    py -= 0.7
                    a = 'east'
                else:
                    py += 0.7
                    a = 'west'
                x, y = self.trot(px, py)
                pic().draw_text(x, y, name, anchor=a, rotation=self.angle + 90)

        pic().draw_text(self.x,
                        self.y,
                        self.label,
                        anchor='center',
                        rotation=self.angle)
Ejemplo n.º 6
0
 def draw_value(self):
     x, y = self.trot(0, -0.75)
     pic().draw_text(x, y, self.value, anchor='center', rotation=self.angle)
Ejemplo n.º 7
0
 def draw_label(self):
     x, y = self.trot(0, 0.75)
     pic().draw_text(x, y, self.label, anchor='center', rotation=self.angle)
Ejemplo n.º 8
0
Archivo: group.py Proyecto: cbosoft/cpy
 def draw_label(self):
     pic().draw_text(self.x+0.5, self.y+0.5, self.label, anchor='south west', colour='gray', default_size='huge')
Ejemplo n.º 9
0
 def draw_label(self):
     angle = int(self.angle) % 180
     px, py = rot(0, 2.0 * abs(self.scale[1]), angle)
     pic().draw_text(*self.trf(px, py), self.label, rotation=angle)
Ejemplo n.º 10
0
 def __init__(self, name):
     self.paths = list()
     self.nodes = list()
     self.pic = pic(name)
Ejemplo n.º 11
0
 def draw_value(self):
     px, py = self.trot(0, -1)
     pic().draw_text(px, py, self.value, anchor='north', rotation=self.angle)
Ejemplo n.º 12
0
 def draw_value(self):
     pic().draw_text(self.x, self.y, self.value, anchor='center', rotation=self.angle)