private void setMaxWidthHeight(PetriNet pn) {
        int maxW = 0;
        int maxH = 0;
        for (Resource r : pn.getListOfResources()) {
            if (r.getWidth() > maxW) {
                maxW = r.getWidth();
            }
            if (r.getHeight() > maxH) {
                maxH = r.getHeight();
            }
        }
        for (Place p : pn.getListOfPlaces()) {
            if (p.getWidth() > maxW) {
                maxW = p.getWidth();
            }
            if (p.getHeight() > maxH) {
                maxH = p.getHeight();
            }
        }
        for (Transition t : pn.getListOfTransitions()) {
            if (t.getWidth() > maxW) {
                maxW = t.getWidth();
            }
            if (t.getHeight() > maxH) {
                maxH = t.getHeight();
            }
        }
        maxHeight = maxH;
        maxWidth = maxW;

    }