public void drawSource(String source, int Scrol, JPanel panel, JScrollBar bar, Graphics g) {
        int startY = panel.getHeight() / 4;
        int startX = 40;

        if (source.isEmpty()) {
            source = "0";
        }
        try {
            MathList<BoundingBox> vstup = new MathList();
            vstup.fillColection(source);
            Expr p = vstup.fromMathList();
            MathList<BoundingBox> boundlist = p.getAllBoundingBoxs();

            for (int i = 0; i < boundlist.size(); i++) {
                if (boundlist.get(i).e.getClass().equals(Constant.class) || boundlist.get(i).e.getClass().equals(Variable.class)) {
                    g.drawString(boundlist.get(i).e.toString(), startX + boundlist.get(i).x * sirkaZnaku, startY + boundlist.get(i).y * vyskaZnaku);
                }
                if (boundlist.get(i).e.getClass().equals(BinOp.class)) {
                    switch (((BinOp) boundlist.get(i).e).operand) {
                        case '/':
                            g.drawLine(startX + boundlist.get(i).x * sirkaZnaku, startY + boundlist.get(i).y * vyskaZnaku + ((BinOp) boundlist.get(i).e).c1.height() * vyskaZnaku - vyskaZnaku / 2, startX + (boundlist.get(i).width + boundlist.get(i).x) * sirkaZnaku, startY + boundlist.get(i).y * vyskaZnaku + ((BinOp) boundlist.get(i).e).c1.height() * vyskaZnaku - vyskaZnaku / 2);
                            break;
                        case '^':

                            break;
                        default:
                            g.drawString(Character.toString(((BinOp) boundlist.get(i).e).operand), startX + boundlist.get(i).x * sirkaZnaku + ((BinOp) boundlist.get(i).e).c1.length() * sirkaZnaku, startY + (boundlist.get(i).y + boundlist.get(i).height / 2) * vyskaZnaku);
                    }
                }
            }
        } catch (IndexOutOfBoundsException ex) {
            if (source.charAt(0) == '-' && source.length() == 1) {
                g.drawString("-", startX, startY);
            } else {
                g.drawString("Chyba", startX, startY);
            }
        } catch (VstupException ex) {
            g.drawString("Chyba vstupu", startX, startY);
        }
    }