/* mPoint.java */ import java.awt.*; public class mPoint { int x, y; Color color = Color.black; public mPoint(int _x, int _y) { /* initial location */ x = _x; y = _y; } public void setColor(Color _color) { color = _color;} /* check if position inside object */ public boolean isInside(int _x, int _y) { return (x == _x) && (y == _y); } /* move object */ public void moveTo(int _x, int _y) { if ( (x == _x) && (y == _y) ) return; x = _x; /* update location */ y = _y; } public void move(int dx, int dy) { if ( (dx == 0) && (dy == 0) ) return; x += dx; /* update location */ y += dy; } public void paint(Graphics g) {} }