public LayerPanel() {
        layerCount = 0;
        initComponents();
        selected = -1;
        displayed = new ArrayList<>();
        setFocusable(true);
        addMouseMotionListener(new MouseMotionListener() {

            @Override
            public void mouseDragged(MouseEvent e) {
            }

            @Override
            public void mouseMoved(MouseEvent e) {
                currentMousePosn = new Point(e.getX(), e.getY());
                repaint();
            }

        });

        addMouseListener(new MouseListener() {

            @Override
            public void mouseClicked(MouseEvent e) {
                clickedLayer = selectLayer();
                if (clickedLayer != -1 && e.getX() == currentMousePosn.x && e.getY() == currentMousePosn.y) {
                    ll.alertObservers(new LayerEvent((SwingUtilities.isRightMouseButton(e)) ? LayerEvent.LAYER_DESELECTED : LayerEvent.LAYER_SELECTED, clickedLayer));
                }
            }

            @Override
            public void mousePressed(MouseEvent e) {
            }

            @Override
            public void mouseReleased(MouseEvent e) {
            }

            @Override
            public void mouseEntered(MouseEvent e) {
            }

            @Override
            public void mouseExited(MouseEvent e) {
            }

        });
        repaint();
    }