
//************************************
//
// CSC112b Spring 1999
// Ileana Streinu
//
//  This is a user-defined class for points. 
//  It is  called myPoint, 
//  to distinguish it from the Java in-built
//  class named Point.
//
//************************


// import java.applet.*; // not neede here, this is not the
// applet class

import java.awt.*;	//  graphics
import java.io.*;	//  I/O


public class myPoint extends Point
{

// class variables

// the x and y coordinates of the point
// are already present in the class Point
// so we do NOT define them again
// (if we do, we won't get the desired effect)
//int x; not included
//int y; not included

// new class variables, specific to myPoint

int color;
int shape;

//********************
//
//  constructor method
//
//
//********************

myPoint (int a, int b)
{
x=a;
y=b;
}//end constructor

myPoint(int a, int b, int c, int s )
{

x=a;
y=b;
color=c;
shape=s;

}// end constructor

//********************
//
//  Print method
//
//
//********************

public void Print()
{

System.out.println("myPoint( " + x + " , " + y + " ) " +
        "shape = " + shape + " , color = " + color);

}//end Print


//*****//********************
//
//  Draw method
//
//
//********************

public void Draw(Graphics g)
{
if (color == 0)
        g.setColor(Color.black);
else g.setColor(Color.red);

if(shape == 0)
        g.drawOval(x,y,5,5);
else g.drawRect(x,y,5,5);

}// end Draw



}// end class myPoint


