| 527 | pass # must override in subclass |
| 528 | |
| 529 | class Point(GraphicsObject): |
| 530 | def __init__(self, x, y): |
| 531 | GraphicsObject.__init__(self, ["outline", "fill"]) |
| 532 | self.setFill = self.setOutline |
| 533 | self.x = x |
| 534 | self.y = y |
| 535 | |
| 536 | def _draw(self, canvas, options): |
| 537 | x,y = canvas.toScreen(self.x,self.y) |
| 538 | return canvas.create_rectangle(x,y,x+1,y+1,options) |
| 539 | |
| 540 | def _move(self, dx, dy): |
| 541 | self.x = self.x + dx |
| 542 | self.y = self.y + dy |
| 543 | |
| 544 | def clone(self): |
| 545 | other = Point(self.x,self.y) |
| 546 | other.config = self.config.copy() |
| 547 | return other |
| 548 | |
| 549 | def coordStr(self): |
| 550 | return "(%s, %s)" % (approx(self.x), approx(self.y)) |
| 551 | |
| 552 | def __str__(self): |
| 553 | return "Point" + self.coordStr() |
| 554 | |
| 555 | def getX(self): return self.x |
| 556 | def getY(self): return self.y |
| 557 | |
| 558 | class _BBox(GraphicsObject): |
| 559 | # Internal base class for objects represented by bounding box |
no outgoing calls
no test coverage detected