public void resizeAll() {
        double hfactor = (double) variables.THUMBNAIL_HEIGHT / (double) variables.CANVAS_HEIGHT;
        double wfactor = (double) variables.THUMBNAIL_WIDTH / (double) variables.CANVAS_WIDTH;

        for (GeneralPath pi : lines) {
            AffineTransform at = new AffineTransform();
            at.scale(wfactor, hfactor);
            pi.transform(at);
        }
        for (Rectangle re : panels) {
            re.setSize((int) ((double) re.width * wfactor), (int) ((double) re.height * hfactor));
        }

    }