public virtual void drawPoint(Point point, int color) { /* Image bufImage = Image.createImage(image.getWidth(), image.getHeight()); * Graphics g = bufImage.getGraphics(); * g.drawImage(image, 0, 0, 0); * g.setColor(color); * g.drawLine(point.getX(), point.getY(), * point.getX()+1, point.getY()); * image = bufImage; * repaint();*/ }
public virtual void drawCross(Point point, int color) { Image bufImage = Image.createImage(image.getWidth(), image.getHeight()); Graphics g = bufImage.getGraphics(); g.drawImage(image, 0, 0, 0); g.setColor(color); g.drawLine(point.getX() - 5, point.getY(), point.getX() + 5, point.getY()); g.drawLine(point.getX(), point.getY() - 5, point.getX(), point.getY() + 5); image = bufImage; repaint(); }
public virtual void drawPolygon(Point[] points, int color) { Image bufImage = Image.createImage(image.getWidth(), image.getHeight()); Graphics g = bufImage.getGraphics(); g.drawImage(image, 0, 0, 0); g.setColor(color); int i = 0; for (; i < points.length - 1; i++) { g.drawLine(points[i].getX(), points[i].getY(), points[i + 1].getX(), points[i + 1].getY()); } g.drawLine(points[i].getX(), points[i].getY(), points[0].getX(), points[0].getY()); image = bufImage; repaint(); }
public virtual void drawPoint(Point point, int color) { /* Image bufImage = Image.createImage(image.getWidth(), image.getHeight()); Graphics g = bufImage.getGraphics(); g.drawImage(image, 0, 0, 0); g.setColor(color); g.drawLine(point.getX(), point.getY(), point.getX()+1, point.getY()); image = bufImage; repaint();*/ }