public static UnitValue[] parseInsets(String s, boolean acceptPanel) {
        if (s.length() == 0 || s.equals("dialog") || s.equals("panel")) {
            if (acceptPanel == false) {
                throw new IllegalAccessError("Insets now allowed: " + s + "\n");
            }
            boolean isPanel = s.startsWith("p");
            UnitValue[] ins = new UnitValue[4];
            for (int j = 0; j < 4;
                    j++) {
                ins[j] =isPanel
                        ? PlatformDefaults.getPanelInsets(j)
                        : PlatformDefaults.getDialogInsets(j);
            }
            return ins;
        } else {
            String[] insS = toTrimmedTokens(s, ' ');
            UnitValue[] ins = new UnitValue[4];
            for (int j = 0; j < 4;
                    j++) {
                UnitValue insSz =
                        parseUnitValue(insS[j < insS.length ? j : insS.length - 1],
                        UnitValue.ZERO, j % 2 == 1);
                ins[j] =insSz != null ? insSz
                        : PlatformDefaults.getPanelInsets(j);
            }
            return ins;
        }
    }