public static void drawTape(ArrayList<Boolean> history, Graphics2D g, int w, int h, 
            int dotLength, boolean showLetters, boolean showMetre, boolean showDotDash)
    {
        ArrayList<Symbol> symbols = Analysis.extractSymbols(history, dotLength);
        ArrayList<Letter> letters = Analysis.extractLetters(symbols);
        int speedMultiplier = 1;
        g.setColor(new Color(245, 245, 245));
        g.fillRect(0, 0, w, h);
        g.setColor(new Color(220, 220, 220));
        int dotLengthBdy = dotLength * 2;
        if (showMetre) {
            for (int x = -(history.size() % (2 * dotLengthBdy)) * speedMultiplier; x < w; x += 2 * dotLengthBdy * speedMultiplier) {
                g.fillRect(x, 0, dotLengthBdy * speedMultiplier, h);
            }
        }
        g.setColor(Color.BLACK);
        /*for (int i = 1; i < history.size() && i < w / speedMultiplier; i++) {
            if (history.get(history.size() - i)) {
                g.fillRect(w - i * speedMultiplier, h / 3, speedMultiplier, h / 3);
            }
        }*/
        for (Symbol s : symbols) {
            if (s.type == Analysis.SymbolType.DASH || s.type == Analysis.SymbolType.DOT) {
                g.setColor(showDotDash ? (s.type == Analysis.SymbolType.DASH ? Color.BLUE : Color.RED) : Color.BLACK);
                g.fillRect(w + (s.start - history.size()) * speedMultiplier, h / 3, (s.end - s.start) * speedMultiplier, h / 3);
            }
        }
        if (showLetters) {
            g.setColor(Color.BLACK);
            g.setFont(new Font("Verdana", Font.PLAIN, 18));
            for (Letter l: letters) {
                g.drawString(l.l, w + ((l.start + l.end) / 2 - history.size()) * speedMultiplier - 5, 18);
            }
        }
    }