public void saveResizeToUndo(ArrayList<DrawableItem> selected) {
        ArrayList<UndoableItem> toAdd = new ArrayList<>();
        for (DrawableItem selection : selected) {
            UndoableItem ud = new UndoableItem(selection, 3);
            Panel temp = (Panel) selection;
            int x = ((Panel) selection).getInitialResizePoint().x;
            int y = ((Panel) selection).getInitialResizePoint().y;
            int width = ((Panel) selection).getInitialWidth() - ((Rectangle) temp.getShape()).width;
            int height = ((Panel) selection).getInitialHeight() - ((Rectangle) temp.getShape()).height;
            ud.setX(width);
            ud.setY(height);
            ud.setInitialP(new Point(x, y));

            ((Panel) selection).setInitialWidth(((Rectangle) temp.getShape()).width);
            ((Panel) selection).setInitialHeight(((Rectangle) temp.getShape()).height);
            ((Panel) selection).setInitialResizePoint(new Point(((Rectangle) temp.getShape()).x, ((Rectangle) temp.getShape()).y));
            toAdd.add(ud);
        }

        this.addItemtoUndo(toAdd);

    }