public virtual void paint(Graphics g) { g.setColor(0xFFFFFF); g.fillRect(0, 0, getWidth(), getHeight()); if (message1 != null) { g.setColor(0x000000); g.drawString(message1, 1, 1, Graphics.TOP | Graphics.LEFT); g.drawString(message2, 1, 1 + g.getFont().getHeight(), Graphics.TOP | Graphics.LEFT); } }
public virtual void paint(Graphics g) { g.setColor(0xFFFFFF); g.fillRect(0, 0, getWidth(), getHeight()); if (image != null) { g.drawImage(image, getWidth() / 2, getHeight() / 2, Graphics.VCENTER | Graphics.HCENTER); } g.setColor(0x000000); for (int i = 0; i < log.Length; i++) { if (log[i] != null) { g.drawString(log[i], 0, i * logFont.getHeight(), Graphics.TOP | Graphics.LEFT); } } }
public virtual void drawLine(Line line, 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(line.getP1().getX(), line.getP1().getY(), line.getP2().getX(), line.getP2().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 drawPoints(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); for (int i = 0; i < points.length - 1; i++) { g.drawLine(points[i].getX(), points[i].getY(), points[i].getX() + 1, points[i].getY()); } image = bufImage; repaint(); }
public virtual void drawLines(Line[] lines, int color) { Image bufImage = Image.createImage(image.getWidth(), image.getHeight()); Graphics g = bufImage.getGraphics(); g.drawImage(image, 0, 0, 0); g.setColor(color); for (int i = 0; i < lines.length - 1; i++) { g.drawLine(lines[i].getP1().getX(), lines[i].getP1().getY(), lines[i].getP2().getX(), lines[i].getP2().getY()); } image = bufImage; repaint(); }
public virtual void drawMatrix(bool[][] matrix) { Image bufImage = Image.createImage(image.getWidth(), image.getHeight()); Graphics g = bufImage.getGraphics(); g.setColor(0xCCCCCC); for (int y = 0; y < matrix[0].Length; y++) { for (int x = 0; x < matrix.Length; x++) { if (matrix[x][y] == true) { g.drawLine(x, y, x + 1, y); } } } image = bufImage; repaint(); }