private void drawGrid(Graphics g, Point p1, Point p2, Point p3, Point p4, int gridSizeX, int gridSizeY, int zUnit) {
		g.setColor(Color.LIGHT_GRAY);
		if (gridSizeX > 0) {
			int x = p4.x + gridSizeX, xD = p1.x + gridSizeX;
			int y = p4.y, yD = p1.y;
			while (x < p3.x) {
				g.drawLine(x, y, xD, yD);
				x += gridSizeX;
				xD += gridSizeX;
			}
		}
		if (gridSizeY > 0) {
			int x = p1.x, xD = p2.x;
			int y = p1.y + gridSizeY, yD = p2.y + gridSizeY;
			while (y < p4.y) {
				g.drawLine(x, y, xD, yD);
				y += gridSizeY;
				yD += gridSizeY;
			}
		}
		if (zUnit > 0) {
			if (gridSizeX > 0) {	//line should be follow X
				int unitX = Math.abs(p1.x - p4.x)/zUnit;
				int unitY = Math.abs(p1.y - p4.y)/zUnit;
				int x = p4.x + unitX, xD = p3.x + unitX;
				int y = p4.y - unitY, yD = p3.y - unitY;
				while (x < p1.x) {
					g.drawLine(x, y, xD, yD);
					x += unitX;
					y -= unitY;
					xD += unitX;
					yD -= unitY;
				}				
			}
			if (gridSizeY > 0) {	//line should be follow Y
				int unitX = Math.abs(p1.x - p2.x)/zUnit;
				int unitY = Math.abs(p1.y - p2.y)/zUnit;
				int x = p1.x + unitX, xD = p4.x + unitX;
				int y = p1.y - unitY, yD = p4.y - unitY;
				while (x < p2.x) {
					g.drawLine(x, y, xD, yD);
					x += unitX;
					y -= unitY;
					xD += unitX;
					yD -= unitY;
				}				
			}

		}

	}