@Override
        public void mousePressed(MouseEvent e) {
            if (e.getButton() == MouseEvent.BUTTON1 && currentTool == Tool.LINE) {
                x1 = e.getX();
                y1 = e.getY();
            } else if (e.getButton() == MouseEvent.BUTTON2) {
                window.removeSprites();
                window.repaint();
            } else if (e.getButton() == MouseEvent.BUTTON3) {
                window.undoSprites();
                window.repaint();
            }
        }