Moved some code from MouseListener to EditPane
Rectangle class uses double coordinates