@Override
        public void paintComponent(Graphics g) {
            super.paintComponents(g);
            Graphics2D g2d = (Graphics2D) g;

            for (int i = 0; i <= 100; i++) {
                g2d.draw(new Line2D.Double(i * 10, 0, i * 10, 10));
            }



            AffineTransform trans = new AffineTransform();

            Object[] arr = listModel.toArray();
            for (int i = 0; i < arr.length; i++) {

                if (arr[i] instanceof AbstractElement) {
                    AbstractElement o = (AbstractElement) arr[i];
//                    o.persist(null, i);
                    if (o instanceof Transformation) {
                        // new set of transformations
                        if (i > 0 && arr[i - 1] instanceof DrawableElement) {
                            trans = new AffineTransform();
                            System.out.println("clearning");
                        }
                        Transformation t = (Transformation) o;
                        trans.concatenate(t.getAffineTransform(DrawPanel.this.getSize()));
                    } else if (o instanceof DrawableElement) {
                        g2d.setTransform(trans);
                        DrawableElement d = (DrawableElement) o;
                        d.drawTo(g2d, DrawPanel.this.getSize());
                    }
//                System.out.println("Drawing: " + d);
                }
            }
        }