public GUI(String frameName) throws IOException {
        frame = new JFrame(frameName) {{
            setMinimumSize(new Dimension(500, 500));
            setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
            setLayout(new MigLayout("wrap 7, fill"));
            KeyboardFocusManager manager = KeyboardFocusManager.getCurrentKeyboardFocusManager();
            manager.addKeyEventDispatcher(new MyKeyDispatcher());
        }};

        imageIcon = new ImageIcon(IMG_PATH);

        layeredPane = new JLayeredPane();
        layeredPane.setOpaque(true);
        layeredPane.setLocation(0, 0);
        layeredPane.setSize(frame.getSize());
        layeredPane.addComponentListener(new componentListener());

        startButton = new JButton("Проложить");
        startButton.addActionListener(new StartButtonListener());


        showButton = new JButton("Просмотр");
        showButton.addActionListener(new ShowButtonListener());

        writeButton = new JButton("Сохранить изображение");
        writeButton.addActionListener(new WriteButtonListener());

        clearButton = new JButton("Сброс");
        clearButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                JMaps.clearHousesList();
                GUI.get2DGraphicsBufferedImage().setColor(get2DGraphicsBufferedImage().getBackground());
                GUI.get2DGraphicsBufferedImage().setComposite(AlphaComposite.getInstance(AlphaComposite.CLEAR));
                GUI.get2DGraphicsBufferedImage().fillRect(0,0, bufferedImage.getWidth(), bufferedImage.getHeight());
                GUI.get2DGraphicsBufferedImage().setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER));
                GUI.setsplitterLabel("            ");
                GUI.setsecondaryCableLabel("            ");
                GUI.setmainCableLabel("            ");
                GUI.refreshControls();
                GUI.setProgressBarValue(0);
            }
        });

        progressBar = new JProgressBar();
        progressBar.setSize(100, 30);
        progressBar.setMinimum(0);
        progressBar.setMaximum(100);
        progressBar.setVisible(true);
        progressBar.setStringPainted(true);

        housesCheckBox = new JCheckBox("Добавить абонента");
        slowCheckBox = new JCheckBox("optimal");
        slowCheckBox.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                if (getStateOfSlowCheckBox())
                    setStateOfFastCheckBox(false);
                else if (!getStateOfSlowCheckBox())
                    setStateOfFastCheckBox(true);
            }
        });
        fastCheckBox = new JCheckBox("fast");
        fastCheckBox.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                if (getStateOfFastCheckBox())
                    setStateOfSlowCheckBox(false);
                else if (!getStateOfFastCheckBox())
                    setStateOfSlowCheckBox(true);
            }
        });

        scrollPane1 = new JScrollPane();
        scrollPane1.setLocation(0, 0);
        scrollPane1.getVerticalScrollBar().setUnitIncrement(60);
        scrollPane1.getHorizontalScrollBar().setUnitIncrement(60);
        scrollPane1.setOpaque(true);
        scrollPane1.setViewportView(new JLabel(imageIcon));

        scrollPane2 = new JScrollPane();
        scrollPane2.setLocation(0, 0);
        scrollPane2.getVerticalScrollBar().setUnitIncrement(60);
        scrollPane2.getHorizontalScrollBar().setUnitIncrement(60);
        scrollPane2.getViewport().setOpaque(false);
        bufferedImage = new BufferedImage(imageIcon.getIconWidth(), imageIcon.getIconHeight(), BufferedImage.TYPE_INT_ARGB);
        graphics2D = bufferedImage.createGraphics();

        label = new JLabel(new ImageIcon(bufferedImage));
        scrollPane2.getViewport().setBackground(new Color(0, 0, 0, 0.0f));
        scrollPane2.setBackground(new Color(0, 0, 0, 0.0f));
        scrollPane2.getViewport().setOpaque(true);
        scrollPane2.setViewportView(label);
        scrollPane2.getViewport().addChangeListener(new scrollStateChanged());
        label.addMouseListener(new mouseListener());
        label.setBackground(new Color(0, 0, 0, 0.0f));

        layeredPane.add(scrollPane1, 0);
        layeredPane.add(scrollPane2, 0);

        frame.add(startButton, "grow, span 1 2, height ::30");
        frame.add(showButton, "grow, span 1 2, height ::30");
        frame.add(writeButton, "grow, span 1 2, height ::30");
        frame.add(clearButton, "grow, span 1 2, height ::30");

        frame.add(fastCheckBox, "grow, height ::15");
        //frame.add(stationCheckBox, "center");

        frame.add(housesCheckBox, "center, span 1 2, height ::30");
        frame.add(progressBar, "grow, span 1 2, height ::30");

        frame.add(slowCheckBox, "grow, height ::15");

        frame.add(layeredPane, "span, h 100%, grow, wrap");

        splitterLabel = new JLabel("           ");
        mainCableLabel = new JLabel("                   ");
        secondaryCableLabel = new JLabel("                    ");

        frame.add(new JLabel("Сплиттер 1х8   PS-108-А5-9В15-N:"), "right");
        frame.add(splitterLabel, "left");
        frame.add(new JLabel("ОКСНМ-10-01-0.22-8: "), "right");
        frame.add(mainCableLabel, "left");
        frame.add(new JLabel("ДОТС-П-08А: "), "right");
        frame.add(secondaryCableLabel, "left");

        frame.pack();
        frame.setVisible(true);
    }