package com.tony.view;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Point;
import java.awt.Robot;
import java.awt.image.BufferedImage;
import java.util.Vector;
import javax.swing.JPanel;
public class DrawComponentPanel extends JPanel {
private int[] xPoints = new int[4];
private int[] yPoints = new int[4];
private Color fillColor;
private Color curColor;
private boolean fill = false;
public DrawComponentPanel() {
xPoints[0] = 0;
xPoints[1] = 0;
xPoints[2] = 0;
xPoints[3] = 0;
yPoints[0] = 0;
yPoints[1] = 0;
yPoints[2] = 0;
yPoints[3] = 0;
}
protected void paintComponent(final Graphics g) {
super.paintComponent(g);
Robot robot = null;
Point p;
try {
robot = new Robot();
} catch (Exception ex) {
ex.printStackTrace();
}
Vector v = new Vector();
int savex = 0, xleft = 0, xright = 0, pflag = 0, xenter = 0, x = 0, y = 0;
p = new Point(xPoints[0] + 1, yPoints[0]