Lines Matching refs:self

173     def __init__(self, picChar, unit, topLeft, colour, size = Point(1,1)):
174 self.picChar = picChar
175 self.unit = unit
176 self.displayName = unit
177 self.nameLoc = 'top'
178 self.topLeft = topLeft
179 self.colour = colour
180 self.size = size
181 self.border = 1.0
182 self.dataSelect = model.BlobDataSelect()
183 self.shorten = 0
185 def render(self, cr, view, event, select, time):
196 def __init__(self, picChar, unit, topLeft=Point(0,0),
199 super(Block,self).__init__(picChar, unit, topLeft, colour,
202 self.stripDir = 'horiz'
205 self.stripOrd = 'LR'
207 self.blankStrips = 0
209 self.shape = 'box'
210 self.visualDecoder = None
212 def render(self, cr, view, event, select, time):
214 if event is None or self.displayName.startswith('_'):
215 event = model.BlobEvent(self.unit, time)
217 if self.picChar in event.visuals:
218 strips = event.visuals[self.picChar].to_striped_block(
219 select & self.dataSelect)
223 if self.stripOrd == 'RL':
235 size = Point(*self.size.to_pair())
236 if self.shorten != 0 and self.size.x > (num_strips * self.shorten):
237 size.x = num_strips * self.shorten
244 cr.translate(*self.topLeft.to_pair())
260 strip_is_horiz = self.stripDir == 'horiz'
296 if self.border > 0.5:
303 xb, yb, width, height, dx, dy = cr.text_extents(self.displayName)
307 if self.nameLoc == 'left':
319 if (self.displayName != '' and
320 not self.displayName.startswith('_')):
321 cr.set_source_color(self.colour)
323 cr.show_text(self.displayName)
325 if self.nameLoc == 'left':
334 if self.stripOrd == "RL":
337 if self.shape == 'box':
339 elif self.shape == 'openBottom':
341 elif self.shape == 'fifo':
347 cr.set_source_color(self.colour)
348 cr.set_line_width(view.thickLineWidth * self.border)
352 if self.unit == '_':
360 def __init__(self, picChar, unit, topLeft, colour=colours.black,
362 super(Key,self).__init__(picChar, unit, topLeft, colour, size = size)
363 self.colours = 'BBBB'
364 self.displayName = unit
366 def render(self, cr, view, event, select, time):
369 cr.translate(*self.topLeft.to_pair())
370 # cr.translate(*(self.size - Point(1,1)).scale(0.5).to_pair())
371 half_width = self.size.x / 2.0
372 cr.translate(*(self.size - Point(1.0 + half_width,1.0)).scale(0.5).
375 num_colours = len(self.colours)
379 (self.size * Point(0.0,1.0 / num_colours)))
384 cr.set_source_color(self.colour)
399 colour_char = self.colours[i]
409 cr.set_source_color(self.colour)
422 def __init__(self, unit, topLeft, colour=colours.black,
424 super(Arrow,self).__init__(unit, unit, topLeft, colour, size = size)
425 self.direc = direc
427 def render(self, cr, view, event, select, time):
430 cr.translate(*self.topLeft.to_pair())
431 cr.translate(*(self.size - Point(1,1)).scale(0.5).to_pair())
432 cr.scale(*self.size.to_pair())
434 (view.blobIndentFactor / self.size).to_pair()
441 if self.direc == 'left':
458 cr.set_source_color(self.colour)