Draws the circle. @param panel @param g
(DrawingPanel panel, Graphics g)
| 64 | * @param g |
| 65 | */ |
| 66 | @Override |
| 67 | public void draw(DrawingPanel panel, Graphics g) { |
| 68 | int xpix = panel.xToPix(x)-pixRadius; |
| 69 | int ypix = panel.yToPix(y)-pixRadius; |
| 70 | g.setColor(color); |
| 71 | g.fillOval(xpix, ypix, 2*pixRadius, 2*pixRadius); // draw the circle onto the screen |
| 72 | } |
| 73 | |
| 74 | /** |
| 75 | * Gets the x coordinate. |