@Override
        public void actionPerformed(ActionEvent e) {
            Object src = e.getSource();
            if (src == drawLine) {
                switch (currentMode) {
                    case LINE:
                        shopPath.closePath();
                    case MOVE:
                        currentMode = Mode.NONE;
                        drawLine.setText("Line");
                        break;
                    case NONE:
                        currentMode = Mode.MOVE;
                        drawLine.setText("Close");
                        break;
                }
                shopEditor.repaint();
            } else if (src == reset) {
                shopPath = null;
                currentMode = Mode.NONE;
                drawLine.setText("Line");
                shopEditor.reset();
            } else if (src == startAlgorithm) {
                if (isStart) {
                    stopAlgorithm();
                } else {
                    String title = getShopTitle();
                    Font font = new Font(fontChoice, Font.PLAIN, 45);
                    Graphics2D g = (Graphics2D) shopEditor.getGraphics();
                    FontMetrics fm = g.getFontMetrics(font);
                    titleRatio = fm.stringWidth(title) / (double) fm.getHeight();
                    ratio.setText("" + titleRatio);
                    startAlgorithm();
                }
            }
        }