public static boolean isValid(MouseEvent e, Canvas c, Palette pal)
			{
			if (pal != null && pal.getSelectedColor(e.getButton()) == null) return false;
			Point p = e.getPoint();
			if (p.x < 0 || p.y < 0) return false;
			Dimension d = c.getImageSize();
			if (p.x >= d.width || p.y >= d.height) return false;
			return true;
			}