package Projects.Cible1;

import gpclasses.baseclasses.*;
import gpclasses.animations.*;
import gpclasses.graphics.*;

public class Square65
{

public static void drawBackground(CgpCanvas c, int x1, int y1, int x2, int y2)
{
}

public static void draw(CgpCanvas c, int x1, int y1, int x2, int y2, int frameClr, int foreClr, int backClr, int pattern, boolean pressed, int lamp)
{
if(pressed)
{
	if(lamp > 0)
	{
		// Rectangle
		{
		int recWidth = (x2 - 0)-(x1 + 0)+1;
		int recHeight = (y2 - 0)-(y1 + 0)+1;
		int nCorner = Math.min(16, (int) ((Math.min(recWidth, recHeight)/2) + 0.5f));
		c.fillRectWithBorder(
			0x00ffffff,	// LineColor
			1,	// line width
			CgpLinePattern.LINE_SOLID,
			(x1 + 0),
			(y1 + 0),
			recWidth,
			recHeight,
			frameClr,	// ForeColor
			frameClr,	// BackColor
			pattern,	// Pattern
			CgpRectangle.ARC_CORNERS,	// Corner Type
			nCorner,	// Width of round corner
			nCorner		// Height of round corner
		);
		}

		// Rectangle
		{
		int recWidth = (x2 - 1)-(x1 + 0)+1;
		int recHeight = (y2 - 1)-(y1 + 0)+1;
		int nCorner = Math.min(16, (int) ((Math.min(recWidth, recHeight)/2) + 0.5f));
		c.fillRectWithBorder(
			0x00000000,	// LineColor
			1,	// line width
			CgpLinePattern.LINE_SOLID,
			(x1 + 0),
			(y1 + 0),
			recWidth,
			recHeight,
			frameClr,	// ForeColor
			frameClr,	// BackColor
			pattern,	// Pattern
			CgpRectangle.ARC_CORNERS,	// Corner Type
			nCorner,	// Width of round corner
			nCorner		// Height of round corner
		);
		}

		// Rectangle
		{
		int recWidth = (x2 - 1)-(x1 + 1)+1;
		int recHeight = (y2 - 1)-(y1 + 1)+1;
		int nCorner = Math.min(16, (int) ((Math.min(recWidth, recHeight)/2) + 0.5f));
		c.fillRectWithBorder(
			frameClr,	// LineColor
			1,	// line width
			CgpLinePattern.LINE_SOLID,
			(x1 + 1),
			(y1 + 1),
			recWidth,
			recHeight,
			frameClr,	// ForeColor
			frameClr,	// BackColor
			pattern,	// Pattern
			CgpRectangle.ARC_CORNERS,	// Corner Type
			nCorner,	// Width of round corner
			nCorner		// Height of round corner
		);
		}

		// Pie
		c.fillPieWithBorder(
			(x1 + 4),
			(y1 + 2),
			(x2 - 37)-(x1 + 4)+1,
			(y2 - 0)-(y1 + 2)+1,
			150,	// Start Angle
			60,	// Arc Angle
			foreClr,	// ForeColor
			backClr,	// BackColor
			pattern,	// Pattern
			frameClr,	// LineColor
			1,	// line width
			CgpLinePattern.LINE_NONE
		);

	}
	else
	{
		// Rectangle
		{
		int recWidth = (x2 - 0)-(x1 + 0)+1;
		int recHeight = (y2 - 0)-(y1 + 0)+1;
		int nCorner = Math.min(16, (int) ((Math.min(recWidth, recHeight)/2) + 0.5f));
		c.fillRectWithBorder(
			0x00ffffff,	// LineColor
			1,	// line width
			CgpLinePattern.LINE_SOLID,
			(x1 + 0),
			(y1 + 0),
			recWidth,
			recHeight,
			frameClr,	// ForeColor
			frameClr,	// BackColor
			pattern,	// Pattern
			CgpRectangle.ARC_CORNERS,	// Corner Type
			nCorner,	// Width of round corner
			nCorner		// Height of round corner
		);
		}

		// Rectangle
		{
		int recWidth = (x2 - 1)-(x1 + 0)+1;
		int recHeight = (y2 - 1)-(y1 + 0)+1;
		int nCorner = Math.min(16, (int) ((Math.min(recWidth, recHeight)/2) + 0.5f));
		c.fillRectWithBorder(
			0x00000000,	// LineColor
			1,	// line width
			CgpLinePattern.LINE_SOLID,
			(x1 + 0),
			(y1 + 0),
			recWidth,
			recHeight,
			frameClr,	// ForeColor
			frameClr,	// BackColor
			pattern,	// Pattern
			CgpRectangle.ARC_CORNERS,	// Corner Type
			nCorner,	// Width of round corner
			nCorner		// Height of round corner
		);
		}

		// Rectangle
		{
		int recWidth = (x2 - 1)-(x1 + 1)+1;
		int recHeight = (y2 - 1)-(y1 + 1)+1;
		int nCorner = Math.min(16, (int) ((Math.min(recWidth, recHeight)/2) + 0.5f));
		c.fillRectWithBorder(
			frameClr,	// LineColor
			1,	// line width
			CgpLinePattern.LINE_SOLID,
			(x1 + 1),
			(y1 + 1),
			recWidth,
			recHeight,
			frameClr,	// ForeColor
			frameClr,	// BackColor
			pattern,	// Pattern
			CgpRectangle.ARC_CORNERS,	// Corner Type
			nCorner,	// Width of round corner
			nCorner		// Height of round corner
		);
		}

		// Pie
		c.fillPieWithBorder(
			(x1 + 4),
			(y1 + 2),
			(x2 - 37)-(x1 + 4)+1,
			(y2 - 0)-(y1 + 2)+1,
			150,	// Start Angle
			60,	// Arc Angle
			foreClr,	// ForeColor
			backClr,	// BackColor
			pattern,	// Pattern
			frameClr,	// LineColor
			1,	// line width
			CgpLinePattern.LINE_NONE
		);

	}
}
else
{
	if(lamp > 0)
	{
		// Rectangle
		{
		int recWidth = (x2 - 0)-(x1 + 0)+1;
		int recHeight = (y2 - 0)-(y1 + 0)+1;
		int nCorner = Math.min(16, (int) ((Math.min(recWidth, recHeight)/2) + 0.5f));
		c.fillRectWithBorder(
			0x00000000,	// LineColor
			1,	// line width
			CgpLinePattern.LINE_SOLID,
			(x1 + 0),
			(y1 + 0),
			recWidth,
			recHeight,
			frameClr,	// ForeColor
			frameClr,	// BackColor
			pattern,	// Pattern
			CgpRectangle.ARC_CORNERS,	// Corner Type
			nCorner,	// Width of round corner
			nCorner		// Height of round corner
		);
		}

		// Rectangle
		{
		int recWidth = (x2 - 1)-(x1 + 0)+1;
		int recHeight = (y2 - 1)-(y1 + 0)+1;
		int nCorner = Math.min(16, (int) ((Math.min(recWidth, recHeight)/2) + 0.5f));
		c.fillRectWithBorder(
			0x00ffffff,	// LineColor
			1,	// line width
			CgpLinePattern.LINE_SOLID,
			(x1 + 0),
			(y1 + 0),
			recWidth,
			recHeight,
			frameClr,	// ForeColor
			frameClr,	// BackColor
			pattern,	// Pattern
			CgpRectangle.ARC_CORNERS,	// Corner Type
			nCorner,	// Width of round corner
			nCorner		// Height of round corner
		);
		}

		// Rectangle
		{
		int recWidth = (x2 - 1)-(x1 + 1)+1;
		int recHeight = (y2 - 1)-(y1 + 1)+1;
		int nCorner = Math.min(16, (int) ((Math.min(recWidth, recHeight)/2) + 0.5f));
		c.fillRectWithBorder(
			frameClr,	// LineColor
			1,	// line width
			CgpLinePattern.LINE_SOLID,
			(x1 + 1),
			(y1 + 1),
			recWidth,
			recHeight,
			frameClr,	// ForeColor
			frameClr,	// BackColor
			pattern,	// Pattern
			CgpRectangle.ARC_CORNERS,	// Corner Type
			nCorner,	// Width of round corner
			nCorner		// Height of round corner
		);
		}

		// Pie
		c.fillPieWithBorder(
			(x1 + 3),
			(y1 + 1),
			(x2 - 36)-(x1 + 3)+1,
			(y2 - 1)-(y1 + 1)+1,
			150,	// Start Angle
			60,	// Arc Angle
			foreClr,	// ForeColor
			backClr,	// BackColor
			pattern,	// Pattern
			frameClr,	// LineColor
			1,	// line width
			CgpLinePattern.LINE_NONE
		);

	}
	else
	{
		// Rectangle
		{
		int recWidth = (x2 - 0)-(x1 + 0)+1;
		int recHeight = (y2 - 0)-(y1 + 0)+1;
		int nCorner = Math.min(16, (int) ((Math.min(recWidth, recHeight)/2) + 0.5f));
		c.fillRectWithBorder(
			0x00000000,	// LineColor
			1,	// line width
			CgpLinePattern.LINE_SOLID,
			(x1 + 0),
			(y1 + 0),
			recWidth,
			recHeight,
			frameClr,	// ForeColor
			frameClr,	// BackColor
			pattern,	// Pattern
			CgpRectangle.ARC_CORNERS,	// Corner Type
			nCorner,	// Width of round corner
			nCorner		// Height of round corner
		);
		}

		// Rectangle
		{
		int recWidth = (x2 - 1)-(x1 + 0)+1;
		int recHeight = (y2 - 1)-(y1 + 0)+1;
		int nCorner = Math.min(16, (int) ((Math.min(recWidth, recHeight)/2) + 0.5f));
		c.fillRectWithBorder(
			0x00ffffff,	// LineColor
			1,	// line width
			CgpLinePattern.LINE_SOLID,
			(x1 + 0),
			(y1 + 0),
			recWidth,
			recHeight,
			frameClr,	// ForeColor
			frameClr,	// BackColor
			pattern,	// Pattern
			CgpRectangle.ARC_CORNERS,	// Corner Type
			nCorner,	// Width of round corner
			nCorner		// Height of round corner
		);
		}

		// Rectangle
		{
		int recWidth = (x2 - 1)-(x1 + 1)+1;
		int recHeight = (y2 - 1)-(y1 + 1)+1;
		int nCorner = Math.min(16, (int) ((Math.min(recWidth, recHeight)/2) + 0.5f));
		c.fillRectWithBorder(
			frameClr,	// LineColor
			1,	// line width
			CgpLinePattern.LINE_SOLID,
			(x1 + 1),
			(y1 + 1),
			recWidth,
			recHeight,
			frameClr,	// ForeColor
			frameClr,	// BackColor
			pattern,	// Pattern
			CgpRectangle.ARC_CORNERS,	// Corner Type
			nCorner,	// Width of round corner
			nCorner		// Height of round corner
		);
		}

		// Pie
		c.fillPieWithBorder(
			(x1 + 3),
			(y1 + 1),
			(x2 - 36)-(x1 + 3)+1,
			(y2 - 1)-(y1 + 1)+1,
			150,	// Start Angle
			60,	// Arc Angle
			foreClr,	// ForeColor
			backClr,	// BackColor
			pattern,	// Pattern
			frameClr,	// LineColor
			1,	// line width
			CgpLinePattern.LINE_NONE
		);

	}
}
}
}
