Refactor mouse listener for index panel and note panel.
Remove legacy code.